<ui-element-dropdown [testId]="'property-type'"
class="cell link-selector"
[values]="typesProperties"
+ (change)="onTypeChange()"
[(value)]="propertyModel.type"></ui-element-dropdown>
</div>
<div class="i-sdc-form-item propertySchemaType" *ngIf="showSchema()">
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});
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.', ''))