summaryrefslogtreecommitdiffstats
path: root/cds-ui/client
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2019-07-28 01:10:25 +0530
committerArundathi Patil <arundpil@in.ibm.com>2019-07-28 01:10:48 +0530
commit24fbf5ae61fe17f1abb1301b57c9ef3475ccace8 (patch)
tree796f5f22c0d64154d0c284152a1706af561b97b7 /cds-ui/client
parent6703f9a400af5ccde1854156458af8466e454f44 (diff)
Source Options- Displaying properties
Refactored code to display the source properties and not the source model Issue-ID: CCSDK-707 Change-Id: I1f17b51581fcc7a601734e4d81074b36878caacf Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'cds-ui/client')
-rw-r--r--cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts27
1 files changed, 14 insertions, 13 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 3c76b8506..3e8f4f8d6 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
@@ -87,6 +87,7 @@ export class SourcesTemplateComponent implements OnInit {
this.resources.sources = Object.assign({},originalSources);
};
+ // to remove this method
selected(sourceValue){
this.sourcesData= [];//this.sources[value];
this.apiService.getModelType(sourceValue.value)
@@ -153,25 +154,25 @@ export class SourcesTemplateComponent implements OnInit {
if (typeof (dataitem) == "object") {
for (let key1 in dataitem) {
if (key1 == 'properties') {
- let newPropOnj = {}
+ let newPropObj = {};
+ newPropObj["name"] = event.item.element.nativeElement.innerText;
+ newPropObj['data'] = {};
+ let newSoruceObj = {};
for (let key2 in dataitem[key1]) {
- console.log(dataitem[key1][key2]);
- let varType = dataitem[key1][key2].type
- // let property : varType =
- newPropOnj[key2] = dataitem[key1][key2];
+ newSoruceObj[key2] = '';;
}
+ newPropObj['data']['properties'] = newSoruceObj;
+ this.sourcesOptions.forEach(sourcesOptionsitem => {
+ if (sourcesOptionsitem.name == item.name) {
+ sourcesOptionsitem.data = newPropObj['data'];
+ }
+ });
}
}
}
});
- this.sourcesData = data;
- this.sourcesOptions.forEach(sourcesOptionsitem => {
- if (sourcesOptionsitem.name == item.name) {
- sourcesOptionsitem.data = data;
- }
- })
- })
- }
+ });
+ }
});
}
}