summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/models/graph/nodes
diff options
context:
space:
mode:
authorTal Gitelman <tg851x@intl.att.com>2017-12-10 18:55:03 +0200
committerTal Gitelman <tg851x@intl.att.com>2017-12-10 19:33:38 +0200
commit51d50f0ef642e0f996a1c8b8d2ef4838bdfec892 (patch)
tree3ac236a864d74d19b0f5c9020891a7a7e5c31b44 /catalog-ui/src/app/models/graph/nodes
parentb5cc2e0695f195716d6ccdc65e73807a6632ec70 (diff)
Final commit to master merge from
Change-Id: Ib464f9a8828437c86fe6def8af238aaf83473507 Issue-ID: SDC-714 Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app/models/graph/nodes')
-rw-r--r--catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-base.ts7
-rw-r--r--catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-configuration.ts39
-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-proxy.ts42
-rw-r--r--catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-service.ts2
-rw-r--r--catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe-cp.ts2
-rw-r--r--catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe.ts2
-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-vfc.ts3
-rw-r--r--catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vl.ts1
-rw-r--r--catalog-ui/src/app/models/graph/nodes/modules-graph-nodes/module-node-base.ts3
-rw-r--r--catalog-ui/src/app/models/graph/nodes/nodes-factory.ts10
12 files changed, 107 insertions, 10 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 681cebc8d2..3b634b1f6e 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
@@ -48,7 +48,6 @@ export abstract class CompositionCiNodeBase extends CommonCINodeBase implements
this.isGroup = false;
this.isUcpePart = false;
this.isInsideGroup = false;
-
}
public initUncertifiedImage(node:Cy.Collection, nodeMinSize:number):string {
@@ -61,8 +60,10 @@ export abstract class CompositionCiNodeBase extends CommonCINodeBase implements
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', nodeWidth, uncertifiedCanvasWidth, uncertifiedIconWidth)
+
+
+ this.imageCreator.getImageBase64(this.imagesPath + this.componentInstance.icon + '.png',
+ this.imagesPath + 'uncertified.png', nodeWidth, uncertifiedCanvasWidth, uncertifiedIconWidth)
.then(imageBase64 => {
this.img = imageBase64;
node.style({
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
new file mode 100644
index 0000000000..1182f5e664
--- /dev/null
+++ b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-configuration.ts
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+import { ImagesUrl, GraphUIObjects} from "../../../../utils/constants";
+import {ComponentInstance, CompositionCiNodeBase} from "../../../../models";
+import {ImageCreatorService} from "../../../../directives/graphs-v2/image-creator/image-creator.service";
+export class CompositionCiNodeConfiguration extends CompositionCiNodeBase {
+
+ constructor(instance:ComponentInstance,
+ imageCreator:ImageCreatorService) {
+ super(instance, imageCreator);
+ this.initConfiguration();
+ }
+
+ private initConfiguration():void {
+ this.imagesPath = this.imagesPath + ImagesUrl.RESOURCE_ICONS;
+ this.img = this.imagesPath + this.componentInstance.icon + '.png';
+ this.imgWidth = GraphUIObjects.SMALL_RESOURCE_WIDTH;
+ this.type = "basic-small-node";
+ this.classes = 'configuration-node';
+ }
+}
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 cded0ea104..3bd57695ec 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
@@ -34,7 +34,8 @@ export class CompositionCiNodeCp extends CompositionCiNodeBase {
private initCp():void {
let sdcConfig = AngularJSBridge.getAngularConfig();
- this.img = sdcConfig.imagesPath + ImagesUrl.RESOURCE_ICONS + this.componentInstance.icon + '.png';
+ this.imagesPath = this.imagesPath + ImagesUrl.RESOURCE_ICONS;
+ this.img = this.imagesPath + 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
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
new file mode 100644
index 0000000000..b993490043
--- /dev/null
+++ b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-service-proxy.ts
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+import { ImagesUrl, GraphUIObjects} from "../../../../utils/constants";
+import {ComponentInstance, CompositionCiNodeBase} from "../../../../models";
+import {ImageCreatorService} from "../../../../directives/graphs-v2/image-creator/image-creator.service";
+export class CompositionCiNodeServiceProxy extends CompositionCiNodeBase {
+
+ constructor(instance:ComponentInstance,
+ imageCreator:ImageCreatorService) {
+ super(instance, imageCreator);
+ this.initService();
+ }
+
+ private initService():void {
+ this.imagesPath = this.imagesPath + ImagesUrl.SERVICE_PROXY_ICONS;
+ this.img = this.imagesPath + 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-service.ts b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-service.ts
index 81ee61a14f..b4e6ac354a 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
@@ -30,7 +30,7 @@ export class CompositionCiNodeService extends CompositionCiNodeBase {
}
private initService():void {
-
+ this.imagesPath = this.imagesPath + ImagesUrl.SERVICE_ICONS;
this.img = this.imagesPath + ImagesUrl.SERVICE_ICONS + this.componentInstance.icon + '.png';
this.imgWidth = GraphUIObjects.DEFAULT_RESOURCE_WIDTH;
this.classes = 'service-node'
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 5013e52457..a79b183db4 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
@@ -20,6 +20,7 @@
import {CompositionCiNodeCp, ComponentInstance} from "./../../../../models";
import {ImageCreatorService} from "../../../../directives/graphs-v2/image-creator/image-creator.service";
+import { ImagesUrl} from "../../../../utils/constants";
export class CompositionCiNodeUcpeCp extends CompositionCiNodeCp {
@@ -31,5 +32,6 @@ export class CompositionCiNodeUcpeCp extends CompositionCiNodeCp {
this.parent = instance.uniqueId;
this.type = 'ucpe-cp-node'; //the type is for the handle (plus icon) extension
this.isDraggable = false;
+ this.imagesPath = this.imagesPath + ImagesUrl.RESOURCE_ICONS;
}
}
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 b8f844cba8..3dd6a4e238 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
@@ -21,6 +21,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";
export class NodeUcpe extends CompositionCiNodeBase {
constructor(instance:ComponentInstance,
@@ -36,6 +37,7 @@ export class NodeUcpe extends CompositionCiNodeBase {
this.classes = 'ucpe-node';
this.type = 'ucpe-node';
this.allowConnection = false;
+ this.imagesPath = this.imagesPath + ImagesUrl.RESOURCE_ICONS;
if (!this.certified) {
this.classes = this.classes + ' not-certified-ucpe';
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 005804c11f..b5ad57a5c3 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
@@ -31,7 +31,8 @@ export class CompositionCiNodeVf extends CompositionCiNodeBase {
}
private initVf():void {
- this.img = this.imagesPath + ImagesUrl.RESOURCE_ICONS + this.componentInstance.icon + '.png';
+ this.imagesPath = this.imagesPath + ImagesUrl.RESOURCE_ICONS;
+ this.img = this.imagesPath + this.componentInstance.icon + '.png';
this.imgWidth = GraphUIObjects.DEFAULT_RESOURCE_WIDTH;
this.classes = 'vf-node';
if (!this.certified) {
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 c8ae004003..5f07986d5c 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
@@ -29,6 +29,7 @@ export class CompositionCiNodeVfc extends CompositionCiNodeBase {
}
private initVfc():void {
- this.img = this.imagesPath + ImagesUrl.RESOURCE_ICONS + this.componentInstance.icon + '.png';
+ this.imagesPath = this.imagesPath + ImagesUrl.RESOURCE_ICONS;
+ this.img = this.imagesPath + this.componentInstance.icon + '.png';
}
}
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 bf52ec0408..29cd9256d9 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
@@ -48,6 +48,7 @@ export class CompositionCiNodeVl extends CompositionCiNodeBase {
}
this.img = this.imagesPath + ImagesUrl.RESOURCE_ICONS + 'vl.png';
this.imgWidth = GraphUIObjects.SMALL_RESOURCE_WIDTH;
+ this.imagesPath = this.imagesPath + ImagesUrl.RESOURCE_ICONS;
this.classes = 'vl-node';
if (!this.certified) {
diff --git a/catalog-ui/src/app/models/graph/nodes/modules-graph-nodes/module-node-base.ts b/catalog-ui/src/app/models/graph/nodes/modules-graph-nodes/module-node-base.ts
index ccc8ed4afa..4e9fb0b0ab 100644
--- a/catalog-ui/src/app/models/graph/nodes/modules-graph-nodes/module-node-base.ts
+++ b/catalog-ui/src/app/models/graph/nodes/modules-graph-nodes/module-node-base.ts
@@ -24,6 +24,7 @@
import {ImagesUrl} from "../../../../utils/constants";
import {Module} from "../../../modules/base-module";
import {CommonNodeBase} from "../base-common-node";
+import {AngularJSBridge} from "../../../../services/angular-js-bridge-service";
export interface IModuleNodeBase {
}
@@ -44,7 +45,7 @@ export class ModuleNodeBase extends CommonNodeBase implements IModuleNodeBase {
this.name = this.module.name;
this.displayName = this.module.name;
this.isGroup = true;
- this.img = ImagesUrl.MODULE_ICON;
+ this.img = AngularJSBridge.getAngularConfig().imagesPath + ImagesUrl.MODULE_ICON;
this.classes = "module-node";
}
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 c7f8eaa126..245f2e10d9 100644
--- a/catalog-ui/src/app/models/graph/nodes/nodes-factory.ts
+++ b/catalog-ui/src/app/models/graph/nodes/nodes-factory.ts
@@ -19,8 +19,8 @@
*/
'use strict';
-import {CompositionCiNodeUcpeCp, Module, ModuleNodeBase, CompositionCiNodeVf, CompositionCiNodeVl, CompositionCiNodeCp,
- NodeUcpe, CompositionCiNodeService, CompositionCiNodeBase, ComponentInstance} from "./../../../models";
+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";
@@ -37,12 +37,18 @@ export class NodesFactory {
if (instance.originType === ComponentType.SERVICE) {
return new CompositionCiNodeService(instance, this.imageCreator);
}
+ if (instance.originType === ComponentType.SERVICE_PROXY) {
+ return new CompositionCiNodeServiceProxy(instance, this.imageCreator);
+ }
if (instance.originType === ResourceType.CP) {
return new CompositionCiNodeCp(instance, this.imageCreator);
}
if (instance.originType === ResourceType.VL) {
return new CompositionCiNodeVl(instance, this.imageCreator);
}
+ if (instance.originType === ResourceType.CONFIGURATION) {
+ return new CompositionCiNodeConfiguration(instance, this.imageCreator);
+ }
return new CompositionCiNodeVf(instance, this.imageCreator);
};