From f052a06d5d0520f883babbbb91550ce7e790a478 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Wed, 31 Jul 2019 22:35:17 +0530 Subject: Source template component- store update Implemented code to store sourc list changes to store Issue-ID: CCSDK-707 Change-Id: If1ff2cd4cf624473a8962bf921225c00ff161ef5 Signed-off-by: Arundathi Patil --- .../sources-template/sources-template.component.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts index 3e8f4f8d6..1d41ae7c7 100644 --- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts +++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts @@ -28,7 +28,7 @@ import { Observable } from 'rxjs'; import { Store } from '@ngrx/store'; import { IAppState } from '../../../../common/core/store/state/app.state'; import { A11yModule } from '@angular/cdk/a11y'; -import { LoadResourcesSuccess } from 'src/app/common/core/store/actions/resources.action'; +import { SetResourcesState } from 'src/app/common/core/store/actions/resources.action'; import { ISourcesData } from 'src/app/common/core/store/models/sourcesData.model'; import { JsonEditorComponent, JsonEditorOptions } from 'ang-jsoneditor'; import { ResourceEditService } from '../resource-edit.service'; @@ -171,6 +171,20 @@ export class SourcesTemplateComponent implements OnInit { } } }); + let newsources= {}; + this.sourcesOptions.forEach(sourceItem=>{ + console + newsources[sourceItem.name] = {}; + newsources[sourceItem.name] = sourceItem.data; + }); + this.resources.definition.sources = newsources; + let resourcesState = { + resources: this.resources, + isLoadSuccess: true, + isUpdateSuccess:true, + isSaveSuccess:true + } + this.store.dispatch(new SetResourcesState(resourcesState)); }); } }); -- cgit 1.2.3-korg