summaryrefslogtreecommitdiffstats
path: root/catalog-ui
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui')
-rw-r--r--catalog-ui/src/app/models/properties-inputs/property-be-model.ts6
-rw-r--r--catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.html13
-rw-r--r--catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.ts42
-rw-r--r--catalog-ui/src/app/utils/constants.ts3
4 files changed, 59 insertions, 5 deletions
diff --git a/catalog-ui/src/app/models/properties-inputs/property-be-model.ts b/catalog-ui/src/app/models/properties-inputs/property-be-model.ts
index b8cccdd213..b4c1c2fce7 100644
--- a/catalog-ui/src/app/models/properties-inputs/property-be-model.ts
+++ b/catalog-ui/src/app/models/properties-inputs/property-be-model.ts
@@ -33,7 +33,8 @@ export enum DerivedPropertyType {
SIMPLE,
LIST,
MAP,
- COMPLEX
+ COMPLEX,
+ RANGE
}
export class PropertyPolicyDetail {
policyId: string;
@@ -140,6 +141,9 @@ export class PropertyBEModel {
if (this.type === PROPERTY_TYPES.LIST) {
return DerivedPropertyType.LIST;
}
+ if (this.type === PROPERTY_TYPES.RANGE) {
+ return DerivedPropertyType.RANGE;
+ }
if (this.type === PROPERTY_TYPES.MAP) {
return DerivedPropertyType.MAP;
}
diff --git a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.html b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.html
index fce8e7ea4f..1e0804eb04 100644
--- a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.html
+++ b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.html
@@ -76,6 +76,19 @@
</li>
</ul>
</ng-container>
+ <ng-container *ngIf="isTypeRange(type.name)">
+ <ul *ngIf="isExpanded">
+ <ng-container *ngFor="let value1 of [0, 1]; index as i">
+ <li class="input-value">
+ <ng-container *ngIf="isViewOnly">
+ {{valueObjRef[i]}}
+ </ng-container>
+ <input type="text" *ngIf="!isViewOnly"
+ [(ngModel)]="valueObjRef[i]" (ngModelChange)="onListValueChange()" />
+ </li>
+ </ng-container>
+ </ul>
+ </ng-container>
<ng-container *ngIf="isTypeComplex(type.name)" >
<ul *ngIf="isExpanded">
<ng-container *ngFor="let property of this.type.properties">
diff --git a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.ts b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.ts
index 4612ca6d60..88ff8deec6 100644
--- a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.ts
+++ b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.ts
@@ -85,7 +85,7 @@ export class InputListItemComponent implements OnInit {
if (this.valueObjRef[property.name] == undefined) {
if (this.isTypeComplex(property.type) || this.isTypeMap(property.type)) {
this.valueObjRef[property.name] = {};
- } else if (this.isTypeList(property.type)) {
+ } else if (this.isTypeList(property.type) || this.isTypeRange(property.type)) {
this.valueObjRef[property.name] = [];
} else {
this.valueObjRef[property.name] = null;
@@ -100,13 +100,49 @@ export class InputListItemComponent implements OnInit {
return DerivedPropertyType.LIST;
} else if (typeName === PROPERTY_TYPES.MAP) {
return DerivedPropertyType.MAP;
+ } else if (typeName === PROPERTY_TYPES.RANGE) {
+ return DerivedPropertyType.RANGE;
} else {
return DerivedPropertyType.COMPLEX;
}
}
+ isTypeWithoutProperties(typeName: string): boolean {
+ if (this.dataTypeMap.get(typeName) === undefined) {
+ return true;
+ }
+ return this.dataTypeMap.get(typeName).properties === undefined ||
+ this.dataTypeMap.get(typeName).properties.length == 0;
+ }
+
+ isTypeDerivedFromSimple(typeName: string): boolean {
+ if (typeName === undefined) {
+ return false;
+ }
+ if (this.dataTypeMap.get(typeName) !== undefined) {
+ if (this.isTypeRange(typeName)) {
+ return false;
+ }
+ if (this.dataTypeMap.get(typeName).derivedFromName == PROPERTY_DATA.ROOT_DATA_TYPE) {
+ return false;
+ } else if (PROPERTY_DATA.SIMPLE_TYPES.indexOf(this.dataTypeMap.get(typeName).derivedFromName) > -1) {
+ return true;
+ } else {
+ return this.isTypeDerivedFromSimple(this.dataTypeMap.get(typeName).derivedFromName);
+ }
+ }
+ return true;
+ }
+
isTypeSimple(typeName: string): boolean {
- return this.getType(typeName) == DerivedPropertyType.SIMPLE;
+ if (this.getType(typeName) == DerivedPropertyType.SIMPLE) {
+ return true;
+ }
+ return this.isTypeDerivedFromSimple(typeName) && (this.isTypeWithoutProperties(typeName));
+ }
+
+ isTypeRange(typeName: string): boolean {
+ return this.getType(typeName) == DerivedPropertyType.RANGE;
}
isTypeList(typeName: string): boolean {
@@ -118,7 +154,7 @@ export class InputListItemComponent implements OnInit {
}
isTypeComplex(typeName: string): boolean {
- return !this.isTypeSimple(typeName) && !this.isTypeList(typeName) && !this.isTypeMap(typeName);
+ return !this.isTypeSimple(typeName) && !this.isTypeList(typeName) && !this.isTypeMap(typeName) && !this.isTypeRange(typeName);
}
expandAndCollapse() {
diff --git a/catalog-ui/src/app/utils/constants.ts b/catalog-ui/src/app/utils/constants.ts
index 0de83d257e..9d11f54db9 100644
--- a/catalog-ui/src/app/utils/constants.ts
+++ b/catalog-ui/src/app/utils/constants.ts
@@ -137,6 +137,7 @@ export class PROPERTY_TYPES {
public static FLOAT = 'float';
public static BOOLEAN = 'boolean';
public static JSON = 'json';
+ public static RANGE = 'range';
public static MAP = 'map';
public static LIST = 'list';
public static SCALAR = 'scalar-unit';
@@ -152,7 +153,7 @@ export class SOURCES {
}
export class PROPERTY_DATA {
- public static TYPES = [PROPERTY_TYPES.STRING, PROPERTY_TYPES.INTEGER, PROPERTY_TYPES.TIMESTAMP, PROPERTY_TYPES.FLOAT, PROPERTY_TYPES.BOOLEAN, PROPERTY_TYPES.JSON, PROPERTY_TYPES.SCALAR, PROPERTY_TYPES.SCALAR_FREQUENCY, PROPERTY_TYPES.SCALAR_SIZE, PROPERTY_TYPES.SCALAR_TIME, PROPERTY_TYPES.LIST, PROPERTY_TYPES.MAP];
+ public static TYPES = [PROPERTY_TYPES.STRING, PROPERTY_TYPES.INTEGER, PROPERTY_TYPES.TIMESTAMP, PROPERTY_TYPES.FLOAT, PROPERTY_TYPES.BOOLEAN, PROPERTY_TYPES.JSON, PROPERTY_TYPES.SCALAR, PROPERTY_TYPES.SCALAR_FREQUENCY, PROPERTY_TYPES.SCALAR_SIZE, PROPERTY_TYPES.SCALAR_TIME, PROPERTY_TYPES.LIST, PROPERTY_TYPES.MAP, PROPERTY_TYPES.RANGE];
public static SIMPLE_TYPES = [PROPERTY_TYPES.STRING, PROPERTY_TYPES.INTEGER, PROPERTY_TYPES.TIMESTAMP, PROPERTY_TYPES.FLOAT, PROPERTY_TYPES.BOOLEAN, PROPERTY_TYPES.JSON, PROPERTY_TYPES.SCALAR, PROPERTY_TYPES.SCALAR_FREQUENCY, PROPERTY_TYPES.SCALAR_SIZE, PROPERTY_TYPES.SCALAR_TIME];
public static SIMPLE_TYPES_COMPARABLE = [PROPERTY_TYPES.STRING, PROPERTY_TYPES.INTEGER, PROPERTY_TYPES.FLOAT];
public static SCALAR_TYPES = [PROPERTY_TYPES.SCALAR, PROPERTY_TYPES.SCALAR_FREQUENCY, PROPERTY_TYPES.SCALAR_SIZE, PROPERTY_TYPES.SCALAR_TIME];