summaryrefslogtreecommitdiffstats
path: root/cds-ui/client/src/app/common
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-03-06 20:39:32 +0000
committerGerrit Code Review <gerrit@onap.org>2019-03-06 20:39:32 +0000
commitd44dc903a8a307a49b9003a1564e61dfe8d071d7 (patch)
treeda97baa922b962ceab1901f3a3c9910fc36726de /cds-ui/client/src/app/common
parent4bf30f6b017d5afbd3205c09049f54d900886a37 (diff)
parent1a0f16a5b28b4602d71a51f583da9da55d514e77 (diff)
Merge "Ngrx store changes"
Diffstat (limited to 'cds-ui/client/src/app/common')
-rw-r--r--cds-ui/client/src/app/common/core/store/actions/blueprint.action.ts10
-rw-r--r--cds-ui/client/src/app/common/core/store/models/blueprintState.model.ts9
-rw-r--r--cds-ui/client/src/app/common/core/store/reducers/blueprint.reducer.ts6
-rw-r--r--cds-ui/client/src/app/common/core/store/state/blueprint.state.ts2
4 files changed, 22 insertions, 5 deletions
diff --git a/cds-ui/client/src/app/common/core/store/actions/blueprint.action.ts b/cds-ui/client/src/app/common/core/store/actions/blueprint.action.ts
index 6a0ab8065..8dc5067e7 100644
--- a/cds-ui/client/src/app/common/core/store/actions/blueprint.action.ts
+++ b/cds-ui/client/src/app/common/core/store/actions/blueprint.action.ts
@@ -18,6 +18,7 @@ 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';
@@ -36,6 +37,8 @@ export const SAVE_BLUEPRINT_FAILURE = 'SAVE_BLUEPRINT_FAILURE';
export const SET_BLUEPRINT = 'SET Blueprint';
export const REMOVE_BLUEPRINT = 'Remove Blueprint';
+export const SET_BLUEPRINT_STATE = 'SET Blueprint state';
+
export class LoadBlueprint implements Action {
readonly type = LOAD_BLUEPRINT;
@@ -52,6 +55,11 @@ export class LoadBlueprintFailure implements Action {
constructor(public error: any) {}
}
+export class SetBlueprintState implements Action {
+ readonly type = SET_BLUEPRINT_STATE;
+ constructor(public payload: IBlueprintState) {}
+}
+
// export class SetBlueprint implements Action {
// readonly type = SET_BLUEPRINT;
// constructor(public payload: Blueprint) {}
@@ -67,4 +75,4 @@ export class UpdateBlueprint implements Action {
constructor(public payload: IBlueprint) {}
}
-export type Actions = LoadBlueprint | LoadBlueprintSuccess | LoadBlueprintFailure; \ No newline at end of file
+export type Actions = LoadBlueprint | LoadBlueprintSuccess | LoadBlueprintFailure | SetBlueprintState; \ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/models/blueprintState.model.ts b/cds-ui/client/src/app/common/core/store/models/blueprintState.model.ts
index 556b33d19..5981f0136 100644
--- a/cds-ui/client/src/app/common/core/store/models/blueprintState.model.ts
+++ b/cds-ui/client/src/app/common/core/store/models/blueprintState.model.ts
@@ -18,7 +18,6 @@ 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';
@@ -26,7 +25,9 @@ import { IBlueprint } from './blueprint.model';
export interface IBlueprintState {
blueprint: IBlueprint,
- isLoadSuccess: boolean;
- isUpdateSuccess: boolean;
- isSaveSuccess: boolean;
+ files?: any;
+ filesData?: any;
+ isLoadSuccess?: boolean;
+ isUpdateSuccess?: boolean;
+ isSaveSuccess?: boolean;
} \ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/reducers/blueprint.reducer.ts b/cds-ui/client/src/app/common/core/store/reducers/blueprint.reducer.ts
index edcf1c38a..b6c23ecf8 100644
--- a/cds-ui/client/src/app/common/core/store/reducers/blueprint.reducer.ts
+++ b/cds-ui/client/src/app/common/core/store/reducers/blueprint.reducer.ts
@@ -50,6 +50,12 @@ export function blueprintReducer(state: IBlueprintState = initialBlueprintState,
return {...state,
blueprint: action.payload
}
+ case BlueprintActions.SET_BLUEPRINT_STATE :
+ return {...state,
+ blueprint: action.payload.blueprint,
+ files: action.payload.files,
+ filesData: action.payload.filesData
+ }
default:
return state;
}
diff --git a/cds-ui/client/src/app/common/core/store/state/blueprint.state.ts b/cds-ui/client/src/app/common/core/store/state/blueprint.state.ts
index 913072665..1899cb26e 100644
--- a/cds-ui/client/src/app/common/core/store/state/blueprint.state.ts
+++ b/cds-ui/client/src/app/common/core/store/state/blueprint.state.ts
@@ -25,6 +25,8 @@ import { IBlueprint } from '../models/blueprint.model';
export const initialBlueprintState : IBlueprintState = {
blueprint : {} as IBlueprint,
+ files: [],
+ filesData: [],
isLoadSuccess: false,
isUpdateSuccess: false,
isSaveSuccess: false,