diff options
author | 2021-01-13 19:50:20 +0200 | |
---|---|---|
committer | 2021-01-13 19:50:20 +0200 | |
commit | 50b86c6a59e2a65c4a2ff5c97997bba21da6a98b (patch) | |
tree | 05ad055a9cef26ae37c8fb648ed1217c08004511 /cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.ts | |
parent | bb91b6eedec5d15ec4d9e473f27dd63592762cf9 (diff) |
enable 2-way binding between metadata and editor tabs
Issue-ID: CCSDK-3083
Signed-off-by: Ahmedeldeeb50 <ahmed.eldeeb.ext@orange.com>
Change-Id: I9073e6c9a50e5d2ba34ab60666135cead718e059
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/resource-dictionary/resource-dictionary-creation/dictionary-metadata/dictionary-metadata.component.ts | 33 |
1 files changed, 22 insertions, 11 deletions
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); } } |