diff options
author | Arundathi Patil <arundpil@in.ibm.com> | 2019-07-31 22:35:17 +0530 |
---|---|---|
committer | Arundathi Patil <arundpil@in.ibm.com> | 2019-07-31 22:35:23 +0530 |
commit | f052a06d5d0520f883babbbb91550ce7e790a478 (patch) | |
tree | 4fa344f53a34bba0e4512d89cea2ae61dcdf1fb1 | |
parent | 79ba5452adad404504c4992442f4f6df9ff2e586 (diff) |
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 <arundpil@in.ibm.com>
-rw-r--r-- | cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts | 16 |
1 files changed, 15 insertions, 1 deletions
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)); }); } }); |