Ngrx store changes 97/79697/3
authorArundathi Patil <arundpil@in.ibm.com>
Tue, 5 Mar 2019 10:40:24 +0000 (16:10 +0530)
committerArundathi Patil <arundpil@in.ibm.com>
Wed, 6 Mar 2019 11:00:59 +0000 (11:00 +0000)
Made model changes as file upload type is changed to .zip

Issue-ID: CCSDK-1112
Change-Id: Idf206ee05fba99b0a6bafcc3867f16025a8486f4
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
cds-ui/client/src/app/common/core/store/actions/blueprint.action.ts
cds-ui/client/src/app/common/core/store/models/blueprintState.model.ts
cds-ui/client/src/app/common/core/store/reducers/blueprint.reducer.ts
cds-ui/client/src/app/common/core/store/state/blueprint.state.ts

index 6a0ab80..8dc5067 100644 (file)
@@ -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
index 556b33d..5981f01 100644 (file)
@@ -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
index edcf1c3..b6c23ec 100644 (file)
@@ -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;
     }
index 9130726..1899cb2 100644 (file)
@@ -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,