summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2019-01-08 19:05:10 +0530
committerIBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com>2019-01-08 19:05:23 +0530
commit2772941b61cb2435ebdfd9d9b252734bce59ffea (patch)
treebc9ba3ea00a8f39dc60ff84f572e27fdfafe6d99
parentf352a874bd742784541ee67112ea2e648a5b3951 (diff)
Moved store to core module
Moved store to core module as the application should have single instance of store. The core module is injected at only app module and should not be imported in any other module. Issue-ID: CCSDK-816 Change-Id: I4e7a61d0cd731c3c90a47b827b59821f4ec6ef41 Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
-rw-r--r--cds-ui/client/src/app/common/store/README.md22
-rw-r--r--cds-ui/client/src/app/common/store/actions/blueprint.action.ts70
-rw-r--r--cds-ui/client/src/app/common/store/effects/blueprint.effects.ts56
-rw-r--r--cds-ui/client/src/app/common/store/models/blueprint-http.model.ts25
-rw-r--r--cds-ui/client/src/app/common/store/models/blueprint.model.ts30
-rw-r--r--cds-ui/client/src/app/common/store/models/blueprintState.model.ts32
-rw-r--r--cds-ui/client/src/app/common/store/models/imports.model.ts24
-rw-r--r--cds-ui/client/src/app/common/store/models/metadata.model.ts28
-rw-r--r--cds-ui/client/src/app/common/store/reducers/app.reducer.ts31
-rw-r--r--cds-ui/client/src/app/common/store/reducers/blueprint.reducer.ts56
-rw-r--r--cds-ui/client/src/app/common/store/selectors/blueprint.selectors.ts31
-rw-r--r--cds-ui/client/src/app/common/store/state/app.state.ts33
-rw-r--r--cds-ui/client/src/app/common/store/state/blueprint.state.ts31
13 files changed, 0 insertions, 469 deletions
diff --git a/cds-ui/client/src/app/common/store/README.md b/cds-ui/client/src/app/common/store/README.md
deleted file mode 100644
index c9584c84a..000000000
--- a/cds-ui/client/src/app/common/store/README.md
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-============LICENSE_START==========================================
-===================================================================
-Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
-===================================================================
-
-Unless otherwise specified, all software contained herein is licensed
-under the Apache License, Version 2.0 (the License);
-you may not use this software except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-============LICENSE_END============================================
-*/
-
-This folder contains the code related to ngrx/store, for application state management. \ No newline at end of file
diff --git a/cds-ui/client/src/app/common/store/actions/blueprint.action.ts b/cds-ui/client/src/app/common/store/actions/blueprint.action.ts
deleted file mode 100644
index 6a0ab8065..000000000
--- a/cds-ui/client/src/app/common/store/actions/blueprint.action.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-============LICENSE_START==========================================
-===================================================================
-Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
-===================================================================
-
-Unless otherwise specified, all software contained herein is licensed
-under the Apache License, Version 2.0 (the License);
-you may not use this software except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-============LICENSE_END============================================
-*/
-import { Injectable } from '@angular/core';
-import { Action, Store } from '@ngrx/store';
-import { IBlueprint } from '../models/blueprint.model';
-import { IBlueprintState } from '../models/blueprintState.model';
-
-export const LOAD_BLUEPRINT = 'LOAD_BLUEPRINT';
-export const LOAD_BLUEPRINT_SUCCESS = 'LOAD_BLUEPRINT_SUCCESS';
-export const LOAD_BLUEPRINT_FAILURE = 'LOAD_BLUEPRINT_FAILURE';
-export const UPDATE_BLUEPRINT ='UPDATE_BLUEPRINT';
-export const UPDATE_BLUEPRINT_SUCCESS = 'UPDATE_BLUEPRINT_SUCCESS';
-export const UPDATE_BLUEPRINT_FAILURE = 'UPDATE_BLUEPRINT_FAILURE';
-export const SAVE_BLUEPRINT = 'SAVE_BLUEPRINT';
-export const SAVE_BLUEPRINT_SUCCESS = 'SAVE_BLUEPRINT_SUCCESS';
-export const SAVE_BLUEPRINT_FAILURE = 'SAVE_BLUEPRINT_FAILURE';
-
-export const SET_BLUEPRINT = 'SET Blueprint';
-export const REMOVE_BLUEPRINT = 'Remove Blueprint';
-
-
-export class LoadBlueprint implements Action {
- readonly type = LOAD_BLUEPRINT;
- constructor(public startLoadSuccess?: boolean) {}
-}
-
-export class LoadBlueprintSuccess implements Action {
- readonly type = LOAD_BLUEPRINT_SUCCESS;
- constructor(public payload: IBlueprint) {}
-}
-
-export class LoadBlueprintFailure implements Action {
- readonly type = LOAD_BLUEPRINT_FAILURE;
- constructor(public error: any) {}
-}
-
-// export class SetBlueprint implements Action {
-// readonly type = SET_BLUEPRINT;
-// constructor(public payload: Blueprint) {}
-// }
-
-// export class RemoveBlueprint implements Action {
-// readonly type = REMOVE_BLUEPRINT;
-// constructor(public payload: Blueprint) {}
-// }
-
-export class UpdateBlueprint implements Action {
- readonly type = UPDATE_BLUEPRINT;
- constructor(public payload: IBlueprint) {}
-}
-
-export type Actions = LoadBlueprint | LoadBlueprintSuccess | LoadBlueprintFailure; \ No newline at end of file
diff --git a/cds-ui/client/src/app/common/store/effects/blueprint.effects.ts b/cds-ui/client/src/app/common/store/effects/blueprint.effects.ts
deleted file mode 100644
index e1b1c2fd9..000000000
--- a/cds-ui/client/src/app/common/store/effects/blueprint.effects.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-============LICENSE_START==========================================
-===================================================================
-Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
-===================================================================
-
-Unless otherwise specified, all software contained herein is licensed
-under the Apache License, Version 2.0 (the License);
-you may not use this software except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-============LICENSE_END============================================
-*/
-
-import { Injectable } from '@angular/core';
-import { Effect, ofType, Actions } from '@ngrx/effects';
-import { Store, select } from '@ngrx/store';
-import { of } from 'rxjs';
-import { switchMap, map, withLatestFrom, catchError } from 'rxjs/operators';
-
-import { IAppState } from '../state/app.state';
-import * as BlueprintActions from '../actions/blueprint.action';
-// import { IBlueprintHttp } from '../models/blueprint-http.model';
-// import { BlueprintService } from '../../services/blueprint.service';
-// import { BlueprintService } from '../../../feature-modules/blueprint/blueprint.service';
-
-@Injectable()
-export class BlueprintEffects {
-
-
- constructor(
- // private blueprintService: BlueprintService,
- private _actions$: Actions,
- private _store: Store<IAppState>
- ) {}
-
- // @Effect()
- // getBlueprint$ = this._actions$.pipe(
- // ofType<BlueprintActions.LoadBlueprint>(BlueprintActions.LOAD_BLUEPRINT),
- // switchMap(() =>
- // this.blueprintService.loadBlueprint().pipe(
- // map((blueprintResponse: any) => new BlueprintActions.LoadBlueprintSuccess(blueprintResponse)),
- // catchError((error : any) => of(new BlueprintActions.LoadBlueprintSuccess(error)))
- // ),
- // ,
- // switchMap((blueprintResponse: any) => of(new BlueprintActions.LoadBlueprintSuccess(blueprintResponse)))
-// ),
-// )
-} \ No newline at end of file
diff --git a/cds-ui/client/src/app/common/store/models/blueprint-http.model.ts b/cds-ui/client/src/app/common/store/models/blueprint-http.model.ts
deleted file mode 100644
index e0e98d580..000000000
--- a/cds-ui/client/src/app/common/store/models/blueprint-http.model.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-============LICENSE_START==========================================
-===================================================================
-Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
-===================================================================
-
-Unless otherwise specified, all software contained herein is licensed
-under the Apache License, Version 2.0 (the License);
-you may not use this software except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-============LICENSE_END============================================
-*/
-import { IBlueprint } from '../models/blueprint.model';
-
-export interface IBlueprintHttp {
- blueprint: IBlueprint;
-} \ No newline at end of file
diff --git a/cds-ui/client/src/app/common/store/models/blueprint.model.ts b/cds-ui/client/src/app/common/store/models/blueprint.model.ts
deleted file mode 100644
index a061a4364..000000000
--- a/cds-ui/client/src/app/common/store/models/blueprint.model.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-============LICENSE_START==========================================
-===================================================================
-Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
-===================================================================
-
-Unless otherwise specified, all software contained herein is licensed
-under the Apache License, Version 2.0 (the License);
-you may not use this software except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-============LICENSE_END============================================
-*/
-
-import { IMetaData } from './metadata.model';
-import { IImportModel } from './imports.model';
-
-
-export interface IBlueprint {
- metadata: IMetaData;
- fileImports: Array<IImportModel>
- toplogyTemplates: string;
-} \ No newline at end of file
diff --git a/cds-ui/client/src/app/common/store/models/blueprintState.model.ts b/cds-ui/client/src/app/common/store/models/blueprintState.model.ts
deleted file mode 100644
index 556b33d19..000000000
--- a/cds-ui/client/src/app/common/store/models/blueprintState.model.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-============LICENSE_START==========================================
-===================================================================
-Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
-===================================================================
-
-Unless otherwise specified, all software contained herein is licensed
-under the Apache License, Version 2.0 (the License);
-you may not use this software except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-============LICENSE_END============================================
-*/
-
-import { IMetaData } from './metadata.model';
-import { IImportModel } from './imports.model';
-import { IBlueprint } from './blueprint.model';
-
-
-export interface IBlueprintState {
- blueprint: IBlueprint,
- isLoadSuccess: boolean;
- isUpdateSuccess: boolean;
- isSaveSuccess: boolean;
-} \ No newline at end of file
diff --git a/cds-ui/client/src/app/common/store/models/imports.model.ts b/cds-ui/client/src/app/common/store/models/imports.model.ts
deleted file mode 100644
index 9510ed3cf..000000000
--- a/cds-ui/client/src/app/common/store/models/imports.model.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-============LICENSE_START==========================================
-===================================================================
-Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
-===================================================================
-
-Unless otherwise specified, all software contained herein is licensed
-under the Apache License, Version 2.0 (the License);
-you may not use this software except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-============LICENSE_END============================================
-*/
-
-export interface IImportModel {
- file: string;
-} \ No newline at end of file
diff --git a/cds-ui/client/src/app/common/store/models/metadata.model.ts b/cds-ui/client/src/app/common/store/models/metadata.model.ts
deleted file mode 100644
index 6ee427504..000000000
--- a/cds-ui/client/src/app/common/store/models/metadata.model.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-============LICENSE_START==========================================
-===================================================================
-Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
-===================================================================
-
-Unless otherwise specified, all software contained herein is licensed
-under the Apache License, Version 2.0 (the License);
-you may not use this software except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-============LICENSE_END============================================
-*/
-export interface IMetaData {
- template_author: string;
- author_email: String;
- user_groups: string;
- template_name: string;
- template_version: string;
- template_tags: string;
-} \ No newline at end of file
diff --git a/cds-ui/client/src/app/common/store/reducers/app.reducer.ts b/cds-ui/client/src/app/common/store/reducers/app.reducer.ts
deleted file mode 100644
index 003886068..000000000
--- a/cds-ui/client/src/app/common/store/reducers/app.reducer.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-============LICENSE_START==========================================
-===================================================================
-Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
-===================================================================
-
-Unless otherwise specified, all software contained herein is licensed
-under the Apache License, Version 2.0 (the License);
-you may not use this software except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-============LICENSE_END============================================
-*/
-
-import { ActionReducerMap } from '@ngrx/store';
-import { routerReducer } from '@ngrx/router-store';
-
-import { IAppState } from '../state/app.state';
-import { blueprintReducer } from '../reducers/blueprint.reducer';
-
-export const appReducers: ActionReducerMap<IAppState, any> = {
- router: routerReducer,
- blueprint: blueprintReducer
-}; \ No newline at end of file
diff --git a/cds-ui/client/src/app/common/store/reducers/blueprint.reducer.ts b/cds-ui/client/src/app/common/store/reducers/blueprint.reducer.ts
deleted file mode 100644
index edcf1c38a..000000000
--- a/cds-ui/client/src/app/common/store/reducers/blueprint.reducer.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-============LICENSE_START==========================================
-===================================================================
-Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
-===================================================================
-
-Unless otherwise specified, all software contained herein is licensed
-under the Apache License, Version 2.0 (the License);
-you may not use this software except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-============LICENSE_END============================================
-*/
-
-import { Action } from '@ngrx/store';
-import { IBlueprint } from '../models/blueprint.model';
-import { IBlueprintState } from '../models/blueprintState.model';
-import { initialBlueprintState } from '../state/blueprint.state';
-import * as BlueprintActions from '../actions/blueprint.action';
-
-// const initialState: BlueprintState = {
-// blueprint: {
-// metadata: {
-// template_author: '',
-// author_email: '',
-// user_groups: '',
-// template_name: '',
-// template_version: '',
-// template_tags: ''
-// },
-// fileImports: [{file:''}],
-// toplogyTemplates: 'temp'
-// },
-// isLoadSuccess: false,
-// isUpdateSuccess: false,
-// isSaveSuccess: false
-// }
-
-
-export function blueprintReducer(state: IBlueprintState = initialBlueprintState, action: BlueprintActions.Actions) : IBlueprintState {
- switch(action.type) {
- case BlueprintActions.LOAD_BLUEPRINT_SUCCESS:
- return {...state,
- blueprint: action.payload
- }
- default:
- return state;
- }
-}
diff --git a/cds-ui/client/src/app/common/store/selectors/blueprint.selectors.ts b/cds-ui/client/src/app/common/store/selectors/blueprint.selectors.ts
deleted file mode 100644
index d23221cce..000000000
--- a/cds-ui/client/src/app/common/store/selectors/blueprint.selectors.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-============LICENSE_START==========================================
-===================================================================
-Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
-===================================================================
-
-Unless otherwise specified, all software contained herein is licensed
-under the Apache License, Version 2.0 (the License);
-you may not use this software except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-============LICENSE_END============================================
-*/
-import { createSelector } from '@ngrx/store';
-
-import { IAppState } from '../state/app.state';
-import { IBlueprintState } from '../models/blueprintState.model';
-
-const selectBlueprintFromAppState = (state: IAppState) => state.blueprint;
-
-export const selectBlueprint = createSelector(
- selectBlueprintFromAppState,
- (state: IBlueprintState) => state.blueprint
-); \ No newline at end of file
diff --git a/cds-ui/client/src/app/common/store/state/app.state.ts b/cds-ui/client/src/app/common/store/state/app.state.ts
deleted file mode 100644
index 66e19c9be..000000000
--- a/cds-ui/client/src/app/common/store/state/app.state.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-============LICENSE_START==========================================
-===================================================================
-Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
-===================================================================
-
-Unless otherwise specified, all software contained herein is licensed
-under the Apache License, Version 2.0 (the License);
-you may not use this software except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-============LICENSE_END============================================
-*/
-
-import { RouterReducerState } from '@ngrx/router-store';
-import { IBlueprintState } from '../models/blueprintState.model';
-import { initialBlueprintState } from './blueprint.state';
-
-export interface IAppState {
- router? : RouterReducerState,
- blueprint: IBlueprintState
-}
-
-export const initialAppState: IAppState = {
- blueprint: initialBlueprintState
-} \ No newline at end of file
diff --git a/cds-ui/client/src/app/common/store/state/blueprint.state.ts b/cds-ui/client/src/app/common/store/state/blueprint.state.ts
deleted file mode 100644
index 913072665..000000000
--- a/cds-ui/client/src/app/common/store/state/blueprint.state.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-============LICENSE_START==========================================
-===================================================================
-Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
-===================================================================
-
-Unless otherwise specified, all software contained herein is licensed
-under the Apache License, Version 2.0 (the License);
-you may not use this software except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-============LICENSE_END============================================
-*/
-
-import { IBlueprintState } from '../models/blueprintState.model';
-import { IBlueprint } from '../models/blueprint.model';
-
-
-export const initialBlueprintState : IBlueprintState = {
- blueprint : {} as IBlueprint,
- isLoadSuccess: false,
- isUpdateSuccess: false,
- isSaveSuccess: false,
-} \ No newline at end of file