diff options
author | 2019-01-16 16:14:12 +0200 | |
---|---|---|
committer | 2019-01-16 14:54:20 +0000 | |
commit | 6503c16035a75687c9edabd54449eeb4ec744906 (patch) | |
tree | d06c7d527136e0c5d691ba626924972a63963ccc /catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row | |
parent | fe65ddd4b7e68a683d4e027f136ac85c8d0b29f4 (diff) |
Interface bug fixes
1. Editing operation, property value now shows
2. Existing interface/operation combos are now disabled in operation
name dropdown
3. Adding value for Local interface name now updates validation
Change-Id: I66497c12903fb47325236c09d3b2d6b248e79da7
Issue-ID: SDC-2052
Signed-off-by: Arielk <Ariel.Kenan@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row')
2 files changed, 29 insertions, 19 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 1128d60e04..18142c982b 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 @@ -38,14 +38,14 @@ </div> <div class="cell field-property" *ngIf="isInputParam"> - <ui-element-dropdown - *ngIf="filteredInputProps.length || !isAssociateWorkflow" - data-tests-id="paramProperty" - [values]="filteredInputProps" - value="paramId" - (valueChange)="onChangeProperty($event)" - [readonly]="readonly"> - </ui-element-dropdown> + <ui-element-dropdown + *ngIf="filteredInputProps.length || !isAssociateWorkflow" + data-tests-id="paramProperty" + [values]="filteredInputProps" + [(value)]="param.inputId" + (valueChange)="onChangeProperty($event)" + [readonly]="readonly"> + </ui-element-dropdown> <span *ngIf="!filteredInputProps.length && isAssociateWorkflow" class="no-properties-error"> 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 8837a17bd9..89aa251252 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 @@ -19,8 +19,7 @@ export class ParamRowComponent { @Input() isInputParam: boolean; @Input() validityChanged: Function; - paramId: string; - propTypeEnum: Array<DropDownOption> = []; + propTypeEnum: Array<string> = []; filteredInputProps: Array<DropdownValue> = []; constructor(private dataTypeService: DataTypeService) {} @@ -29,7 +28,7 @@ export class ParamRowComponent { this.propTypeEnum = _.uniq( _.map( this.getPrimitiveSubtypes(), - prop => new DropDownOption(prop.type) + prop => prop.type ) ); this.onChangeType(); @@ -40,7 +39,7 @@ export class ParamRowComponent { this.validityChanged(); } - onChangeType(paramId?: string) { + onChangeType() { this.filteredInputProps = _.map( _.filter( this.getPrimitiveSubtypes(), @@ -48,13 +47,24 @@ export class ParamRowComponent { ), prop => new DropdownValue(prop.uniqueId, prop.name) ); - if (paramId) { - this.paramId = paramId; + + if (this.param.inputId) { + const selProp = _.find( + this.getPrimitiveSubtypes(), + prop => prop.uniqueId === this.param.inputId + ); + if (selProp && selProp.type === this.param.type) { + this.param.inputId = '-1'; + setTimeout(() => this.param.inputId = selProp.uniqueId, 100); + } else { + this.param.inputId = null; + } } + + this.validityChanged(); } - onChangeProperty(paramId: string) { - this.param.inputId = paramId; + onChangeProperty() { const newProp = _.find( this.getPrimitiveSubtypes(), prop => this.param.inputId === prop.uniqueId @@ -62,20 +72,20 @@ export class ParamRowComponent { if (!this.param.type) { this.param.type = newProp.type; - this.onChangeType(paramId); - } else { - this.paramId = paramId; + this.onChangeType(); } if (!this.param.name) { this.param.name = newProp.name; } + this.validityChanged(); } getPrimitiveSubtypes(): Array<InputBEModel> { const flattenedProps: Array<any> = []; const dataTypes = this.dataTypeService.getAllDataTypes(); + _.forEach(this.inputProps, prop => { const type = _.find( _.toArray(dataTypes), |