From 47bcc63a9daff1f310125fed006f27c93656fa83 Mon Sep 17 00:00:00 2001 From: aribeiro Date: Thu, 15 Jul 2021 09:18:37 +0100 Subject: Retrieve data types based on component model Issue-ID: SDC-3660 Signed-off-by: aribeiro Change-Id: I09c533eb39277532b29e581e4dd57e9df952e8e6 --- .../attribute-creator/attribute-creator.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'catalog-ui/src/app/ng2/pages/attributes-outputs') diff --git a/catalog-ui/src/app/ng2/pages/attributes-outputs/attribute-creator/attribute-creator.component.ts b/catalog-ui/src/app/ng2/pages/attributes-outputs/attribute-creator/attribute-creator.component.ts index 5fc3d5b5ac..96ec935202 100644 --- a/catalog-ui/src/app/ng2/pages/attributes-outputs/attribute-creator/attribute-creator.component.ts +++ b/catalog-ui/src/app/ng2/pages/attributes-outputs/attribute-creator/attribute-creator.component.ts @@ -27,6 +27,7 @@ import * as _ from 'lodash'; import {PROPERTY_TYPES} from '../../../../utils'; import {AttributeBEModel} from "../../../../models/attributes-outputs/attribute-be-model"; import {Validation} from "../../../../view-models/workspace/tabs/general/general-view-model"; +import {WorkspaceService} from "../../workspace/workspace.service"; @Component({ selector: 'attribute-creator', @@ -43,7 +44,7 @@ export class AttributeCreatorComponent { dataTypes: DataTypesMap; isLoading: boolean; - constructor(protected dataTypeService: DataTypeService) { + constructor(protected dataTypeService: DataTypeService, protected workspaceService: WorkspaceService) { } ngOnInit() { @@ -51,7 +52,7 @@ export class AttributeCreatorComponent { this.attributeModel.type = ''; this.attributeModel.schema.property.type = ''; const types: string[] = PROPERTY_DATA.TYPES; // All types - simple type + map + list - this.dataTypes = this.dataTypeService.getAllDataTypes(); // Get all data types in service + this.dataTypes = this.dataTypeService.getDataTypeByModel(this.workspaceService.metadata.model); // Get all data types in service const nonPrimitiveTypes: string[] = _.filter(Object.keys(this.dataTypes), (type: string) => { return types.indexOf(type) === -1; }); -- cgit 1.2.3-korg