aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/models
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-07-22 17:10:02 +0300
committerMichael Lando <ml636r@att.com>2017-07-22 17:10:02 +0300
commit9db4052423f34a76296ffdcda896cdeba2b4aead (patch)
tree7c3b779c6d09be40283158382dee2cf02767761e /catalog-ui/src/app/models
parent3c3c833897dbfc0e85feaf36086a505f990ecb76 (diff)
[sdc] 1710 rebase code
Change-Id: Icedeac71c0a9d27518969effcd5d5519de9955a6 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/src/app/models')
-rw-r--r--catalog-ui/src/app/models/graph/nodes/base-common-node.ts3
-rw-r--r--catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-base.ts24
-rw-r--r--catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-cp.ts3
-rw-r--r--catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-service.ts3
-rw-r--r--catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vf.ts3
-rw-r--r--catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vl.ts3
6 files changed, 29 insertions, 10 deletions
diff --git a/catalog-ui/src/app/models/graph/nodes/base-common-node.ts b/catalog-ui/src/app/models/graph/nodes/base-common-node.ts
index 153a18225d..fb43f46bbd 100644
--- a/catalog-ui/src/app/models/graph/nodes/base-common-node.ts
+++ b/catalog-ui/src/app/models/graph/nodes/base-common-node.ts
@@ -27,7 +27,8 @@ export abstract class CommonNodeBase {
public displayName:string;
public name:string;
- public img:string;
+ public img: string;
+ public imgWidth: number;
public certified:boolean;
public isGroup:boolean;
public imagesPath:string;
diff --git a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-base.ts b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-base.ts
index 1e4a735a53..681cebc8d2 100644
--- a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-base.ts
+++ b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-base.ts
@@ -21,7 +21,7 @@
import {ComponentInstance} from "../../../componentsInstances/componentInstance";
import {CommonCINodeBase} from "../common-ci-node-base";
import {ImageCreatorService} from "app/directives/graphs-v2/image-creator/image-creator.service";
-import {ImagesUrl} from "app/utils";
+import {ImagesUrl, GraphUIObjects} from "app/utils";
import {AngularJSBridge} from "app/services";
export interface ICompositionCiNodeBase {
@@ -51,13 +51,27 @@ export abstract class CompositionCiNodeBase extends CommonCINodeBase implements
}
- public initImage(node:Cy.Collection):string {
-
+ public initUncertifiedImage(node:Cy.Collection, nodeMinSize:number):string {
+
+ let uncertifiedIconWidth:number = GraphUIObjects.HANDLE_SIZE;
+ let nodeWidth:number = node.data('imgWidth') || node.width();
+ let uncertifiedCanvasWidth: number = nodeWidth;
+
+ if (nodeWidth < nodeMinSize) { //uncertified icon will overlap too much of the node, need to expand canvas.
+ uncertifiedCanvasWidth = nodeWidth + uncertifiedIconWidth/2; //expand canvas so that only half of the icon overlaps with the node
+ }
+
this.imageCreator.getImageBase64(this.imagesPath + ImagesUrl.RESOURCE_ICONS + this.componentInstance.icon + '.png',
- this.imagesPath + ImagesUrl.RESOURCE_ICONS + 'uncertified.png')
+ this.imagesPath + ImagesUrl.RESOURCE_ICONS + 'uncertified.png', nodeWidth, uncertifiedCanvasWidth, uncertifiedIconWidth)
.then(imageBase64 => {
this.img = imageBase64;
- node.style({'background-image': this.img});
+ node.style({
+ 'background-image': this.img,
+ 'background-width': uncertifiedCanvasWidth,
+ 'background-height': uncertifiedCanvasWidth,
+ 'width': uncertifiedCanvasWidth,
+ 'height': uncertifiedCanvasWidth
+ });
});
return this.img;
diff --git a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-cp.ts b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-cp.ts
index 85534c78de..cded0ea104 100644
--- a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-cp.ts
+++ b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-cp.ts
@@ -22,7 +22,7 @@ import {CompositionCiNodeBase} from "./composition-ci-node-base";
import {ComponentInstance} from "../../../componentsInstances/componentInstance";
import {ImageCreatorService} from "../../../../directives/graphs-v2/image-creator/image-creator.service";
import {AngularJSBridge} from "../../../../services/angular-js-bridge-service";
-import {ImagesUrl} from "../../../../utils/constants";
+import { ImagesUrl, GraphUIObjects} from "../../../../utils/constants";
export class CompositionCiNodeCp extends CompositionCiNodeBase {
@@ -35,6 +35,7 @@ export class CompositionCiNodeCp extends CompositionCiNodeBase {
private initCp():void {
let sdcConfig = AngularJSBridge.getAngularConfig();
this.img = sdcConfig.imagesPath + ImagesUrl.RESOURCE_ICONS + this.componentInstance.icon + '.png';
+ this.imgWidth = GraphUIObjects.SMALL_RESOURCE_WIDTH;
this.type = "basic-small-node";
//if the cp from type cpEndPointInstances create with another template
if (sdcConfig.cpEndPointInstances.indexOf(this.componentInstance.icon) > -1) {
diff --git a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-service.ts b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-service.ts
index 3a9b8457fd..81ee61a14f 100644
--- a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-service.ts
+++ b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-service.ts
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-import {ImagesUrl} from "../../../../utils/constants";
+import { ImagesUrl, GraphUIObjects} from "../../../../utils/constants";
import {ComponentInstance, CompositionCiNodeBase} from "../../../../models";
import {ImageCreatorService} from "../../../../directives/graphs-v2/image-creator/image-creator.service";
export class CompositionCiNodeService extends CompositionCiNodeBase {
@@ -32,6 +32,7 @@ export class CompositionCiNodeService extends CompositionCiNodeBase {
private initService():void {
this.img = this.imagesPath + ImagesUrl.SERVICE_ICONS + this.componentInstance.icon + '.png';
+ this.imgWidth = GraphUIObjects.DEFAULT_RESOURCE_WIDTH;
this.classes = 'service-node'
if (!this.certified) {
this.classes = this.classes + ' not-certified';
diff --git a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vf.ts b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vf.ts
index 5d37db30fc..005804c11f 100644
--- a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vf.ts
+++ b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vf.ts
@@ -20,7 +20,7 @@
import {CompositionCiNodeBase} from "./composition-ci-node-base";
import {ComponentInstance} from "../../../componentsInstances/componentInstance";
import {ImageCreatorService} from "../../../../directives/graphs-v2/image-creator/image-creator.service";
-import {ImagesUrl} from "../../../../utils/constants";
+import { ImagesUrl, GraphUIObjects} from "../../../../utils/constants";
export class CompositionCiNodeVf extends CompositionCiNodeBase {
@@ -32,6 +32,7 @@ export class CompositionCiNodeVf extends CompositionCiNodeBase {
private initVf():void {
this.img = this.imagesPath + ImagesUrl.RESOURCE_ICONS + this.componentInstance.icon + '.png';
+ this.imgWidth = GraphUIObjects.DEFAULT_RESOURCE_WIDTH;
this.classes = 'vf-node';
if (!this.certified) {
this.classes = this.classes + ' not-certified';
diff --git a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vl.ts b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vl.ts
index db46e48ad7..bf52ec0408 100644
--- a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vl.ts
+++ b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vl.ts
@@ -20,7 +20,7 @@
import {ComponentInstance} from "../../../componentsInstances/componentInstance";
import {ImageCreatorService} from "../../../../directives/graphs-v2/image-creator/image-creator.service";
import {CompositionCiNodeBase} from "./composition-ci-node-base";
-import {ImagesUrl} from "../../../../utils/constants";
+import { ImagesUrl, GraphUIObjects} from "../../../../utils/constants";
export class CompositionCiNodeVl extends CompositionCiNodeBase {
private toolTipText:string;
@@ -47,6 +47,7 @@ export class CompositionCiNodeVl extends CompositionCiNodeBase {
}
}
this.img = this.imagesPath + ImagesUrl.RESOURCE_ICONS + 'vl.png';
+ this.imgWidth = GraphUIObjects.SMALL_RESOURCE_WIDTH;
this.classes = 'vl-node';
if (!this.certified) {