diff options
author | Tal Gitelman <tg851x@intl.att.com> | 2017-07-03 20:16:55 +0300 |
---|---|---|
committer | Tal Gitelman <tg851x@intl.att.com> | 2017-07-03 20:16:55 +0300 |
commit | 153a35821f0d25ce23cca467b76c5a7c5092c744 (patch) | |
tree | 0c66c4d1310019479e446ea3a4c26faffb0aa33f /catalog-ui/src/app/directives | |
parent | ffdda7d685029d6a88ac82ac637e43bba96423cb (diff) |
[sdc] - last merges before moving to LF
Change-Id: I0df3ec795f0de84229ea4bb4806ec8f959243557
Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app/directives')
3 files changed, 11 insertions, 4 deletions
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 = {}; |