aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app')
-rw-r--r--catalog-ui/src/app/app.ts2
-rw-r--r--catalog-ui/src/app/directives/graphs-v2/common/style/component-instances-nodes-style.ts9
-rw-r--r--catalog-ui/src/app/directives/property-types/type-map/type-map-directive.html2
-rw-r--r--catalog-ui/src/app/directives/property-types/type-map/type-map-directive.ts4
-rw-r--r--catalog-ui/src/app/models.ts2
-rw-r--r--catalog-ui/src/app/models/properties-inputs/input-be-model.ts9
-rw-r--r--catalog-ui/src/app/models/properties-inputs/input-fe-model.ts39
-rw-r--r--catalog-ui/src/app/models/properties-inputs/property-be-model.ts22
-rw-r--r--catalog-ui/src/app/models/properties-inputs/property-declare-api-model.ts18
-rw-r--r--catalog-ui/src/app/models/properties-inputs/property-fe-model.ts9
-rw-r--r--catalog-ui/src/app/models/properties-inputs/property-input-detail.ts6
-rw-r--r--catalog-ui/src/app/ng2/components/hierarchy-navigtion/hierarchy-navigation.component.less1
-rw-r--r--catalog-ui/src/app/ng2/components/inputs-table/inputs-table.component.html10
-rw-r--r--catalog-ui/src/app/ng2/components/inputs-table/inputs-table.component.ts1
-rw-r--r--catalog-ui/src/app/ng2/components/properties-table/dynamic-property/dynamic-property.component.html2
-rw-r--r--catalog-ui/src/app/ng2/components/properties-table/properties-table.component.html12
-rw-r--r--catalog-ui/src/app/ng2/components/properties-table/properties-table.component.ts14
-rw-r--r--catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.html4
-rw-r--r--catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.less17
-rw-r--r--catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts37
-rw-r--r--catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts57
-rw-r--r--catalog-ui/src/app/ng2/services/http.interceptor.service.ts105
-rw-r--r--catalog-ui/src/app/ng2/services/properties.service.ts8
-rw-r--r--catalog-ui/src/app/utils/constants.ts10
-rw-r--r--catalog-ui/src/app/view-models/forms/property-forms/module-property-modal/module-property-model.ts2
-rw-r--r--catalog-ui/src/app/view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view-model.ts2
-rw-r--r--catalog-ui/src/app/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts-view.html2
27 files changed, 256 insertions, 150 deletions
diff --git a/catalog-ui/src/app/app.ts b/catalog-ui/src/app/app.ts
index 7f85bb9eb3..305327cb95 100644
--- a/catalog-ui/src/app/app.ts
+++ b/catalog-ui/src/app/app.ts
@@ -583,6 +583,8 @@ ng1appModule.value('ComponentNameValidationPattern', /^(?=.*[^. ])[\s\w\&_.:-]{1
ng1appModule.value('PropertyNameValidationPattern', /^[a-zA-Z0-9_:-]{1,50}$/);// DE210977
ng1appModule.value('TagValidationPattern', /^[\s\w_.-]{1,50}$/);
ng1appModule.value('VendorValidationPattern', /^[\x20-\x21\x23-\x29\x2B-\x2E\x30-\x39\x3B\x3D\x40-\x5B\x5D-\x7B\x7D-\xFF]{1,25}$/);
+ng1appModule.value('VendorNameValidationPattern', /^[\x20-\x21\x23-\x29\x2B-\x2E\x30-\x39\x3B\x3D\x40-\x5B\x5D-\x7B\x7D-\xFF]{1,60}$/);
+ng1appModule.value('VendorModelNumberValidationPattern', /^[\x20-\x21\x23-\x29\x2B-\x2E\x30-\x39\x3B\x3D\x40-\x5B\x5D-\x7B\x7D-\xFF]{1,65}$/);
ng1appModule.value('ContactIdValidationPattern', /^[\s\w-]{1,50}$/);
ng1appModule.value('UserIdValidationPattern', /^[\s\w-]{1,50}$/);
ng1appModule.value('ProjectCodeValidationPattern', /^[\s\w-]{5,50}$/);
diff --git a/catalog-ui/src/app/directives/graphs-v2/common/style/component-instances-nodes-style.ts b/catalog-ui/src/app/directives/graphs-v2/common/style/component-instances-nodes-style.ts
index 971dabafe8..87acab6585 100644
--- a/catalog-ui/src/app/directives/graphs-v2/common/style/component-instances-nodes-style.ts
+++ b/catalog-ui/src/app/directives/graphs-v2/common/style/component-instances-nodes-style.ts
@@ -1,4 +1,7 @@
import {GraphColors} from "app/utils/constants";
+import constant = require("lodash/constant");
+import {ImagesUrl} from "app/utils/constants";
+import {AngularJSBridge} from "app/services/angular-js-bridge-service";
/**
* Created by obarda on 12/18/2016.
*/
@@ -215,7 +218,7 @@ export class ComponentInstanceNodesStyle {
type: "default",
single: false,
nodeTypeNames: ["basic-node"],
- imageUrl: '/assets/styles/images/resource-icons/' + 'canvasPlusIcon.png',
+ imageUrl: AngularJSBridge.getAngularConfig().imagesPath + ImagesUrl.CANVAS_PLUS_ICON,
lineWidth: 2,
lineStyle: 'dashed'
@@ -232,7 +235,7 @@ export class ComponentInstanceNodesStyle {
type: "default",
single: false,
nodeTypeNames: ["basic-small-node"],
- imageUrl: '/assets/styles/images/resource-icons/' + 'canvasPlusIcon.png',
+ imageUrl: AngularJSBridge.getAngularConfig().imagesPath + ImagesUrl.CANVAS_PLUS_ICON,
lineWidth: 2,
lineStyle: 'dashed'
}
@@ -248,7 +251,7 @@ export class ComponentInstanceNodesStyle {
type: "default",
single: false,
nodeTypeNames: ["ucpe-cp-node"],
- imageUrl: '/assets/styles/images/resource-icons/' + 'canvasPlusIcon.png',
+ imageUrl: AngularJSBridge.getAngularConfig().imagesPath + ImagesUrl.CANVAS_PLUS_ICON,
lineWidth: 2,
lineStyle: 'dashed'
}
diff --git a/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.html b/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.html
index 37b076f26e..3a4720676c 100644
--- a/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.html
+++ b/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.html
@@ -67,7 +67,7 @@
</div>
<div class="add-map-item" data-ng-class="{'schema-data-type':isSchemaTypeDataType}">
<div class="add-btn" data-tests-id="add-map-item"
- data-ng-class="{'disabled': readOnly || !schemaProperty.type || mapKeys.indexOf('')>-1}" data-ng-click="addMapItemFields()">Add</div>
+ data-ng-class="{'disabled': readOnly || !schemaProperty.type || mapKeys.indexOf('')>-1 || !isMapKeysUnique}" data-ng-click="addMapItemFields()">Add</div>
</div>
</div>
diff --git a/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.ts b/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.ts
index fa71e47804..03690b64f3 100644
--- a/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.ts
+++ b/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.ts
@@ -9,6 +9,7 @@ import {SchemaProperty} from "app/models";
export interface ITypeMapScope extends ng.IScope {
parentFormObj:ng.IFormController;
schemaProperty:SchemaProperty;
+ isMapKeysUnique:boolean;
isSchemaTypeDataType:boolean;
valueObjRef:any;
mapKeys:Array<string>;//array of map keys
@@ -54,6 +55,7 @@ export class TypeMapDirective implements ng.IDirective {
link = (scope:ITypeMapScope, element:any, $attr:any) => {
scope.MapKeyValidationPattern = this.MapKeyValidationPattern;
+ scope.isMapKeysUnique = true;
//reset valueObjRef and mapKeys when schema type is changed
scope.$watchCollection('schemaProperty.type', (newData:any):void => {
@@ -93,8 +95,10 @@ export class TypeMapDirective implements ng.IDirective {
let existsKeyIndex = Object.keys(scope.valueObjRef).indexOf(newKey);
if (existsKeyIndex > -1 && existsKeyIndex != index) {
scope.parentFormObj[fieldName].$setValidity('keyExist', false);
+ scope.isMapKeysUnique = false;
} else {
scope.parentFormObj[fieldName].$setValidity('keyExist', true);
+ scope.isMapKeysUnique = true;
if (!scope.parentFormObj[fieldName].$invalid) {
//To preserve the order of the keys, delete each one and recreate
let newObj = {};
diff --git a/catalog-ui/src/app/models.ts b/catalog-ui/src/app/models.ts
index 838137ba72..a37df5072a 100644
--- a/catalog-ui/src/app/models.ts
+++ b/catalog-ui/src/app/models.ts
@@ -28,6 +28,8 @@ export * from './models/properties-inputs/property-be-model';
export * from './models/properties-inputs/property-fe-model';
export * from './models/properties-inputs/property-fe-map';
export * from './models/properties-inputs/derived-fe-property';
+export * from './models/properties-inputs/property-declare-api-model';
+export * from './models/properties-inputs/property-input-detail';
export * from './models/properties-inputs/input-fe-model';
export * from './models/properties-inputs/simple-flat-property';
export * from './models/data-types-map';
diff --git a/catalog-ui/src/app/models/properties-inputs/input-be-model.ts b/catalog-ui/src/app/models/properties-inputs/input-be-model.ts
index 6767bce729..72afd77038 100644
--- a/catalog-ui/src/app/models/properties-inputs/input-be-model.ts
+++ b/catalog-ui/src/app/models/properties-inputs/input-be-model.ts
@@ -3,10 +3,13 @@ import {PropertyBEModel} from 'app/models';
* Created by rc2122 on 6/1/2017.
*/
export class InputBEModel extends PropertyBEModel {
- properties: Array<ComponentInstanceModel>;
+
+ inputPath: string;
inputs: Array<ComponentInstanceModel>;
instanceUniqueId: string;
+ ownerId: string;
propertyId: string;
+ properties: Array<ComponentInstanceModel>;
constructor(input?: InputBEModel) {
super(input);
@@ -14,10 +17,10 @@ export class InputBEModel extends PropertyBEModel {
this.propertyId = input.propertyId;
this.properties = input.properties;
this.inputs = input.inputs;
+ this.ownerId = input.ownerId;
+ this.inputPath = input.inputPath;
}
-
-
public toJSON = (): any => {
};
diff --git a/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts b/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts
index 3af4431b55..f79a7e6317 100644
--- a/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts
+++ b/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts
@@ -5,42 +5,19 @@ import {InputBEModel} from "./input-be-model";
export class InputFEModel extends InputBEModel {
isSimpleType: boolean;
- relatedProperty: SimpleRelatedProperty;
+ relatedPropertyValue: any;
+ relatedPropertyName: string;
constructor(input?: InputBEModel) {
super(input);
if (input) {
this.isSimpleType = PROPERTY_DATA.SIMPLE_TYPES.indexOf(this.type) > -1;
- this.relatedProperty = new SimpleRelatedProperty(input);
+ let relatedProperty = input.properties && input.properties[0] || input.inputs && input.inputs[0];
+ if (relatedProperty) {
+ this.relatedPropertyValue = relatedProperty.value;
+ this.relatedPropertyName = relatedProperty.name;
+ }
}
}
-}
-
-export class SimpleRelatedProperty {
- name: string;
- value: string;
- nestedPath: string;
-
- constructor(input: InputBEModel) {
- if(!input.instanceUniqueId){
- return;
- }
- //Check if input is on DerivedFEProperty level, in which case we want to set a nested path
- let instanceName = input.instanceUniqueId.split('.').pop();
- if (input.inputPath && input.inputPath.indexOf('#') > -1
- && instanceName + "_" + input.inputPath.split('#').join('_') == input.name) { //Ignore inputPath for a complex child on VL that was declared within VF, that was then dragged into service. For that case, input.name will be missing the vl name, so we'll know to ignore the path and fall into else case.
- this.nestedPath = input.inputPath;
- this.name = input.inputPath.substring(0, input.inputPath.indexOf('#'));
- } else { //PropertyFEModel level. Can parse input name to get prop name.
- let propNameLength = input.name.length - instanceName.length + 1;
- this.name = input.name.substr(instanceName.length + 1, propNameLength);
- }
-
- //In declare response, input contains nested property, and we need to extract value so we can update our prop.
- let nestedProperty = input.properties && input.properties[0] || input.inputs && input.inputs[0];
- if (nestedProperty) {
- this.value = nestedProperty.value;
- }
- }
-};
+} \ No newline at end of file
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 f5cd4094f5..0f22d53434 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
@@ -1,4 +1,4 @@
-import { SchemaPropertyGroupModel, SchemaProperty } from "../aschema-property";
+import { PropertyInputDetail, SchemaPropertyGroupModel, SchemaProperty } from "app/models";
import { PROPERTY_DATA, PROPERTY_TYPES } from 'app/utils';
export enum DerivedPropertyType {
SIMPLE,
@@ -10,8 +10,10 @@ export enum DerivedPropertyType {
export class PropertyBEModel {
defaultValue: string;
+ definition: boolean;
description: string;
fromDerived: boolean;
+ getInputValues: Array<PropertyInputDetail>
name: string;
parentUniqueId: string;
password: boolean;
@@ -20,13 +22,8 @@ export class PropertyBEModel {
type: string;
uniqueId: string;
value: string;
- definition: boolean;
- inputPath: string;
- propertiesName: string;
- ownerId: string;
- input: PropertyBEModel;
- constructor(property?: PropertyBEModel, childProperty?:PropertyBEModel) {
+ constructor(property?: PropertyBEModel) {
if (property) {
this.defaultValue = property.defaultValue;
this.description = property.description;
@@ -40,16 +37,7 @@ export class PropertyBEModel {
this.uniqueId = property.uniqueId;
this.value = property.value ? property.value : property.defaultValue;
this.definition = property.definition;
- this.ownerId = property.ownerId;
- if (property.inputPath) {
- this.inputPath = property.inputPath;
- }
- }
- if (childProperty) {
- this.input = childProperty;
- this.propertiesName = childProperty.propertiesName;
- } else {
- this.propertiesName = this.name;
+ this.getInputValues = property.getInputValues;
}
if (!this.schema || !this.schema.property) {
diff --git a/catalog-ui/src/app/models/properties-inputs/property-declare-api-model.ts b/catalog-ui/src/app/models/properties-inputs/property-declare-api-model.ts
new file mode 100644
index 0000000000..ddb7bd4391
--- /dev/null
+++ b/catalog-ui/src/app/models/properties-inputs/property-declare-api-model.ts
@@ -0,0 +1,18 @@
+'use strict';
+import { PropertyBEModel, PropertyFEModel, DerivedFEProperty } from "../../models";
+
+
+export class PropertyDeclareAPIModel extends PropertyBEModel{
+ input: PropertyBEModel;
+ propertiesName: string;
+
+
+ constructor(property: PropertyFEModel, childProperty?: DerivedFEProperty) {
+ super(property);
+ if (childProperty) {
+ this.input = childProperty;
+ this.propertiesName = childProperty.propertiesName;
+ }
+ }
+
+}
diff --git a/catalog-ui/src/app/models/properties-inputs/property-fe-model.ts b/catalog-ui/src/app/models/properties-inputs/property-fe-model.ts
index cfbe6d64c7..bfb6462f63 100644
--- a/catalog-ui/src/app/models/properties-inputs/property-fe-model.ts
+++ b/catalog-ui/src/app/models/properties-inputs/property-fe-model.ts
@@ -6,11 +6,12 @@ import { FilterPropertiesAssignmentData, PropertyBEModel, DerivedPropertyType, D
export class PropertyFEModel extends PropertyBEModel {
expandedChildPropertyId: string;
- flattenedChildren: Array<DerivedFEProperty>; //[parentPath] : Array<DerivedFEProp>
+ flattenedChildren: Array<DerivedFEProperty>;
isDeclared: boolean;
isDisabled: boolean;
isSelected: boolean;
isSimpleType: boolean; //for convenience only - we can really just check if derivedDataType == derivedPropertyTypes.SIMPLE to know if the prop is simple
+ propertiesName: string;
uniqueId: string;
valueObj: any; //this is the only value we relate to in the html templates
derivedDataType: DerivedPropertyType;
@@ -21,6 +22,7 @@ export class PropertyFEModel extends PropertyBEModel {
this.setNonDeclared();
this.derivedDataType = this.getDerivedPropertyType();
this.flattenedChildren = [];
+ this.propertiesName = this.name;
}
@@ -29,7 +31,7 @@ export class PropertyFEModel extends PropertyBEModel {
//TODO: handle this.derivedDataType == DerivedPropertyType.MAP
if (this.derivedDataType == DerivedPropertyType.LIST && this.schema.property.type == PROPERTY_TYPES.JSON) {
try {
- return JSON.stringify(this.valueObj.map(item => JSON.parse(item)));
+ return JSON.stringify(this.valueObj.map(item => (typeof item == 'string')? JSON.parse(item) : item));
} catch (e){}
}
@@ -37,7 +39,7 @@ export class PropertyFEModel extends PropertyBEModel {
}
public setNonDeclared = (childPath?: string): void => {
- if (!childPath) { //declaring a child prop
+ if (!childPath) { //un-declaring a child prop
this.isDeclared = false;
} else {
let childProp: DerivedFEProperty = this.flattenedChildren.find(child => child.propertiesName == childPath);
@@ -51,6 +53,7 @@ export class PropertyFEModel extends PropertyBEModel {
this.isDeclared = true;
} else {
let childProp: DerivedFEProperty = this.flattenedChildren.find(child => child.propertiesName == childNameToDeclare);
+ if (!childProp) { console.log("ERROR: Unabled to find child: " + childNameToDeclare, this); return; }
childProp.isSelected = false;
childProp.isDeclared = true;
}
diff --git a/catalog-ui/src/app/models/properties-inputs/property-input-detail.ts b/catalog-ui/src/app/models/properties-inputs/property-input-detail.ts
new file mode 100644
index 0000000000..03f7b4090b
--- /dev/null
+++ b/catalog-ui/src/app/models/properties-inputs/property-input-detail.ts
@@ -0,0 +1,6 @@
+export class PropertyInputDetail {
+ inputId: string;
+ inputName: string;
+ inputPath: string;
+ list: boolean;
+}
diff --git a/catalog-ui/src/app/ng2/components/hierarchy-navigtion/hierarchy-navigation.component.less b/catalog-ui/src/app/ng2/components/hierarchy-navigtion/hierarchy-navigation.component.less
index a9174fd73d..4befa2c797 100644
--- a/catalog-ui/src/app/ng2/components/hierarchy-navigtion/hierarchy-navigation.component.less
+++ b/catalog-ui/src/app/ng2/components/hierarchy-navigtion/hierarchy-navigation.component.less
@@ -6,6 +6,7 @@
border: 1px dotted;
border-right: none;
border-bottom: none;
+ width: 100%;
}
.node-item:last-child {
diff --git a/catalog-ui/src/app/ng2/components/inputs-table/inputs-table.component.html b/catalog-ui/src/app/ng2/components/inputs-table/inputs-table.component.html
index 5467c94de7..331415c26f 100644
--- a/catalog-ui/src/app/ng2/components/inputs-table/inputs-table.component.html
+++ b/catalog-ui/src/app/ng2/components/inputs-table/inputs-table.component.html
@@ -2,8 +2,8 @@
<loader [display]="isLoading" size="large" [relative]="false"></loader>
<div class="table-header">
<div class="table-cell col1">Property Name</div>
+ <div class="table-cell col3">From Instance</div>
<div class="table-cell col2">Type</div>
- <div class="table-cell col3">ES</div>
<div class="table-cell valueCol">Value</div>
</div>
<div class="table-body">
@@ -16,12 +16,16 @@
class="property-description-icon sprite-new show-desc"
tooltip="{{input.description}}" tooltipDelay="0"></span>
</div>
+ <div class="table-cell col3">
+ <div class="inner-cell-div" tooltip="{{instanceNamesMap[input.instanceUniqueId]}}">
+ <span>{{instanceNamesMap[input.instanceUniqueId]}}</span>
+ </div>
+ </div>
<div class="table-cell col2">
<div class="inner-cell-div" tooltip="{{input.type | contentAfterLastDot}}">
<span>{{input.type | contentAfterLastDot}}</span>
</div>
</div>
- <div class="table-cell col3">{{input.schema && input.schema.property && input.schema.property.type ? (input.schema.property.type | contentAfterLastDot) : ''}}</div>
<div class="table-cell valueCol input-value-col" [class.inner-table-container]="input.childrenProperties || !input.isSimpleType">
<dynamic-element class="value-input"
*ngIf="input.isSimpleType"
@@ -33,7 +37,7 @@
[readonly]="readonly">
</dynamic-element>
<div class="delete-button-container">
- <span *ngIf="!input.ownerId && !readonly" class="sprite-new delete-btn" (click)="openDeleteModal(input)"></span>
+ <span *ngIf="input.instanceUniqueId && !readonly" class="sprite-new delete-btn" (click)="openDeleteModal(input)"></span>
</div>
</div>
diff --git a/catalog-ui/src/app/ng2/components/inputs-table/inputs-table.component.ts b/catalog-ui/src/app/ng2/components/inputs-table/inputs-table.component.ts
index 83c0bda991..f2cac21237 100644
--- a/catalog-ui/src/app/ng2/components/inputs-table/inputs-table.component.ts
+++ b/catalog-ui/src/app/ng2/components/inputs-table/inputs-table.component.ts
@@ -13,6 +13,7 @@ import {ConfirmationDeleteInputComponent} from "./confirmation-delete-input/conf
export class InputsTableComponent {
@Input() inputs: Array<InputFEModel>;
+ @Input() instanceNamesMap: Map<string, string>;
@Input() readonly:boolean;
@Input() isLoading:boolean;
@Output() inputValueChanged: EventEmitter<any> = new EventEmitter<any>();
diff --git a/catalog-ui/src/app/ng2/components/properties-table/dynamic-property/dynamic-property.component.html b/catalog-ui/src/app/ng2/components/properties-table/dynamic-property/dynamic-property.component.html
index 5aa0052cc3..92948b3b0d 100644
--- a/catalog-ui/src/app/ng2/components/properties-table/dynamic-property/dynamic-property.component.html
+++ b/catalog-ui/src/app/ng2/components/properties-table/dynamic-property/dynamic-property.component.html
@@ -38,7 +38,7 @@
<ng-container *ngIf="!property.isDeclared">
<a *ngIf="(propType == derivedPropertyTypes.LIST || propType == derivedPropertyTypes.MAP) && !property.isChildOfListOrMap" class="property-icon add-item" (click)="createNewChildProperty();" [ngClass]="{'disabled':readonly}">Add value to list</a>
<span *ngIf="property.isChildOfListOrMap" (click)="deleteItem.emit(property);" class="property-icon sprite-new delete-item-icon" [ngClass]="{'disabled':readonly}"></span>
- <span *ngIf="!isPropertyFEModel && (propType == derivedPropertyTypes.COMPLEX || ((propType == derivedPropertyTypes.LIST || propType == derivedPropertyTypes.MAP) && hasChildren()))" (click)="expandChildById(propPath)" class="property-icon sprite-new round-expand-icon" [class.open]="propPath == expandedChildId"></span>
+ <span *ngIf="!isPropertyFEModel && (propType == derivedPropertyTypes.COMPLEX || ((propType == derivedPropertyTypes.LIST || propType == derivedPropertyTypes.MAP) && hasChildren()))" (click)="expandChildById(propPath)" class="property-icon sprite-new round-expand-icon" [class.open]="expandedChildId.indexOf(propPath) == 0"></span>
</ng-container>
</div>
diff --git a/catalog-ui/src/app/ng2/components/properties-table/properties-table.component.html b/catalog-ui/src/app/ng2/components/properties-table/properties-table.component.html
index f3259ab3a2..c57998af5e 100644
--- a/catalog-ui/src/app/ng2/components/properties-table/properties-table.component.html
+++ b/catalog-ui/src/app/ng2/components/properties-table/properties-table.component.html
@@ -7,14 +7,14 @@
<div class="table-cell valueCol">Value</div>
</div>
<div class="table-body">
- <div class="no-data" *ngIf="!feInstancesNames || !feInstancesNames.length">No data to display</div>
+ <div class="no-data" *ngIf="!fePropertiesMap || !(fePropertiesMap | keys).length">No data to display</div>
- <ng-container *ngFor="let instanceName of feInstancesNames; trackBy:instanceName">
- <div class="table-rows-header white-sub-header">{{instanceName | contentAfterLastDot}}</div>
+ <ng-container *ngFor="let instanceId of fePropertiesMap | keys; trackBy:instanceId">
+ <div class="table-rows-header white-sub-header">{{feInstanceNamesMap[instanceId]}}</div>
<div class="table-row"
- *ngFor="let property of fePropertiesMap[instanceName] | searchFilter:'name':searchTerm; trackBy:property?.name"
- (click)="onClickPropertyRow(property, instanceName, $event)"
+ *ngFor="let property of fePropertiesMap[instanceId] | searchFilter:'name':searchTerm; trackBy:property?.name"
+ (click)="onClickPropertyRow(property, instanceId, $event)"
[ngClass]="{'selected': selectedPropertyId && selectedPropertyId === property.name }">
<div class="table-cell col1" [ngClass]="{'filtered':property.name === propertyNameSearchText}" [class.round-checkbox]="property.isDeclared">
@@ -49,7 +49,7 @@
[readonly]="readonly"
(valueChanged)="propValueChanged(property);"
(expandChild)="property.updateExpandedChildPropertyId($event)"
- (clickOnPropertyRow)="onClickPropertyInnerRow($event, instanceName)"
+ (clickOnPropertyRow)="onClickPropertyInnerRow($event, instanceId)"
(checkProperty)="propertyChecked(property, $event)"
>
</dynamic-property>
diff --git a/catalog-ui/src/app/ng2/components/properties-table/properties-table.component.ts b/catalog-ui/src/app/ng2/components/properties-table/properties-table.component.ts
index 463de4f018..f1721c0708 100644
--- a/catalog-ui/src/app/ng2/components/properties-table/properties-table.component.ts
+++ b/catalog-ui/src/app/ng2/components/properties-table/properties-table.component.ts
@@ -12,6 +12,7 @@ import { KeysPipe } from 'app/ng2/pipes/keys.pipe';
export class PropertiesTableComponent {
@Input() fePropertiesMap: InstanceFePropertiesMap;
+ @Input() feInstanceNamesMap: Map<string, string>;
@Input() selectedPropertyId: string;
@Input() displayDeleteButton: boolean;
@Input() propertyNameSearchText:string;
@@ -24,23 +25,10 @@ export class PropertiesTableComponent {
@Output() updateCheckedPropertyCount: EventEmitter<boolean> = new EventEmitter<boolean>();
//@Output() selectInstanceRow: EventEmitter<string> = new EventEmitter<string>();
- feInstancesNames: Array<string>;
constructor ( private propertiesService:PropertiesService ){
}
- /**
- * Update feInstancesNames when fePropertiesMap: InstanceFePropertiesMap change (after getting response from server)
- */
- ngOnChanges(changes: SimpleChanges) {
- if (changes['fePropertiesMap']) {
- if (changes['fePropertiesMap'].currentValue) {
- let keysPipe = new KeysPipe();
- let fiteredArr = keysPipe.transform(changes['fePropertiesMap'].currentValue,[]);
- this.feInstancesNames = fiteredArr;
- }
- }
- }
propValueChanged = (property) => {
!property.isDeclared && this.valueChanged.emit(property);
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.html b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.html
index fa3270ec77..0b50357a5c 100644
--- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.html
+++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.html
@@ -5,6 +5,7 @@
<tab tabTitle="Properties">
<properties-table class="properties-table"
[fePropertiesMap]="instanceFePropertiesMap"
+ [feInstanceNamesMap]="componentInstanceNamesMap"
[searchTerm]="searchQuery"
[selectedPropertyId]="selectedFlatProperty.path"
[propertyNameSearchText]="searchPropertyName"
@@ -22,6 +23,7 @@
<inputs-table class="properties-table"
[readonly]="isReadonly"
[inputs]="inputs | searchFilter:'name':searchQuery"
+ [instanceNamesMap]="componentInstanceNamesMap"
[isLoading]="loadingInputs"
(deleteInput)="deleteInput($event)"
(inputValueChanged)="inputValueChanged($event)"></inputs-table>
@@ -29,10 +31,10 @@
</tabs>
<div class="header">
<div class="search-filter-container" [class.without-filter]="isInpusTabSelected">
+ <span *ngIf="displayClearSearch && !isInpusTabSelected" (click)="clickOnClearSearch()" class="clear-filter">Clear All</span>
<input type="text" class="search-box" placeholder="Search" [(ngModel)]="searchQuery" />
<span class="sprite search-icon"></span>
<filter-properties-assignment *ngIf="!isInpusTabSelected" #advanceSearch class="advance-search" [componentType]="component.componentType" (searchProperties)="searchPropertiesInstances($event)"></filter-properties-assignment>
- <span *ngIf="displayClearSearch && !isInpusTabSelected" (click)="clickOnClearSearch()" class="clear-filter">Clear All</span>
</div>
<button class="tlv-btn blue declare-button" [disabled]="!checkedPropertiesCount || isReadonly" (click)="declareProperties()">Declare</button>
</div>
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.less b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.less
index 8df479ffa6..15244e5fa5 100644
--- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.less
+++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.less
@@ -98,17 +98,13 @@
}
}
- .advance-search{
-
- }
+
.clear-filter{
cursor: pointer;
- color: @main_color_c;
- font-family: @font-omnes-medium-italic;
+ color:#009fdb;
text-decoration: underline;
- position: relative;
- top: 4px;
- right: 16px;
+ padding-right:10px;
+ font-size:12px;
}
.declare-button{
@@ -170,8 +166,7 @@
}
.hierarchy-nav-container {
- flex:1;
- overflow: auto;
+ display:flex;
flex-direction: column;
height: 100%;
}
@@ -187,6 +182,8 @@
}
.hierarchy-nav {
+ flex:1;
+ overflow:auto;
display: grid;
margin-top: 1em;
margin-left: 1em;
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts
index e66ed59ad7..3efe866479 100644
--- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts
+++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts
@@ -22,7 +22,8 @@ import {EventListenerService} from "app/services/event-listener-service"
export class PropertiesAssignmentComponent {
title = "Properties & Inputs";
- component:ComponentData;
+ component: ComponentData;
+ componentInstanceNamesMap: Map<string, string> = new Map<string, string>();//instanceUniqueId, name
propertiesNavigationData = [];
instancesNavigationData = [];
@@ -80,7 +81,7 @@ export class PropertiesAssignmentComponent {
.getComponentInputs(this.component)
.subscribe(response => {
_.forEach(response.inputs, (input: InputBEModel) => {
- this.inputs.push(new InputFEModel(input));
+ this.inputs.push(new InputFEModel(input)); //only push items that were declared via SDC
});
this.loadingInputs = false;
@@ -92,6 +93,7 @@ export class PropertiesAssignmentComponent {
_.forEach(this.instances, (instance) => {
this.instancesNavigationData.push(instance);
+ this.componentInstanceNamesMap[instance.uniqueId] = instance.name;
});
this.loadingInstances = false;
if (this.instancesNavigationData[0] == undefined) {
@@ -129,12 +131,12 @@ export class PropertiesAssignmentComponent {
this.selectedInstanceType = resourceInstance.originType;
this.loadingProperties = true;
- if(resourceInstance.originType === ResourceType.VF) {
+ if(this.isInput(resourceInstance.originType)) {
this.componentInstanceServiceNg2
.getComponentInstanceInputs(this.component, resourceInstance)
.subscribe(response => {
instanceBePropertiesMap[resourceInstance.uniqueId] = response;
- this.processInstancePropertiesResponse(instanceBePropertiesMap);
+ this.processInstancePropertiesResponse(instanceBePropertiesMap, true);
this.loadingProperties = false;
});
@@ -143,7 +145,7 @@ export class PropertiesAssignmentComponent {
.getComponentInstanceProperties(this.component, resourceInstance.uniqueId)
.subscribe(response => {
instanceBePropertiesMap[resourceInstance.uniqueId] = response;
- this.processInstancePropertiesResponse(instanceBePropertiesMap);
+ this.processInstancePropertiesResponse(instanceBePropertiesMap, false);
this.loadingProperties = false;
});
}
@@ -159,8 +161,8 @@ export class PropertiesAssignmentComponent {
/**
* Entry point handling response from server
*/
- processInstancePropertiesResponse = (instanceBePropertiesMap:InstanceBePropertiesMap) => {
- this.instanceFePropertiesMap = this.propertiesUtils.convertPropertiesMapToFEAndCreateChildren(instanceBePropertiesMap, this.inputs); //create flattened children, disable declared props, and init values
+ processInstancePropertiesResponse = (instanceBePropertiesMap: InstanceBePropertiesMap, originTypeIsVF: boolean) => {
+ this.instanceFePropertiesMap = this.propertiesUtils.convertPropertiesMapToFEAndCreateChildren(instanceBePropertiesMap, originTypeIsVF, this.inputs); //create flattened children, disable declared props, and init values
this.checkedPropertiesCount = 0;
};
@@ -171,7 +173,7 @@ export class PropertiesAssignmentComponent {
// Copying the actual value from the object ref into the value if it's from a complex type
event.value = event.getJSONValue();
- if (this.selectedInstanceData.originType === ResourceType.VF) {
+ if (this.isInput(this.selectedInstanceData.originType)) {
console.log("I want to update input value on the resource instance");
let inputToUpdate = new PropertyBEModel(event);
this.componentInstanceServiceNg2
@@ -279,7 +281,7 @@ export class PropertiesAssignmentComponent {
});
let inputsToCreate: InstancePropertiesAPIMap;
- if (this.selectedInstanceType !== ResourceType.VF) {
+ if (!this.isInput(this.selectedInstanceType)) {
inputsToCreate = new InstancePropertiesAPIMap(null, selectedProperties);
} else {
inputsToCreate = new InstancePropertiesAPIMap(selectedProperties, null);
@@ -301,12 +303,12 @@ export class PropertiesAssignmentComponent {
updatePropertyValueAfterDeclare = (input: InputFEModel) => {
if (this.instanceFePropertiesMap[input.instanceUniqueId]) {
let propertyForUpdatindVal = _.find(this.instanceFePropertiesMap[input.instanceUniqueId], (feProperty: PropertyFEModel) => {
- return feProperty.name == input.relatedProperty.name;
+ return feProperty.name == input.relatedPropertyName;
});
-
- propertyForUpdatindVal.setAsDeclared(input.relatedProperty.nestedPath); //set prop as declared before assigning value
- this.propertiesService.disableRelatedProperties(propertyForUpdatindVal, input.relatedProperty.nestedPath);
- this.propertiesUtils.resetPropertyValue(propertyForUpdatindVal, input.relatedProperty.value, input.relatedProperty.nestedPath);
+ let inputPath = (input.inputPath && input.inputPath != propertyForUpdatindVal.name) ? input.inputPath : undefined;
+ propertyForUpdatindVal.setAsDeclared(inputPath); //set prop as declared before assigning value
+ this.propertiesService.disableRelatedProperties(propertyForUpdatindVal, inputPath);
+ this.propertiesUtils.resetPropertyValue(propertyForUpdatindVal, input.relatedPropertyValue, inputPath);
}
}
@@ -357,7 +359,7 @@ export class PropertiesAssignmentComponent {
.filterComponentInstanceProperties(this.component, filterData)
.subscribe(response => {
- this.processInstancePropertiesResponse(response);
+ this.processInstancePropertiesResponse(response, false);
this.hierarchyPropertiesDisplayOptions.searchText = filterData.propertyName;//mark results in tree
this.searchPropertyName = filterData.propertyName;//mark in table
this.renderer.invokeElementMethod(this.hierarchyNavTabs, 'triggerTabChange', ['Composition']);
@@ -373,6 +375,7 @@ export class PropertiesAssignmentComponent {
this.hierarchyPropertiesDisplayOptions.searchText = "";
this.displayClearSearch = false;
this.advanceSearch.clearAll();
+ this.searchQuery = '';
};
clickOnClearSearch = () => {
@@ -382,4 +385,8 @@ export class PropertiesAssignmentComponent {
this.hierarchyNavTabs, 'triggerTabChange', ['Composition']);
};
+ private isInput = (instanceType:string):boolean =>{
+ return instanceType === ResourceType.VF || instanceType === ResourceType.PNF;
+ }
+
}
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts
index bdfbc4c402..bd629939be 100644
--- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts
+++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts
@@ -18,10 +18,9 @@ export class PropertiesUtils {
* 3. Initialize valueObj (which also creates any new list/map flattened children as needed)
* Returns InstanceFePropertiesMap
*/
- public convertPropertiesMapToFEAndCreateChildren = (instancePropertiesMap:InstanceBePropertiesMap, inputs:Array<InputFEModel>): InstanceFePropertiesMap => {
+ public convertPropertiesMapToFEAndCreateChildren = (instancePropertiesMap:InstanceBePropertiesMap, isVF:boolean, inputs?:Array<InputFEModel>): InstanceFePropertiesMap => {
let instanceFePropertiesMap:InstanceFePropertiesMap = new InstanceFePropertiesMap();
angular.forEach(instancePropertiesMap, (properties:Array<PropertyBEModel>, instanceId:string) => {
- let instanceInputs: Array<InputFEModel> = inputs.filter(input => input.instanceUniqueId == instanceId);
let propertyFeArray: Array<PropertyFEModel> = [];
_.forEach(properties, (property: PropertyBEModel) => {
@@ -34,12 +33,19 @@ export class PropertiesUtils {
if (newFEProp.derivedDataType == DerivedPropertyType.COMPLEX) { //Create children if prop is not simple, list, or map.
newFEProp.flattenedChildren = this.createFlattenedChildren(newFEProp.type, newFEProp.name);
}
- if (instanceInputs.length) { //if this prop (or any children) are declared, set isDeclared and disable checkbox on parents/children
- instanceInputs.filter(input => input.relatedProperty.name == newFEProp.name).forEach((input) => {
- newFEProp.setAsDeclared(input.relatedProperty.nestedPath); //if a path was sent, its a child prop. this param is optional
- this.propertiesService.disableRelatedProperties(newFEProp, input.relatedProperty.nestedPath);
+ if (newFEProp.getInputValues && newFEProp.getInputValues.length) { //if this prop (or any children) are declared, set isDeclared and disable checkbox on parents/children
+ newFEProp.getInputValues.forEach(propInputDetail => {
+ let inputPath = propInputDetail.inputPath;
+ if (!isVF && !inputPath) { //TODO: this is a workaround until Marina adds inputPath
+ let input = inputs.find(input => input.uniqueId == propInputDetail.inputId);
+ if (!input) { console.log("CANNOT FIND INPUT FOR " + propInputDetail.inputId); return; }
+ else inputPath = input.inputPath;
+ }
+ if (isVF || inputPath == newFEProp.name) inputPath = undefined;
+ newFEProp.setAsDeclared(inputPath); //if a path is sent, its a child prop. this param is optional
+ this.propertiesService.disableRelatedProperties(newFEProp, inputPath);
});
- }
+ }
this.initValueObjectRef(newFEProp); //initialize valueObj.
propertyFeArray.push(newFEProp);
newFEProp.updateExpandedChildPropertyId(newFEProp.name); //display only the first level of children
@@ -51,19 +57,8 @@ export class PropertiesUtils {
});
return instanceFePropertiesMap;
}
- private createListOrMapChildrenFromValueObj = (property: PropertyFEModel) => {
- if ((property.derivedDataType == DerivedPropertyType.LIST || property.derivedDataType == DerivedPropertyType.MAP)
- && Object.keys(property.valueObj).length) {
-
- Object.keys(property.valueObj).forEach((key) => {
- let newProps: Array<DerivedFEProperty> = this.createListOrMapChildren(property, key, property.valueObj[key]);
- property.flattenedChildren.push(...newProps);
- });
-
- }
- }
- public createListOrMapChildren = (property:PropertyBEModel, key: string, valueObj: any): Array<DerivedFEProperty> => {
+ public createListOrMapChildren = (property:PropertyFEModel | DerivedFEProperty, key: string, valueObj: any): Array<DerivedFEProperty> => {
let newProps: Array<DerivedFEProperty> = [];
let parentProp = new DerivedFEProperty(property, property.propertiesName, true, key, valueObj);
newProps.push(parentProp);
@@ -101,10 +96,12 @@ export class PropertiesUtils {
} else {
property.valueObj = _.merge({}, JSON.parse(property.defaultValue || '{}'), JSON.parse(property.value || '{}')); //value object should be merged value and default value. Value takes higher precendence. Set valueObj to empty obj if undefined.
}
- if (property.derivedDataType == DerivedPropertyType.COMPLEX) {
- this.assignFlattenedChildrenValues(property.valueObj, property.flattenedChildren, property.name);
+ if ((property.derivedDataType == DerivedPropertyType.LIST || property.derivedDataType == DerivedPropertyType.MAP) && Object.keys(property.valueObj).length) {
+ Object.keys(property.valueObj).forEach((key) => {
+ property.flattenedChildren.push(...this.createListOrMapChildren(property, key, property.valueObj[key]))
+ });
} else {
- this.createListOrMapChildrenFromValueObj(property);
+ this.assignFlattenedChildrenValues(property.valueObj, property.flattenedChildren, property.name);
}
}
}
@@ -116,6 +113,7 @@ export class PropertiesUtils {
*/
public assignFlattenedChildrenValues = (parentValueJSON: any, derivedPropArray: Array<DerivedFEProperty>, parentName: string) => {
if (!derivedPropArray || !parentName) return;
+ let propsToPushMap: Map<number, Array<DerivedFEProperty>> = new Map<number, Array<DerivedFEProperty>>();
derivedPropArray.forEach((prop, index) => {
let propNameInObj = prop.propertiesName.substring(prop.propertiesName.indexOf(parentName) + parentName.length + 1).split('#').join('.'); //extract everything after parent name
@@ -124,20 +122,27 @@ export class PropertiesUtils {
if ((prop.derivedDataType == DerivedPropertyType.SIMPLE || prop.isDeclared) && typeof prop.valueObj == 'object') { //Stringify objects that should be strings
prop.valueObj = JSON.stringify(prop.valueObj);
} else { //parse strings that should be objects
- if ((prop.derivedDataType == DerivedPropertyType.COMPLEX || prop.derivedDataType == DerivedPropertyType.MAP) && typeof prop.valueObj != 'object') {
+ if (prop.derivedDataType == DerivedPropertyType.COMPLEX && typeof prop.valueObj != 'object') {
prop.valueObj = JSON.parse(prop.valueObj || '{}');
} else if (prop.derivedDataType == DerivedPropertyType.LIST && typeof prop.valueObj != 'object') {
prop.valueObj = JSON.parse(prop.valueObj || '[]');
- }
- if ((prop.derivedDataType == DerivedPropertyType.LIST || prop.derivedDataType == DerivedPropertyType.MAP) && Object.keys(prop.valueObj).length) {
+ } else if (prop.derivedDataType == DerivedPropertyType.MAP && typeof prop.valueObj != 'object' && (!prop.isChildOfListOrMap || !prop.schema.property.isSimpleType)) { //dont parse values for children of map of simple
+ prop.valueObj = JSON.parse(prop.valueObj || '{}');
+ }
+ if ((prop.derivedDataType == DerivedPropertyType.LIST || prop.derivedDataType == DerivedPropertyType.MAP) && typeof prop.valueObj == 'object' && Object.keys(prop.valueObj).length) {
let newProps: Array<DerivedFEProperty> = [];
Object.keys(prop.valueObj).forEach((key) => {
newProps.push(...this.createListOrMapChildren(prop, key, prop.valueObj[key]));//create new children, assign their values, and then add to array
});
- derivedPropArray.splice(index + 1, 0, ...newProps);
+ propsToPushMap[index + 1] = newProps;
}
}
});
+
+ //add props after we're done looping (otherwise our loop gets messed up). Push in reverse order, so we dont mess up indexes.
+ Object.keys(propsToPushMap).reverse().forEach((indexToInsert) => {
+ derivedPropArray.splice(+indexToInsert, 0, ...propsToPushMap[indexToInsert]); //slacker parsing
+ });
}
public resetPropertyValue = (property: PropertyFEModel, newValue: string, nestedPath?: string): void => {
diff --git a/catalog-ui/src/app/ng2/services/http.interceptor.service.ts b/catalog-ui/src/app/ng2/services/http.interceptor.service.ts
index aebbdbf7af..7a859097a9 100644
--- a/catalog-ui/src/app/ng2/services/http.interceptor.service.ts
+++ b/catalog-ui/src/app/ng2/services/http.interceptor.service.ts
@@ -8,6 +8,8 @@ import {ReflectiveInjector} from '@angular/core';
import {Cookie2Service} from "./cookie.service";
import {UUID} from "angular2-uuid";
import {Dictionary} from "../../utils/dictionary/dictionary";
+import {SEVERITY} from "../../utils/constants";
+import {IServerMessageModalModel} from "../../view-models/modals/message-modal/message-server-modal/server-message-modal-view-model";
export class HttpInterceptor implements Interceptor {
@@ -27,17 +29,22 @@ export class HttpInterceptor implements Interceptor {
*/
request.options.headers.append(this.cookieService.getUserIdSuffix(), this.cookieService.getUserId());
- var uuidValue = this.getUuidValue(request.url);
- if(uuidValue!= ''){
- request.options.headers.set('X-ECOMP-ServiceID',uuidValue);
- }
- request.options.headers.set('X-ECOMP-RequestID', UUID.UUID());
+ request.options.withCredentials = true;
+ var uuidValue = this.getUuidValue(request.url);
+ if (uuidValue != '') {
+ request.options.headers.set('X-ECOMP-ServiceID', uuidValue);
+ }
+ request.options.headers.set('X-ECOMP-RequestID', UUID.UUID());
return request;
}
- public interceptAfter(response: InterceptedResponse): InterceptedResponse {
-
+ public interceptAfter(response:InterceptedResponse):InterceptedResponse {
+
+ if (response.response.status !== 200 && response.response.status !== 201) {
+ this.responseError(response.response.json());
+ //console.log("Error from BE:",response);
+ }
return response;
}
@@ -52,6 +59,88 @@ export class HttpInterceptor implements Interceptor {
});
}
return '';
- }
+ };
+
+ public formatMessageArrays = (message:string, variables:Array<string>)=> {
+ return message.replace(/\[%(\d+)\]/g, function (_, m) {
+ let tmp = [];
+ let list = variables[--m].split(";");
+ list.forEach(function (item) {
+ tmp.push("<li>" + item + "</li>");
+ });
+ return "<ul>" + tmp.join("") + "</ul>";
+ });
+ };
+
+ public responseError = (rejection:any)=> {
+
+ let text:string;
+ let variables;
+ let messageId:string = "";
+ let isKnownException = false;
+
+ if (rejection && rejection.serviceException) {
+ text = rejection.serviceException.text;
+ variables = rejection.serviceException.variables;
+ messageId = rejection.serviceException.messageId;
+ isKnownException = true;
+ } else if (rejection && rejection.requestError && rejection.requestError.serviceException) {
+ text = rejection.requestError.serviceException.text;
+ variables = rejection.requestError.serviceException.variables;
+ messageId = rejection.requestError.serviceException.messageId;
+ isKnownException = true;
+ } else if (rejection && rejection.requestError && rejection.requestError.policyException) {
+ text = rejection.requestError.policyException.text;
+ variables = rejection.requestError.policyException.variables;
+ messageId = rejection.requestError.policyException.messageId;
+ isKnownException = true;
+ } else if (rejection) {
+ text = 'Wrong error format from server';
+ console.error(text);
+ isKnownException = false;
+ }
+
+ let data:IServerMessageModalModel;
+ if (isKnownException) {
+ // Remove the "Error: " text at the begining
+ if (text.trim().indexOf("Error:") === 0) {
+ text = text.replace("Error:", "").trim();
+ }
+
+ //mshitrit DE199895 bug fix
+ let count:number = 0;
+ variables.forEach(function (item) {
+ variables[count] = item ? item.replace('<', '&lt').replace('>', '&gt') : '';
+ count++;
+ });
+ // Format the message in case has array to <ul><li>
+ text = this.formatMessageArrays(text, variables);
+
+ // Format the message %1 %2
+ text = text.format(variables);
+
+ // Need to inject the MessageService manually to prevent circular dependencies (because MessageService use $templateCache that use $http).
+ data = {
+ title: 'Error',
+ message: text,
+ messageId: messageId,
+ status: rejection.status,
+ severity: SEVERITY.ERROR
+ };
+ } else {
+ // Need to inject the MessageService manually to prevent circular dependencies (because MessageService use $templateCache that use $http).
+ data = {
+ title: 'Error',
+ message: rejection.status !== -1 ? rejection.statusText : "Error getting response from server",
+ messageId: messageId,
+ status: rejection.status,
+ severity: SEVERITY.ERROR
+ };
+ }
+ // let modalsHandler = this.$injector.get('ModalsHandler');
+
+ // this.modalsHandler.openServerMessageModal(data);
+ console.error('ERROR data',data);
+ }
}
diff --git a/catalog-ui/src/app/ng2/services/properties.service.ts b/catalog-ui/src/app/ng2/services/properties.service.ts
index a22e2aed20..3a02e503fa 100644
--- a/catalog-ui/src/app/ng2/services/properties.service.ts
+++ b/catalog-ui/src/app/ng2/services/properties.service.ts
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
-import { DataTypeModel, PropertyFEModel, PropertyBEModel, SchemaProperty, DerivedFEProperty, DerivedFEPropertyMap, DerivedPropertyType, InputFEModel} from "app/models";
+import { DataTypeModel, PropertyFEModel, PropertyBEModel, SchemaProperty, PropertyDeclareAPIModel, DerivedFEProperty, DerivedFEPropertyMap, DerivedPropertyType, InputFEModel} from "app/models";
import { DataTypeService } from "./data-type.service";
import { PROPERTY_TYPES } from "app/utils";
import { ContentAfterLastDotPipe } from "../pipes/contentAfterLastDot.pipe";
@@ -48,14 +48,14 @@ export class PropertiesService {
}
public getCheckedProperties = (properties: Array<PropertyFEModel>): Array<PropertyBEModel> => {
- let selectedProps: Array<PropertyBEModel> = [];
+ let selectedProps: Array<PropertyDeclareAPIModel> = [];
properties.forEach(prop => {
if (prop.isSelected && !prop.isDeclared && !prop.isDisabled) {
- selectedProps.push(new PropertyBEModel(prop));
+ selectedProps.push(new PropertyDeclareAPIModel(prop));
} else if (prop.flattenedChildren) {
prop.flattenedChildren.forEach((child) => {
if (child.isSelected && !child.isDeclared && !child.isDisabled) {
- let childProp = new PropertyBEModel(prop, child); //create it from the parent
+ let childProp = new PropertyDeclareAPIModel(prop, child); //create it from the parent
selectedProps.push(childProp);
}
})
diff --git a/catalog-ui/src/app/utils/constants.ts b/catalog-ui/src/app/utils/constants.ts
index 7426c7c92b..0f4fde2ff4 100644
--- a/catalog-ui/src/app/utils/constants.ts
+++ b/catalog-ui/src/app/utils/constants.ts
@@ -24,6 +24,7 @@ export class ResourceType {
static CP = 'CP';
static VFC = 'VFC';
static VFCMT = 'VFCMT';
+ static PNF = 'PNF';
}
export class ComponentState {
@@ -79,6 +80,10 @@ export class PROPERTY_TYPES {
public static JSON = 'json';
public static MAP = 'map';
public static LIST = 'list';
+ public static SCALAR = 'scalar-unit';
+ public static SCALAR_FREQUENCY = 'scalar-unit.frequency';
+ public static SCALAR_SIZE = 'scalar-unit.size';
+ public static SCALAR_TIME = 'scalar-unit.time';
}
export class SOURCES {
@@ -88,8 +93,8 @@ export class SOURCES {
}
export class PROPERTY_DATA {
- public static TYPES = [PROPERTY_TYPES.STRING, PROPERTY_TYPES.INTEGER, PROPERTY_TYPES.FLOAT, PROPERTY_TYPES.BOOLEAN, PROPERTY_TYPES.JSON, PROPERTY_TYPES.LIST, PROPERTY_TYPES.MAP];
- public static SIMPLE_TYPES = [PROPERTY_TYPES.STRING, PROPERTY_TYPES.INTEGER, PROPERTY_TYPES.FLOAT, PROPERTY_TYPES.BOOLEAN, PROPERTY_TYPES.JSON];
+ public static TYPES = [PROPERTY_TYPES.STRING, PROPERTY_TYPES.INTEGER, 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 SIMPLE_TYPES = [PROPERTY_TYPES.STRING, PROPERTY_TYPES.INTEGER, 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 ROOT_DATA_TYPE = "tosca.datatypes.Root";
public static OPENECOMP_ROOT = "org.openecomp.datatypes.Root";
public static SUPPLEMENTAL_DATA = "supplemental_data";
@@ -210,6 +215,7 @@ export class States {
export class EVENTS {
static RESOURCE_LEFT_PALETTE_UPDATE_EVENT = "resourceLeftPanelUpdateEvent";
+ static RESOURCE_PNF_LEFT_PALETTE_UPDATE_EVENT = "resourcePNFLeftPanelUpdateEvent";
static SERVICE_LEFT_PALETTE_UPDATE_EVENT = "serviceLeftPanelUpdateEvent";
static PRODUCT_LEFT_PALETTE_UPDATE_EVENT = "productLeftPanelUdateEvent";
static VL_LEFT_PALETTE_UPDATE_EVENT = "vlLeftPanelUdateEvent";
diff --git a/catalog-ui/src/app/view-models/forms/property-forms/module-property-modal/module-property-model.ts b/catalog-ui/src/app/view-models/forms/property-forms/module-property-modal/module-property-model.ts
index 13e9e8d80a..a58756b4a6 100644
--- a/catalog-ui/src/app/view-models/forms/property-forms/module-property-modal/module-property-model.ts
+++ b/catalog-ui/src/app/view-models/forms/property-forms/module-property-modal/module-property-model.ts
@@ -173,7 +173,7 @@ export class ModulePropertyView extends PropertyFormBaseView {
if (isNaN(minPropertyValue) || minPropertyValue == null) {
isValid = propertyValue >= initialCountPropertyValue;
} else {
- isValid = !propertyValue || (propertyValue >= minPropertyValue && propertyValue >= initialCountPropertyValue);
+ isValid = isNaN(propertyValue) || (propertyValue >= minPropertyValue && propertyValue >= initialCountPropertyValue);
}
this.$scope.forms.editForm["value"].$setValidity('minValidation', isValid);
if (this.component.isService()) {
diff --git a/catalog-ui/src/app/view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view-model.ts b/catalog-ui/src/app/view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view-model.ts
index 5d03563042..f12e95c9df 100644
--- a/catalog-ui/src/app/view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view-model.ts
+++ b/catalog-ui/src/app/view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view-model.ts
@@ -221,7 +221,7 @@ export class ResourceArtifactsViewModel {
if (artifact.artifactGroupType === ArtifactGroupType.INFORMATION) {//fix DE256847
return this.$scope.currentComponent.artifacts && (!this.$scope.currentComponent.artifacts[artifact.artifactLabel] || !this.$scope.currentComponent.artifacts[artifact.artifactLabel].artifactName);
}
- return this.$scope.currentComponent.deploymentArtifacts && (!this.$scope.currentComponent.deploymentArtifacts[artifact.artifactLabel]);//fix DE251314
+ return this.$scope.currentComponent.selectedInstance && this.$scope.currentComponent.selectedInstance.deploymentArtifacts && this.$scope.currentComponent.selectedInstance.deploymentArtifacts[artifact.artifactLabel];
};
this.$scope.addOrUpdate = (artifact:ArtifactModel):void => {
diff --git a/catalog-ui/src/app/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts-view.html b/catalog-ui/src/app/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts-view.html
index 5df6b5c11f..2cc0778a90 100644
--- a/catalog-ui/src/app/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts-view.html
+++ b/catalog-ui/src/app/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts-view.html
@@ -36,7 +36,7 @@
</div>
<div data-ng-repeat-end="" data-ng-if="artifact.selected" class="item-opened" data-tests-id="details-{{$index}}">
<div><span class="details-title">Label:</span> {{artifact.artifactLabel}}</div>
- <div><span class="details-title">UUID:</span> {{artifact.uniqueId}}</div>
+ <div><span class="details-title">UUID:</span> {{artifact.artifactUUID}}</div>
<div><span class="details-title">Description:</span> {{artifact.description}}</div>