summaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.ts
diff options
context:
space:
mode:
authorAhmedeldeeb50 <ahmed.eldeeb.ext@orange.com>2021-02-02 13:21:07 +0200
committerAhmedeldeeb50 <ahmed.eldeeb.ext@orange.com>2021-02-02 13:21:07 +0200
commitda4ef339979c8269997ca4d8ffa66856b4739c15 (patch)
tree36a7be614afea6032d25250aba26d637cb46421c /cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.ts
parentb62aabac76abe92f04e0991157292c276d3d9177 (diff)
add properties for dictionary sources
Issue-ID: CCSDK-3093 Signed-off-by: Ahmedeldeeb50 <ahmed.eldeeb.ext@orange.com> Change-Id: I5141ae40df5a81495f903f8e443953f695c3dd4b
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.ts')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.ts40
1 files changed, 32 insertions, 8 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.ts
index 25b81994a..5e67c5e4a 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/sources-template/sources-template.component.ts
@@ -134,6 +134,23 @@ export class SourcesTemplateComponent implements OnInit {
}
}
+ addProperties(item, text) {
+ console.log(text);
+ console.log(item);
+ if (text && text.trim()) {
+ // Get source Object
+ const sourceObj = this.sourcesOptions.get(item.key);
+ sourceObj[item.key]['properties'] = { ...JSON.parse(text) };
+
+ console.log(sourceObj);
+
+ this.sourcesOptions.set(item.key, sourceObj);
+ this.saveSorcesDataToStore();
+
+ console.log(this.sourcesOptions);
+ }
+ }
+
setToDeleteSources(event, item) {
console.log(event.target.checked);
if (event.target.checked) {
@@ -144,18 +161,25 @@ export class SourcesTemplateComponent implements OnInit {
}
+
+ identify(index, item) {
+ return item.key;
+ }
+
+
addSources() {
// this.tempSources
const originalSources = this.tempSources;
for (const key of originalSources.keys()) {
- /* tslint:disable:no-string-literal */
- this.sourcesOptions.set(key, {
- [key]: {
- type: originalSources.get(key).value,
- properties: {}
- }
- });
-
+ if (!this.sourcesOptions.has(key)) {
+ /* tslint:disable:no-string-literal */
+ this.sourcesOptions.set(key, {
+ [key]: {
+ type: originalSources.get(key).value,
+ properties: {}
+ }
+ });
+ }
}
console.log(this.sourcesOptions);