diff options
author | aribeiro <anderson.ribeiro@est.tech> | 2021-07-15 09:18:37 +0100 |
---|---|---|
committer | aribeiro <anderson.ribeiro@est.tech> | 2021-08-06 17:22:20 +0100 |
commit | 47bcc63a9daff1f310125fed006f27c93656fa83 (patch) | |
tree | 3c61670b039c0e63d14880f909e6047d54776492 /catalog-ui/src/app/ng2/pages/attributes-outputs | |
parent | 0ed125f98ae8ea9e80c855a640c328654660d081 (diff) |
Retrieve data types based on component model
Issue-ID: SDC-3660
Signed-off-by: aribeiro <anderson.ribeiro@est.tech>
Change-Id: I09c533eb39277532b29e581e4dd57e9df952e8e6
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/attributes-outputs')
-rw-r--r-- | catalog-ui/src/app/ng2/pages/attributes-outputs/attribute-creator/attribute-creator.component.ts | 5 |
1 files changed, 3 insertions, 2 deletions
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; }); |