summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/composition
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2021-03-25 12:40:50 +0000
committerChristophe Closset <christophe.closset@intl.att.com>2021-03-25 16:41:14 +0000
commita45577d6d9e5a67ea8313b760b5180c974fc63d7 (patch)
treea8a5deca77fb26083ad85f586546c304d77f1a85 /catalog-ui/src/app/ng2/pages/composition
parentde9224b1ae01755c7cc46e4bdd1a50c1bc08936e (diff)
Fix CRITICAL BUGs
Change-Id: I2924e68c03a6b640644fd0360ca23f29f9bb5f5b Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-3529
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/composition')
-rw-r--r--catalog-ui/src/app/ng2/pages/composition/capabilities-filter-properties-editor/capabilities-filter-properties-editor.component.ts40
1 files changed, 21 insertions, 19 deletions
diff --git a/catalog-ui/src/app/ng2/pages/composition/capabilities-filter-properties-editor/capabilities-filter-properties-editor.component.ts b/catalog-ui/src/app/ng2/pages/composition/capabilities-filter-properties-editor/capabilities-filter-properties-editor.component.ts
index 2cd4f4d1c7..3781a5163d 100644
--- a/catalog-ui/src/app/ng2/pages/composition/capabilities-filter-properties-editor/capabilities-filter-properties-editor.component.ts
+++ b/catalog-ui/src/app/ng2/pages/composition/capabilities-filter-properties-editor/capabilities-filter-properties-editor.component.ts
@@ -19,24 +19,23 @@
* ============LICENSE_END=========================================================
*/
-import { Component } from '@angular/core';
+import {Component} from '@angular/core';
import {InputBEModel, PropertyBEModel, PropertyModel} from 'app/models';
-import { OPERATOR_TYPES } from 'app/ng2/components/logic/service-dependencies/service-dependencies.component';
-import { DropdownValue } from 'app/ng2/components/ui/form-components/dropdown/ui-element-dropdown.component';
-import { ServiceServiceNg2 } from 'app/ng2/services/component-services/service.service';
-import { PROPERTY_DATA } from 'app/utils';
-import { ServiceInstanceObject } from '../../../../models/service-instance-properties-and-interfaces';
+import {OPERATOR_TYPES} from 'app/ng2/components/logic/service-dependencies/service-dependencies.component';
+import {DropdownValue} from 'app/ng2/components/ui/form-components/dropdown/ui-element-dropdown.component';
+import {ServiceServiceNg2} from 'app/ng2/services/component-services/service.service';
+import {PROPERTY_DATA} from 'app/utils';
+import {ServiceInstanceObject} from '../../../../models/service-instance-properties-and-interfaces';
import {CapabilitiesConstraintObjectUI} from "../../../components/logic/capabilities-constraint/capabilities-constraint.component";
export class UIDropDownSourceTypesElement extends DropdownValue {
options: any[];
assignedLabel: string;
type: string;
+
constructor(input?: any) {
+ super(input ? input.value || '' : "", input ? input.label || '' : "");
if (input) {
- const value = input.value || '';
- const label = input.label || '';
- super(value, label);
this.options = input.options;
this.assignedLabel = input.assignedLabel;
this.type = input.type;
@@ -52,9 +51,6 @@ export class UIDropDownSourceTypesElement extends DropdownValue {
})
export class CapabilitiesFilterPropertiesEditorComponent {
- constructor() {
- }
-
input: {
serviceRuleIndex: number,
serviceRules: CapabilitiesConstraintObjectUI[],
@@ -100,7 +96,8 @@ export class CapabilitiesFilterPropertiesEditorComponent {
capabilityName: this.SOURCE_TYPES.CAPABILITY_NAME.value,
sourceName: this.SOURCE_TYPES.STATIC.value,
sourceType: this.SOURCE_TYPES.STATIC.value, value: '',
- constraintOperator: OPERATOR_TYPES.EQUAL});
+ constraintOperator: OPERATOR_TYPES.EQUAL
+ });
this.currentServiceName = this.input.currentServiceName;
this.operatorTypes = this.input.operatorTypes;
@@ -111,8 +108,13 @@ export class CapabilitiesFilterPropertiesEditorComponent {
}
initSourceTypes() {
- this.sourceTypes.push({label: this.SOURCE_TYPES.STATIC.label, value: this.SOURCE_TYPES.STATIC.value,
- options: [], assignedLabel: this.SOURCE_TYPES.STATIC.label, type: this.SOURCE_TYPES.STATIC.value});
+ this.sourceTypes.push({
+ label: this.SOURCE_TYPES.STATIC.label,
+ value: this.SOURCE_TYPES.STATIC.value,
+ options: [],
+ assignedLabel: this.SOURCE_TYPES.STATIC.label,
+ type: this.SOURCE_TYPES.STATIC.value
+ });
this.sourceTypes.push({
label: this.input.compositeServiceName,
value: this.input.compositeServiceName,
@@ -135,7 +137,7 @@ export class CapabilitiesFilterPropertiesEditorComponent {
if (!this.currentRule.sourceName && this.currentRule.sourceType === this.SOURCE_TYPES.STATIC.value) {
this.currentRule.sourceName = this.SOURCE_TYPES.STATIC.value;
}
- if (!this.input.componentInstanceCapabilitiesMap){
+ if (!this.input.componentInstanceCapabilitiesMap) {
this.selectedCapabilitiesPropertyObject = Array.from(this.input.componentInstanceCapabilitiesMap
.get(this.currentRule.capabilityName))
.find(property => property.name == this.currentRule.servicePropertyName);
@@ -158,7 +160,7 @@ export class CapabilitiesFilterPropertiesEditorComponent {
const selectedSourceType: UIDropDownSourceTypesElement = this.sourceTypes.find(
(t) => t.value === this.currentRule.sourceName && t.type === this.currentRule.sourceType
);
- if(selectedSourceType) {
+ if (selectedSourceType) {
this.listOfSourceOptions = selectedSourceType.options || [];
this.assignedValueLabel = selectedSourceType.assignedLabel || this.SOURCE_TYPES.STATIC.label;
this.filterOptionsByType();
@@ -166,7 +168,7 @@ export class CapabilitiesFilterPropertiesEditorComponent {
}
}
- onCapabilityNameChanged= (value: any): void => {
+ onCapabilityNameChanged = (value: any): void => {
this.selectedPropertiesByCapabilityName = this.input.componentInstanceCapabilitiesMap.get(value);
this.capabilityProperties = _.map(this.selectedPropertiesByCapabilityName, (prop) => new DropdownValue(prop.name, prop.name));
this.selectedCapabilityName = value;
@@ -193,7 +195,7 @@ export class CapabilitiesFilterPropertiesEditorComponent {
this.listOfValuesToAssign = [];
return;
}
- this.listOfValuesToAssign = this.listOfSourceOptions.reduce((result, op: PropertyModel) => {
+ this.listOfValuesToAssign = this.listOfSourceOptions.reduce((result, op: PropertyModel) => {
if (op.type === this.selectedCapabilitiesPropertyObject.type && (!op.schemaType || op.schemaType === this.selectedCapabilitiesPropertyObject.schemaType)) {
result.push(new DropdownValue(op.name, op.name));
}