summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/utils
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2020-06-23 09:15:48 +0100
committerSébastien Determe <sebastien.determe@intl.att.com>2020-09-04 14:42:04 +0000
commit032525a375681fb18cc498d8daed9d73faa21ec3 (patch)
tree20cf4c17f406b8d30c29ce904fe1f19ea4a2c989 /catalog-ui/src/app/utils
parentc16117e08b97da93da61be841c22f5759cdadd37 (diff)
Support for Nested/Hierarchical Services
Change-Id: I478cf2e1f9cf96443a3e35bf22ac2c9d72bca8f1 Issue-ID: SDC-3145 Signed-off-by: MichaelMorris <michael.morris@est.tech>
Diffstat (limited to 'catalog-ui/src/app/utils')
-rw-r--r--catalog-ui/src/app/utils/component-factory.ts1
-rw-r--r--catalog-ui/src/app/utils/component-instance-factory.ts16
-rw-r--r--catalog-ui/src/app/utils/constants.ts1
3 files changed, 15 insertions, 3 deletions
diff --git a/catalog-ui/src/app/utils/component-factory.ts b/catalog-ui/src/app/utils/component-factory.ts
index d4e282fcb0..5fda9c8db2 100644
--- a/catalog-ui/src/app/utils/component-factory.ts
+++ b/catalog-ui/src/app/utils/component-factory.ts
@@ -148,6 +148,7 @@ export class ComponentFactory {
switch (componentType) {
case ComponentType.SERVICE_PROXY:
case ComponentType.SERVICE:
+ case ComponentType.SERVICE_SUBSTITUTION:
newComponent = new Service(this.ServiceService, this.$q);
break;
diff --git a/catalog-ui/src/app/utils/component-instance-factory.ts b/catalog-ui/src/app/utils/component-instance-factory.ts
index 03abd96a77..748bd39c9b 100644
--- a/catalog-ui/src/app/utils/component-instance-factory.ts
+++ b/catalog-ui/src/app/utils/component-instance-factory.ts
@@ -22,7 +22,7 @@
*/
'use strict';
import { ComponentType } from 'app/utils';
-import { Component, ComponentInstance, ResourceInstance, ServiceInstance, ServiceProxyInstance } from '../models';
+import { Component, ComponentInstance, ResourceInstance, ServiceInstance, ServiceSubstitutionInstance, ServiceProxyInstance } from '../models';
import { LeftPaletteComponent } from '../models/components/displayComponent';
export class ComponentInstanceFactory {
@@ -36,6 +36,9 @@ export class ComponentInstanceFactory {
case ComponentType.SERVICE_PROXY:
newComponentInstance = new ServiceProxyInstance(componentInstance);
break;
+ case ComponentType.SERVICE_SUBSTITUTION:
+ newComponentInstance = new ServiceSubstitutionInstance(componentInstance);
+ break;
default :
newComponentInstance = new ResourceInstance(componentInstance);
break;
@@ -52,6 +55,9 @@ export class ComponentInstanceFactory {
case ComponentType.SERVICE_PROXY:
newComponentInstance = new ServiceProxyInstance();
break;
+ case ComponentType.SERVICE_SUBSTITUTION:
+ newComponentInstance = new ServiceSubstitutionInstance();
+ break;
default :
newComponentInstance = new ResourceInstance();
break;
@@ -59,7 +65,7 @@ export class ComponentInstanceFactory {
return newComponentInstance;
}
- static createComponentInstanceFromComponent = (component: LeftPaletteComponent): ComponentInstance => {
+ static createComponentInstanceFromComponent = (component: LeftPaletteComponent, useServiceSubstitutionForNestedServices?: boolean): ComponentInstance => {
const newComponentInstance: ComponentInstance = ComponentInstanceFactory.createEmptyComponentInstance(component.componentType);
newComponentInstance.uniqueId = component.uniqueId + (new Date()).getTime();
newComponentInstance.posX = 0;
@@ -78,7 +84,11 @@ export class ComponentInstanceFactory {
return component.componentSubType;
} else {
if (component.componentType === ComponentType.SERVICE) {
- return ComponentType.SERVICE_PROXY;
+ if (useServiceSubstitutionForNestedServices){
+ return ComponentType.SERVICE_SUBSTITUTION;
+ } else {
+ return ComponentType.SERVICE_PROXY;
+ }
} else {
return component.resourceType;
}
diff --git a/catalog-ui/src/app/utils/constants.ts b/catalog-ui/src/app/utils/constants.ts
index a4bceb5ded..c7947748c8 100644
--- a/catalog-ui/src/app/utils/constants.ts
+++ b/catalog-ui/src/app/utils/constants.ts
@@ -39,6 +39,7 @@ export class ComponentType {
static RESOURCE = 'RESOURCE';
static RESOURCE_INSTANCE = 'RESOURCE_INSTANCE';
static SERVICE_PROXY = 'ServiceProxy'
+ static SERVICE_SUBSTITUTION = 'ServiceSubstitution'
}
export class ServerTypeUrl {