summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row
diff options
context:
space:
mode:
authorsiddharth0905 <siddharth.singh4@amdocs.com>2018-11-22 13:37:31 +0530
committersiddharth0905 <siddharth.singh4@amdocs.com>2018-11-23 12:48:21 +0530
commitb734ea21ac7be393c59cf9976f0e5ddeaf27d568 (patch)
treedde5d205c378ac748bcecdf7f17f5a41567156fe /catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row
parentabbd5cf62a0bdd6a22b9bea0cf589e42da0be229 (diff)
Service Workflow changes
Service workflow change with few bug fixes Change-Id: Ice2376565bf46fb8d86fb6062654ec54bb2daa43 Issue-ID: SDC-1937 Signed-off-by: siddharth0905 <siddharth.singh4@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row')
-rw-r--r--catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.html6
-rw-r--r--catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.less2
-rw-r--r--catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.ts58
3 files changed, 56 insertions, 10 deletions
diff --git a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.html b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.html
index 94d2fce1ea..9a5c101e87 100644
--- a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.html
+++ b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.html
@@ -1,5 +1,5 @@
<!--
- ~ Copyright © 2016-2018 European Support Limited
+ ~ Copyright � 2016-2018 European Support Limited
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -38,14 +38,14 @@
<div class="cell field-property" *ngIf="isInputParam">
<ui-element-dropdown
- *ngIf="filteredInputProps.length > 0 || !isAssociateWorkflow"
+ *ngIf="filteredInputProps.length || !isAssociateWorkflow"
data-tests-id="paramProperty"
[values]="filteredInputProps"
[(value)]="param.property"
[readonly]="readonly">
</ui-element-dropdown>
<span
- *ngIf="filteredInputProps.length == 0 && isAssociateWorkflow"
+ *ngIf="!filteredInputProps.length && isAssociateWorkflow"
class="no-properties-error">
No available properties of this type.
</span>
diff --git a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.less b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.less
index 28932eb90f..2c2625d778 100644
--- a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.less
+++ b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.less
@@ -38,7 +38,7 @@
}
.no-properties-error {
- color: red;
+ color: @func_color_q;
font-style: italic;
}
}
diff --git a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.ts b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.ts
index 8844cf65bb..de795eb8f4 100644
--- a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.ts
+++ b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.ts
@@ -1,6 +1,6 @@
import {Component, Input} from '@angular/core';
import {DataTypeService} from "app/ng2/services/data-type.service";
-import {OperationParameter} from 'app/models';
+import {OperationParameter, InputBEModel} from 'app/models';
import {DropdownValue} from "app/ng2/components/ui/form-components/dropdown/ui-element-dropdown.component";
@Component({
@@ -11,8 +11,7 @@ import {DropdownValue} from "app/ng2/components/ui/form-components/dropdown/ui-e
export class ParamRowComponent {
@Input() param: OperationParameter;
- @Input() inputProps: Array<DropdownValue>;
- @Input() propTypes: { [key: string]: string };
+ @Input() inputProps: Array<InputBEModel>;
@Input() onRemoveParam: Function;
@Input() isAssociateWorkflow: boolean;
@Input() readonly: boolean;
@@ -21,14 +20,61 @@ export class ParamRowComponent {
propTypeEnum: Array<String> = [];
filteredInputProps: Array<DropdownValue> = [];
+ constructor(private dataTypeService: DataTypeService) {}
+
ngOnInit() {
- this.propTypeEnum = _.uniq(_.toArray(this.propTypes));
+ this.propTypeEnum = _.uniq(
+ _.map(
+ this.getPrimitiveSubtypes(),
+ prop => prop.type
+ )
+ );
+ console.log(this.dataTypeService.getAllDataTypes());
this.onChangeType();
}
onChangeType() {
- this.filteredInputProps = _.filter(this.inputProps, prop => {
- return this.propTypes[prop.value] === this.param.type;
+ this.filteredInputProps = _.map(
+ _.filter(
+ this.getPrimitiveSubtypes(),
+ prop => prop.type === this.param.type
+ ),
+ prop => new DropdownValue(prop.uniqueId, prop.name)
+ );
+ }
+
+ getPrimitiveSubtypes(): Array<InputBEModel> {
+ const flattenedProps: Array<any> = [];
+ const dataTypes = this.dataTypeService.getAllDataTypes();
+ _.forEach(this.inputProps, prop => {
+ const type = _.find(
+ _.toArray(dataTypes),
+ (type: any) => type.name === prop.type
+ );
+ if (!type.properties) {
+ flattenedProps.push(prop);
+ } else {
+ _.forEach(type.properties, subType => {
+ if (this.isTypePrimitive(subType.type)) {
+ flattenedProps.push({
+ type: subType.type,
+ name: `${prop.name}.${subType.name}`,
+ uniqueId: `${prop.uniqueId}.${subType.name}`
+ });
+ }
+ });
+ }
});
+
+ return flattenedProps;
+ }
+
+ isTypePrimitive(type): boolean {
+ return (
+ type === 'string' ||
+ type === 'integer' ||
+ type === 'float' ||
+ type === 'boolean'
+ );
}
}