summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts')
-rw-r--r--catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts15
1 files changed, 12 insertions, 3 deletions
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts
index 57c9f97387..ba7533a977 100644
--- a/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts
+++ b/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts
@@ -41,6 +41,17 @@ export class PropertyCreatorComponent {
return [PROPERTY_TYPES.LIST, PROPERTY_TYPES.MAP].indexOf(this.propertyModel.type) > -1;
}
+ onTypeChange(): void {
+ this.propertyModel.schema.property.type='';
+ const typeList = this.typesProperties;
+ if(this.propertyModel.type === PROPERTY_TYPES.MAP){
+ this.typesSchemaProperties = typeList.filter(dropdownObject => (dropdownObject.label != 'list' && dropdownObject.label != 'map'));
+ }
+ if(this.propertyModel.type === PROPERTY_TYPES.LIST){
+ this.typesSchemaProperties = typeList.filter(dropdownObject => dropdownObject.label != 'list');
+ }
+ }
+
onSchemaTypeChange(): void {
if (this.propertyModel.type === PROPERTY_TYPES.MAP) {
this.propertyModel.value = JSON.stringify({'': null});
@@ -63,9 +74,7 @@ export class PropertyCreatorComponent {
this.typesProperties = _.map(PROPERTY_DATA.TYPES,
(type: string) => new DropdownValue(type, type)
);
- const typesSimpleProperties = _.map(PROPERTY_DATA.SIMPLE_TYPES,
- (type: string) => new DropdownValue(type, type)
- );
+ const typesSimpleProperties = this.typesProperties.filter(dropdownObject => dropdownObject.label != 'list');
const nonPrimitiveTypesValues = _.map(nonPrimitiveTypes,
(type: string) => new DropdownValue(type,
type.replace('org.openecomp.datatypes.heat.', ''))