Resource-edit- store changes 02/92302/1
authorArundathi Patil <arundpil@in.ibm.com>
Tue, 30 Jul 2019 17:56:53 +0000 (23:26 +0530)
committerArundathi Patil <arundpil@in.ibm.com>
Tue, 30 Jul 2019 17:57:02 +0000 (23:27 +0530)
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 <arundpil@in.ibm.com>
cds-ui/client/src/app/common/core/store/models/resourcesState.model.ts
cds-ui/client/src/app/common/core/store/reducers/resources.reducer.ts
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts

index 7dacf32..df9c287 100644 (file)
@@ -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
index c9d587d..b6b11b9 100644 (file)
@@ -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;
     }
index aa8a106..faf7fbd 100644 (file)
@@ -77,6 +77,7 @@ export class ResourceEditComponent implements OnInit {
     
  onChange($event) {
       this.data=JSON.parse($event.srcElement.value);
+      this.updateResourcesState();
   };
   
  updateResourcesState(){