2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2020 TechMahindra
6 *=================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 import { Component, OnInit } from '@angular/core';
21 import { ActivatedRoute } from '@angular/router';
22 import { DictionaryModel } from '../../model/dictionary.model';
23 import { DictionaryCreationService } from '../dictionary-creation.service';
24 import { DictionaryCreationStore } from '../dictionary-creation.store';
25 import { MetaData } from '../../model/metaData.model';
28 selector: 'app-dictionary-metadata',
29 templateUrl: './dictionary-metadata.component.html',
30 styleUrls: ['./dictionary-metadata.component.css']
32 export class DictionaryMetadataComponent implements OnInit {
33 packageNameAndVersionEnables = true;
35 tags = new Set<string>();
36 metaDataTab: MetaData = new MetaData();
40 private route: ActivatedRoute,
41 private dictionaryCreationService: DictionaryCreationService,
42 private dictionaryCreationStore: DictionaryCreationStore
46 this.dictionaryCreationStore.state$.subscribe(element => {
47 if (element && element.metaData) {
48 this.metaDataTab.name = element.metaData.name;
49 this.metaDataTab.description = element.metaData.description;
50 this.metaDataTab.dataType = element.metaData.dataType;
51 this.metaDataTab.tags = element.metaData.tags;
52 this.metaDataTab.entrySchema = element.metaData.entrySchema;
53 this.metaDataTab.required = element.metaData.required;
54 this.metaDataTab.libraryInstance = element.metaData.libraryInstance;
55 this.metaDataTab.derivedFrom = element.metaData.derivedFrom;
59 console.log(this.metaDataTab.name);
63 this.tags.delete(value);
67 const value = event.target.value;
69 if (value && value.trim().length > 0) {
70 event.target.value = '';
75 saveMetaDataToStore() {
76 console.log(this.metaDataTab);
77 // this.dictionaryCreationStore.changeMetaData(this.metaDataTab);