From 50b86c6a59e2a65c4a2ff5c97997bba21da6a98b Mon Sep 17 00:00:00 2001 From: Ahmedeldeeb50 Date: Wed, 13 Jan 2021 19:50:20 +0200 Subject: enable 2-way binding between metadata and editor tabs Issue-ID: CCSDK-3083 Signed-off-by: Ahmedeldeeb50 Change-Id: I9073e6c9a50e5d2ba34ab60666135cead718e059 --- .../dictionary-metadata.component.html | 24 ++++++++-------- .../dictionary-metadata.component.ts | 33 ++++++++++++++-------- 2 files changed, 34 insertions(+), 23 deletions(-) (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata') diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.html index bea6081c0..add21e9e1 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.html @@ -21,10 +21,9 @@
- +
- @@ -41,39 +40,40 @@
- +
- +
- +
- +
-
+ +
@@ -88,4 +88,4 @@ class="fa fa-times-circle">
-
+ \ No newline at end of file diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.ts index caeac83f1..631a0fffd 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.ts @@ -44,36 +44,47 @@ export class DictionaryMetadataComponent implements OnInit { ngOnInit() { this.dictionaryCreationStore.state$.subscribe(element => { + console.log(this.metaDataTab); if (element && element.metaData) { - this.metaDataTab.name = element.metaData.name; - this.metaDataTab.description = element.metaData.description; - this.metaDataTab.dataType = element.metaData.dataType; - this.metaDataTab.tags = element.metaData.tags; - this.metaDataTab.entrySchema = element.metaData.entrySchema; - this.metaDataTab.required = element.metaData.required; - this.metaDataTab.libraryInstance = element.metaData.libraryInstance; - this.metaDataTab.derivedFrom = element.metaData.derivedFrom; - console.log(element); + this.metaDataTab = element.metaData; + this.metaDataTab.property.entry_schema = element.metaData.property.entry_schema; + this.tags = new Set(element.metaData.tags.split(',')); + this.tags.delete(''); + this.tags.delete(' '); + + // console.log(element); + // console.log(element.metaData.property['entry_schema']); } }); - console.log(this.metaDataTab.name); + } + // getSources() { + // this.dictionaryCreationService.getSources().subscribe(res => { + // console.log(res); + // }); + // } + removeTag(value) { this.tags.delete(value); } + addTag(event) { const value = event.target.value; console.log(value); if (value && value.trim().length > 0) { + let tag = ''; event.target.value = ''; this.tags.add(value); + this.tags.forEach(val => { + tag += val + ', '; + }); } } saveMetaDataToStore() { console.log(this.metaDataTab); - // this.dictionaryCreationStore.changeMetaData(this.metaDataTab); + this.dictionaryCreationStore.changeMetaData(this.metaDataTab); } } -- cgit 1.2.3-korg