From 79ba5452adad404504c4992442f4f6df9ff2e586 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Tue, 30 Jul 2019 23:26:53 +0530 Subject: Resource-edit- store changes implemented code to save the changes made in resource edit component to the store Issue-ID: CCSDK-707 Change-Id: I5f6051cc34c246ee6c09b657ed764c2671914605 Signed-off-by: Arundathi Patil --- .../client/src/app/common/core/store/models/resourcesState.model.ts | 6 +++--- .../client/src/app/common/core/store/reducers/resources.reducer.ts | 4 ++++ .../resource-definition/resource-edit/resource-edit.component.ts | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'cds-ui/client/src/app') diff --git a/cds-ui/client/src/app/common/core/store/models/resourcesState.model.ts b/cds-ui/client/src/app/common/core/store/models/resourcesState.model.ts index 7dacf3242..df9c2878f 100644 --- a/cds-ui/client/src/app/common/core/store/models/resourcesState.model.ts +++ b/cds-ui/client/src/app/common/core/store/models/resourcesState.model.ts @@ -22,7 +22,7 @@ import { IResources } from './resources.model'; export interface IResourcesState { resources: IResources, - isLoadSuccess: boolean; - isUpdateSuccess: boolean; - isSaveSuccess: boolean; + isLoadSuccess?: boolean; + isUpdateSuccess?: boolean; + isSaveSuccess?: boolean; } \ No newline at end of file diff --git a/cds-ui/client/src/app/common/core/store/reducers/resources.reducer.ts b/cds-ui/client/src/app/common/core/store/reducers/resources.reducer.ts index c9d587d16..b6b11b935 100644 --- a/cds-ui/client/src/app/common/core/store/reducers/resources.reducer.ts +++ b/cds-ui/client/src/app/common/core/store/reducers/resources.reducer.ts @@ -29,6 +29,10 @@ export function resourcesReducer(state: IResourcesState = initialResourcesState, return {...state, resources: action.payload } + case ResourcesActions.SET_RESOURCES_STATE: + return {...state, + resources: action.payload.resources + } default: return state; } diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts index aa8a1064d..faf7fbd6c 100644 --- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts +++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts @@ -77,6 +77,7 @@ export class ResourceEditComponent implements OnInit { onChange($event) { this.data=JSON.parse($event.srcElement.value); + this.updateResourcesState(); }; updateResourcesState(){ -- cgit 1.2.3-korg