diff options
author | 2019-07-23 20:02:04 +0000 | |
---|---|---|
committer | 2019-07-23 20:02:04 +0000 | |
commit | b795b562ecbe6ccfb2ba984d107745246dae0d6e (patch) | |
tree | aaa30d88d8d6537de39bce70f93a276807af968c /cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts | |
parent | a28341c5c7ef20fc942fcdf7baaddcf2bb30bcc3 (diff) | |
parent | 66b9cbf682b8adfe7f763a90a3bff7e2aa791d70 (diff) |
Merge "Resource dictionary- displaying exsisting sources"
Diffstat (limited to 'cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts')
-rw-r--r-- | cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts | 30 |
1 files changed, 26 insertions, 4 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 c4ad83d67..42f990a24 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 @@ -20,7 +20,7 @@ * ============LICENSE_END========================================================= */ -import { Component, OnInit, ViewChild, EventEmitter, Output } from '@angular/core'; +import { Component, OnInit, ViewChild, EventEmitter, Output, Input } from '@angular/core'; import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop'; import { IResources } from 'src/app/common/core/store/models/resources.model'; import { IResourcesState } from 'src/app/common/core/store/models/resourcesState.model'; @@ -62,9 +62,17 @@ export class SourcesTemplateComponent implements OnInit { resourcesdata => { var resourcesState: IResourcesState = { resources: resourcesdata.resources, isLoadSuccess: resourcesdata.isLoadSuccess, isSaveSuccess: resourcesdata.isSaveSuccess, isUpdateSuccess: resourcesdata.isUpdateSuccess }; this.resources=resourcesState.resources; - this.sources = resourcesState.resources.sources; + // this.sources = resourcesState.resources.sources; + if(resourcesState.resources.definition && resourcesState.resources.definition.sources) { + this.sources = resourcesState.resources.definition.sources; + } for (let key in this.sources) { - this.sourcesOptions.push(key); + // this.sourcesOptions.push(key); + let source = { + name : key, + data: this.sources[key] + } + this.sourcesOptions.push(source); } }) } @@ -136,5 +144,19 @@ export class SourcesTemplateComponent implements OnInit { event.previousIndex, event.currentIndex); } - } + } + + getResources() { + this.apiService.getSources() + .subscribe(data=>{ + console.log(data); + for (let key in data[0]) { + let sourceObj = { name: key, value: data[0][key] } + this.option.push(sourceObj); + } + // this.sourcesOptions = data; + }, error=>{ + console.log(error); + }) + } } |