Skip to content

Commit 4051ea2

Browse files
committed
Merge branch 'try-ng-redux' into GEOV-135-timeline
2 parents 38b419c + 8bc7ef1 commit 4051ea2

File tree

201 files changed

+9332
-4746
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+9332
-4746
lines changed

client/package-lock.json

Lines changed: 104 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
},
1414
"private": true,
1515
"dependencies": {
16+
"@angular-redux/form": "^6.7.0",
17+
"@angular-redux/router": "^7.0.0",
18+
"@angular-redux/store": "^7.1.1",
1619
"@angular/animations": "^5.2.8",
1720
"@angular/cli": "^1.2.6",
1821
"@angular/common": "^5.2.8",
@@ -26,14 +29,21 @@
2629
"@angular/platform-server": "^5.2.8",
2730
"@angular/router": "^5.2.8",
2831
"@ng-bootstrap/ng-bootstrap": "^1.0.0",
32+
"@redux-utilities/reduce-reducers": "^0.1.5",
2933
"angular-playground": "^4.0.0",
3034
"angular2-elastic-input": "^1.4.2",
3135
"bootstrap": "^4.0.0",
3236
"core-js": "^2.4.1",
3337
"d3": "^5.0.0",
3438
"element-resize-detector": "^1.1.14",
39+
"flux-standard-action": "^2.0.1",
3540
"font-awesome": "^4.7.0",
3641
"ng2-slim-loading-bar": "^4.0.0",
42+
"ngx-auto-unsubscribe": "^2.3.0",
43+
"ramda": "^0.25.0",
44+
"redux": "^3.7.2",
45+
"redux-logger": "^3.0.6",
46+
"redux-observable": "^0.18.0",
3747
"rxjs": "^5.1.0",
3848
"socket.io-client": "^2.0.3",
3949
"typescript": "~2.5.0",
@@ -45,6 +55,7 @@
4555
"@types/jasmine": "~2.5.53",
4656
"@types/jasminewd2": "~2.0.2",
4757
"@types/node": "~6.0.60",
58+
"@types/redux-logger": "^3.0.5",
4859
"@types/socket.io-client": "^1.4.29",
4960
"codelyzer": "~3.0.1",
5061
"jasmine-core": "~2.6.2",

client/src/app/app-routing.module.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { NgModule } from '@angular/core';
22
import { Route, Routes, RouterModule } from '@angular/router';
33
import { AuthGuard } from './core';
44
import { HomeComponent } from './modules/home/pages/home.component';
5+
import { ProjectListComponent } from './modules/projects/components/project-list/project-list.component';
6+
import { ProjectsModule } from './modules/projects/projects.module';
57

68

79

@@ -29,16 +31,11 @@ const routes: Routes = [
2931
},
3032
{
3133
path: '',
32-
loadChildren: './modules/login-and-registration/login-and-registration.module#LoginAndRegistrationModule',
33-
},
34-
{
35-
path: 'account',
3634
loadChildren: './modules/account/account.module#AccountModule',
37-
canActivate: [AuthGuard]
3835
},
3936
{
4037
path: 'projects',
41-
loadChildren: './modules/projects/projects.module#ProjectsModule',
38+
loadChildren: () => ProjectsModule,
4239
canActivate: [AuthGuard]
4340
},
4441
fallbackRoute

client/src/app/app.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
<ng2-slim-loading-bar color="inherit"></ng2-slim-loading-bar>
2+
23
<router-outlet></router-outlet>

client/src/app/app.component.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1-
import { Component, HostListener} from '@angular/core';
1+
import { Component, HostListener } from '@angular/core';
22
import { EntityEditorService } from './core';
3+
import { NgRedux, select } from '@angular-redux/store';
34

45
@Component({
56
selector: 'gv-root',
67
host: {
78
'(window:keydown)': 'keydown($event)',
89
'(window:keyup)': 'keyup($event)'
9-
},
10+
},
1011
templateUrl: './app.component.html',
1112
styleUrls: ['./app.component.scss']
1213
})
1314
export class AppComponent {
1415

15-
constructor(private entityEditor: EntityEditorService){
16+
constructor(
17+
private entityEditor: EntityEditorService
18+
) {}
1619

17-
}
1820

1921
keydown($event) {
20-
if($event.key === 'Alt'){
22+
if ($event.key === 'Alt') {
2123
// this.entityEditor.showDfhId = true;
2224
}
2325
};
2426
keyup($event) {
25-
if($event.key === 'Alt'){
27+
if ($event.key === 'Alt') {
2628
// this.entityEditor.showDfhId = false;
2729
}
2830
};

client/src/app/app.module.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import { NgModule, LOCALE_ID } from '@angular/core';
33
import { CommonModule } from '@angular/common';
44
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
55
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
6-
76
import { registerLocaleData } from '@angular/common';
87
import localeDeCh from '@angular/common/locales/de-CH';
9-
108
registerLocaleData(localeDeCh);
119

1210
// Third party imports
13-
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
14-
import {ElasticInputModule} from 'angular2-elastic-input';
15-
import {SlimLoadingBarModule} from 'ng2-slim-loading-bar';
11+
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
12+
import { ElasticInputModule } from 'angular2-elastic-input';
13+
import { SlimLoadingBarModule } from 'ng2-slim-loading-bar';
14+
import { NgReduxModule } from '@angular-redux/store';
15+
import { NgReduxRouterModule } from '@angular-redux/router';
1616

1717
// Own imports
1818
import { AppRoutingModule } from './app-routing.module';
@@ -21,13 +21,18 @@ import { HomeModule } from './modules/home/home.module';
2121
import { AuthGuard, ActiveAccountService, ActiveProjectService, SDKBrowserModule, EntityEditorService } from './core';
2222
import { PassiveLinkModule } from './shared';
2323
import { ControlMessagesModule, LanguageSearchTypeaheadModule } from './shared';
24-
24+
import { StoreModule } from './core/store/module';
25+
import { InformationModule } from './modules/information/information.module';
26+
import { ProjectsModule } from './modules/projects/projects.module';
2527

2628
@NgModule({
2729
declarations: [
2830
AppComponent
2931
],
3032
imports: [
33+
NgReduxRouterModule,
34+
NgReduxModule,
35+
StoreModule,
3136
SDKBrowserModule.forRoot(),
3237
NgbModule.forRoot(),
3338
ElasticInputModule.forRoot(),
@@ -38,10 +43,11 @@ import { ControlMessagesModule, LanguageSearchTypeaheadModule } from './shared';
3843
FormsModule,
3944
ReactiveFormsModule,
4045
AppRoutingModule,
41-
HomeModule,
46+
ProjectsModule,
4247
PassiveLinkModule,
4348
ControlMessagesModule,
44-
LanguageSearchTypeaheadModule
49+
LanguageSearchTypeaheadModule,
50+
// InformationModule
4551
],
4652
providers: [
4753
EntityEditorService,
@@ -50,7 +56,7 @@ import { ControlMessagesModule, LanguageSearchTypeaheadModule } from './shared';
5056
AuthGuard,
5157
{ provide: LOCALE_ID, useValue: 'de-CH' }
5258
],
53-
entryComponents : [
59+
entryComponents: [
5460
AppComponent
5561
],
5662
bootstrap: [AppComponent]

client/src/app/core/active-account/active-account.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { LoopBackAuth } from '../sdk/services/core/auth.service';
66
import { AccountApi } from '../sdk/services/custom/Account';
77
import { environment } from '../../../environments/environment';
88
import { LoopBackConfig } from '../sdk/lb.config';
9+
import { AccountActions } from '../../modules/account/api/actions';
10+
911

1012
@Injectable()
1113
export class ActiveAccountService {
@@ -16,7 +18,7 @@ export class ActiveAccountService {
1618

1719
constructor(
1820
private authService: LoopBackAuth,
19-
private userApi: AccountApi,
21+
private userApi: AccountApi
2022
) {
2123
LoopBackConfig.setBaseURL(environment.baseUrl);
2224
LoopBackConfig.setApiVersion(environment.apiVersion);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Injectable } from '@angular/core';
2+
import { FluxStandardAction } from 'flux-standard-action';
3+
import { Project } from 'app/core';
4+
5+
interface MetaData { };
6+
type Payload = Project;
7+
export type ActiveProjectAction = FluxStandardAction<Payload, MetaData>;
8+
9+
10+
@Injectable()
11+
export class ActiveProjectActions {
12+
13+
static ACTIVE_PROJECT_UPDATED = 'ACTIVE_PROJECT_UPDATED';
14+
15+
activeProjectUpdated(payload:Payload):ActiveProjectAction {
16+
return {
17+
type: ActiveProjectActions.ACTIVE_PROJECT_UPDATED,
18+
payload,
19+
meta:null,
20+
}
21+
}
22+
23+
}

0 commit comments

Comments
 (0)