diff options
author | ys9693 <ys9693@att.com> | 2020-01-19 13:50:02 +0200 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2020-01-22 12:33:31 +0000 |
commit | 16a9fce0e104a38371a9e5a567ec611ae3fc7f33 (patch) | |
tree | 03a2aff3060ddb5bc26a90115805a04becbaffc9 /catalog-ui/src/app/models/graph/nodes | |
parent | aa83a2da4f911c3ac89318b8e9e8403b072942e1 (diff) |
Catalog alignment
Issue-ID: SDC-2724
Signed-off-by: ys9693 <ys9693@att.com>
Change-Id: I52b4aacb58cbd432ca0e1ff7ff1f7dd52099c6fe
Diffstat (limited to 'catalog-ui/src/app/models/graph/nodes')
11 files changed, 29 insertions, 29 deletions
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 51a0c7b3e5..69605507e7 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 @@ -20,9 +20,11 @@ import {ComponentInstance} from "../../../componentsInstances/componentInstance"; import {CommonCINodeBase} from "../common-ci-node-base"; -import {ICanvasImage, ImageCreatorService} from "app/directives/graphs-v2/image-creator/image-creator.service"; import {ImagesUrl, GraphUIObjects} from "app/utils"; import {AngularJSBridge} from "app/services"; +import {ResourceNamePipe} from "app/ng2/pipes/resource-name.pipe"; +import {ComponentInstanceNodesStyle} from "app/ng2/pages/composition/graph/common/style/component-instances-nodes-style"; +import {ImageCreatorService, ICanvasImage} from "app/ng2/pages/composition/graph/common/image-creator.service"; export interface ICompositionCiNodeBase { @@ -48,14 +50,16 @@ export abstract class CompositionCiNodeBase extends CommonCINodeBase implements this.isUcpePart = false; this.isInsideGroup = false; } - - + + protected enhanceImage(node:Cy.Collection, nodeMinSize:number, imgUrl: string):string { + let infoIconWidth:number = GraphUIObjects.HANDLE_SIZE; let nodeWidth:number = node.data('imgWidth') || node.width(); + // let uncertifiedCanvasWidth: number = nodeWidth; let infoCanvasWidth: number = nodeWidth; - if (nodeWidth < nodeMinSize) { //info icon will overlap too much of the node, need to expand canvas. + if (nodeWidth < nodeMinSize) { //uncertified icon will overlap too much of the node, need to expand canvas. infoCanvasWidth = nodeWidth + infoIconWidth/2; //expand canvas so that only half of the icon overlaps with the node } @@ -66,13 +70,14 @@ export abstract class CompositionCiNodeBase extends CommonCINodeBase implements { src: imgUrl, x: 0, y: 0, width: infoIconWidth, height: infoIconWidth} ]; + //Create the image and update the node background styles this.imageCreator.getMultiLayerBase64Image(canvasImages, infoCanvasWidth, infoCanvasWidth).then(img => this.updateNodeStyles(node,infoCanvasWidth,img)); return this.img; // Return the referance to the image (in Base64 format) } - - public setArchivedImageBgStyle(node:Cy.Collection, nodeMinSize:number):string { + + public setArchivedImageBgStyle(node:Cy.Collection, nodeMinSize:number):string { let archivedIconWidth:number = GraphUIObjects.HANDLE_SIZE; let nodeWidth:number = node.data('imgWidth') || node.width(); let archivedCanvasWidth: number = nodeWidth; @@ -95,13 +100,12 @@ export abstract class CompositionCiNodeBase extends CommonCINodeBase implements } protected getDisplayName():string { - let graphResourceName = AngularJSBridge.getFilter('graphResourceName'); - let resourceName = AngularJSBridge.getFilter('resourceName'); - return graphResourceName(resourceName(this.componentInstance.name)); + let resourceName = ResourceNamePipe.getDisplayName(this.componentInstance.name); + return ComponentInstanceNodesStyle.getGraphDisplayName(resourceName); } //TODO:: move to Base class ??? - private updateNodeStyles(node,canvasWidth,imageBase64){ + private updateNodeStyles(node,canvasWidth,imageBase64){ this.img = imageBase64; node.style({ 'background-image': this.img, @@ -109,7 +113,7 @@ export abstract class CompositionCiNodeBase extends CommonCINodeBase implements 'background-height': canvasWidth, 'background-position-x':0, 'background-position-y':0 - }); + }); } } diff --git a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-configuration.ts b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-configuration.ts index 78bcc17186..cac48df632 100644 --- a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-configuration.ts +++ b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-configuration.ts @@ -20,7 +20,7 @@ import { ImagesUrl, GraphUIObjects} from "../../../../utils/constants"; import {ComponentInstance, CompositionCiNodeBase} from "../../../../models"; -import {ImageCreatorService} from "../../../../directives/graphs-v2/image-creator/image-creator.service"; +import {ImageCreatorService} from "app/ng2/pages/composition/graph/common/image-creator.service"; export class CompositionCiNodeConfiguration extends CompositionCiNodeBase { constructor(instance:ComponentInstance, 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 05a6d790ab..9b6a4ed0aa 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 @@ -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 {ImageCreatorService} from "app/ng2/pages/composition/graph/common/image-creator.service"; import {AngularJSBridge} from "../../../../services/angular-js-bridge-service"; import { ImagesUrl, GraphUIObjects} from "../../../../utils/constants"; diff --git a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-service-proxy.ts b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-service-proxy.ts index 5ef3a733b2..a46e0c4d32 100644 --- a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-service-proxy.ts +++ b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-service-proxy.ts @@ -18,9 +18,9 @@ * ============LICENSE_END========================================================= */ -import {ComponentInstance, CompositionCiNodeBase} from "app/models"; -import {ImageCreatorService} from "app/directives/graphs-v2/image-creator/image-creator.service"; -import {ImagesUrl, GraphUIObjects} from "app/utils"; +import { ImagesUrl, GraphUIObjects} from "../../../../utils/constants"; +import {ComponentInstance, CompositionCiNodeBase} from "../../../../models"; +import {ImageCreatorService} from "app/ng2/pages/composition/graph/common/image-creator.service"; export class CompositionCiNodeServiceProxy extends CompositionCiNodeBase { private isDependent: boolean; private originalImg: string; @@ -50,7 +50,6 @@ export class CompositionCiNodeServiceProxy extends CompositionCiNodeBase { } } - public initUncertifiedDependentImage(node:Cy.Collection, nodeMinSize:number):string { return this.enhanceImage(node, nodeMinSize, this.imagesPath + 'uncertified_dependent.png'); } @@ -58,5 +57,4 @@ export class CompositionCiNodeServiceProxy extends CompositionCiNodeBase { public initDependentImage(node:Cy.Collection, nodeMinSize:number):string { return this.enhanceImage(node, nodeMinSize, this.imagesPath + 'dependent.png'); } - } 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 bf8facf002..5b6281560c 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 @@ -20,7 +20,7 @@ import { ImagesUrl, GraphUIObjects} from "../../../../utils/constants"; import {ComponentInstance, CompositionCiNodeBase} from "../../../../models"; -import {ImageCreatorService} from "../../../../directives/graphs-v2/image-creator/image-creator.service"; +import {ImageCreatorService} from "app/ng2/pages/composition/graph/common/image-creator.service"; export class CompositionCiNodeService extends CompositionCiNodeBase { constructor(instance:ComponentInstance, diff --git a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe-cp.ts b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe-cp.ts index a79b183db4..f769e69ec1 100644 --- a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe-cp.ts +++ b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe-cp.ts @@ -19,7 +19,7 @@ */ import {CompositionCiNodeCp, ComponentInstance} from "./../../../../models"; -import {ImageCreatorService} from "../../../../directives/graphs-v2/image-creator/image-creator.service"; +import {ImageCreatorService} from "app/ng2/pages/composition/graph/common/image-creator.service"; import { ImagesUrl} from "../../../../utils/constants"; export class CompositionCiNodeUcpeCp extends CompositionCiNodeCp { diff --git a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe.ts b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe.ts index d4172c0eaa..242e96857d 100644 --- a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe.ts +++ b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe.ts @@ -19,7 +19,7 @@ */ import {ComponentInstance} from "../../../componentsInstances/componentInstance"; -import {ImageCreatorService} from "../../../../directives/graphs-v2/image-creator/image-creator.service"; +import {ImageCreatorService} from "app/ng2/pages/composition/graph/common/image-creator.service"; import {CompositionCiNodeBase} from "./composition-ci-node-base"; import { ImagesUrl} from "../../../../utils/constants"; 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 4aff85e6c3..c5d2d9e34b 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 @@ -19,7 +19,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 {ImageCreatorService} from "app/ng2/pages/composition/graph/common/image-creator.service"; import { ImagesUrl, GraphUIObjects} from "../../../../utils/constants"; export class CompositionCiNodeVf extends CompositionCiNodeBase { diff --git a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vfc.ts b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vfc.ts index 5f07986d5c..4c16661548 100644 --- a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vfc.ts +++ b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vfc.ts @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ import {CompositionCiNodeBase} from "./composition-ci-node-base"; -import {ImageCreatorService} from "../../../../directives/graphs-v2/image-creator/image-creator.service"; +import {ImageCreatorService} from "app/ng2/pages/composition/graph/common/image-creator.service"; import {ComponentInstance} from "../../../componentsInstances/componentInstance"; import {ImagesUrl} from "../../../../utils/constants"; 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 a440f09156..2407593665 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 @@ -19,7 +19,7 @@ */ import * as _ from "lodash"; import {ComponentInstance} from "../../../componentsInstances/componentInstance"; -import {ImageCreatorService} from "../../../../directives/graphs-v2/image-creator/image-creator.service"; +import {ImageCreatorService} from "app/ng2/pages/composition/graph/common/image-creator.service"; import {CompositionCiNodeBase} from "./composition-ci-node-base"; import { ImagesUrl, GraphUIObjects} from "../../../../utils/constants"; diff --git a/catalog-ui/src/app/models/graph/nodes/nodes-factory.ts b/catalog-ui/src/app/models/graph/nodes/nodes-factory.ts index 245f2e10d9..bcd2f7e111 100644 --- a/catalog-ui/src/app/models/graph/nodes/nodes-factory.ts +++ b/catalog-ui/src/app/models/graph/nodes/nodes-factory.ts @@ -22,8 +22,10 @@ import {CompositionCiNodeUcpeCp, Module, ModuleNodeBase, CompositionCiNodeVf, CompositionCiNodeVl, CompositionCiNodeCp, CompositionCiNodeConfiguration, NodeUcpe, CompositionCiNodeService,CompositionCiNodeServiceProxy, CompositionCiNodeBase, ComponentInstance} from "./../../../models"; import {ComponentType, ResourceType} from "../../../utils/constants"; -import {ImageCreatorService} from "../../../directives/graphs-v2/image-creator/image-creator.service"; +import {ImageCreatorService} from "app/ng2/pages/composition/graph/common/image-creator.service"; +import {Injectable} from "@angular/core"; +@Injectable() export class NodesFactory { constructor(private imageCreator:ImageCreatorService) { @@ -54,7 +56,6 @@ export class NodesFactory { }; public createModuleNode = (module:Module):ModuleNodeBase => { - return new ModuleNodeBase(module); }; @@ -64,6 +65,3 @@ export class NodesFactory { } } -NodesFactory.$inject = [ - 'ImageCreatorService' -]; |