aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/utils
diff options
context:
space:
mode:
authorArielk <Ariel.Kenan@amdocs.com>2018-04-16 15:37:39 +0300
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-05-01 03:38:57 +0000
commit802bd2af2e3c6ba92eb1ce0180a13b11018f6695 (patch)
tree0906a846aa2c3edc9f2067364ed812bdead9f939 /catalog-ui/src/app/utils
parentd0f6cb3ef9600846358a0e7f849759be6f9d917e (diff)
Interface Operation tab and screens
Change-Id: If03234c783d6ce16fdd0945987ada83b6285f97f Issue-ID: SDC-1060 Signed-off-by: Arielk <Ariel.Kenan@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app/utils')
-rw-r--r--catalog-ui/src/app/utils/common-utils.ts34
-rw-r--r--catalog-ui/src/app/utils/constants.ts3
2 files changed, 35 insertions, 2 deletions
diff --git a/catalog-ui/src/app/utils/common-utils.ts b/catalog-ui/src/app/utils/common-utils.ts
index 97177949ee..1868550225 100644
--- a/catalog-ui/src/app/utils/common-utils.ts
+++ b/catalog-ui/src/app/utils/common-utils.ts
@@ -19,7 +19,7 @@
*/
import * as _ from "lodash";
-import {Module, AttributeModel, ResourceInstance, PropertyModel, InputFEModel} from "../models";
+import {Module, AttributeModel, ResourceInstance, PropertyModel, InputFEModel, OperationModel} from "../models";
import {ComponentInstanceFactory} from "./component-instance-factory";
import {InputBEModel, PropertyBEModel, RelationshipModel} from "app/models";
import { PolicyInstance } from "app/models/graph/zones/policy-instance";
@@ -126,5 +126,37 @@ export class CommonUtils {
return policies;
}
+
+ static initInterfaceOperations(interfaces: any): Array<OperationModel> {
+
+ return _.reduce(interfaces, (acc, interf: any) => {
+
+ return acc.concat(
+ _.map(interf.operations,
+ ({description, name, uniqueId, inputs, outputs}) => {
+ const operation = new OperationModel({
+ description,
+ operationType: name,
+ uniqueId
+ });
+ if (inputs) {
+ const inputParams = _.map(inputs.listToscaDataDefinition, (input:any) => {
+ return {paramName: input.name, paramId: input.inputId};
+ });
+ operation.createInputParamsList(inputParams);
+ }
+ if (outputs) {
+ const outputParams = _.map(outputs.listToscaDataDefinition, (output:any) => {
+ return {paramName: output.name, paramId: output.outputId};
+ });
+ operation.createOutputParamsList(outputParams);
+ }
+ return operation;
+ }
+ )
+ );
+
+ }, []);
+ }
}
diff --git a/catalog-ui/src/app/utils/constants.ts b/catalog-ui/src/app/utils/constants.ts
index c8603424bb..9665999dcf 100644
--- a/catalog-ui/src/app/utils/constants.ts
+++ b/catalog-ui/src/app/utils/constants.ts
@@ -235,6 +235,7 @@ export class States {
public static WORKSPACE_INFORMATION_ARTIFACTS = 'workspace.information_artifacts';
public static WORKSPACE_TOSCA_ARTIFACTS = 'workspace.tosca_artifacts';
public static WORKSPACE_COMPOSITION = 'workspace.composition';
+ public static WORKSPACE_INTERFACE_OPERATION = 'workspace.interface_operation';
public static WORKSPACE_NETWORK_CALL_FLOW = 'workspace.network_call_flow';
public static WORKSPACE_MANAGEMENT_WORKFLOW = 'workspace.management_workflow';
public static WORKSPACE_DEPLOYMENT = 'workspace.deployment';
@@ -318,7 +319,7 @@ export class COMPONENT_FIELDS {
static COMPONENT_TOSCA_ARTIFACTS = "toscaArtifacts";
static COMPONENT_POLICIES = "policies";
static COMPONENT_GROUPS = "groups";
-
+ static COMPONENT_INTERFACE_OPERATIONS = "interfaces";
}
export class SERVICE_FIELDS {