Null x when adding operation to empty list 61/76061/3
authorArielk <Ariel.Kenan@amdocs.com>
Mon, 21 Jan 2019 11:11:42 +0000 (13:11 +0200)
committerAvi Gaffa <avi.gaffa@amdocs.com>
Tue, 22 Jan 2019 09:31:23 +0000 (09:31 +0000)
Change-Id: Ib54f29049d8b576f48f8459439650c45fe1248f6
Issue-ID: SDC-2052
Signed-off-by: Arielk <Ariel.Kenan@amdocs.com>
catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts
catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/param-row/param-row.component.html

index 7f31e99..e746c6d 100644 (file)
@@ -224,11 +224,12 @@ export class OperationCreatorComponent {
             _.map(
                 this.interfaceTypes[this.operation.interfaceType],
                 name => {
+                    const curInterf = _.find(
+                        this.interfaces,
+                        interf => interf.type === this.operation.interfaceType
+                    );
                     const existingOp = _.find(
-                        _.find(
-                            this.interfaces,
-                            interf => interf.type === this.operation.interfaceType
-                        ).operations,
+                        curInterf && curInterf.operations || [],
                         op => op.name === name
                     );
                     const ddType = (existingOp && existingOp.uniqueId !== this.operation.uniqueId) ? 2 : 0;
index 18142c9..d237837 100644 (file)
@@ -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.
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
   -->
+
 <div class="cell field-name">
     <ui-element-input
         *ngIf="!isAssociateWorkflow"
-        data-tests-id="paramName"
+        [testId]="'param-name-' + (param.name || 'unnamed')"
         [(value)]="param.name"
         (valueChange)="onChangeName()"
         [readonly]="readonly">
@@ -28,7 +28,7 @@
 <div class="cell field-type">
     <ui-element-dropdown
         *ngIf="!isAssociateWorkflow"
-        data-tests-id="paramType"
+        [testId]="'param-type-' + (param.name || 'unnamed')"
         [values]="propTypeEnum"
         [(value)]="param.type"
         (valueChange)="onChangeType()"
 </div>
 
 <div class="cell field-property" *ngIf="isInputParam">
-  <ui-element-dropdown
-      *ngIf="filteredInputProps.length || !isAssociateWorkflow"
-      data-tests-id="paramProperty"
-      [values]="filteredInputProps"
-      [(value)]="param.inputId"
-      (valueChange)="onChangeProperty($event)"
-      [readonly]="readonly">
-  </ui-element-dropdown>
+    <ui-element-dropdown
+        *ngIf="filteredInputProps.length || !isAssociateWorkflow"
+        [testId]="'param-property-' + (param.name || 'unnamed')"
+        [values]="filteredInputProps"
+        [(value)]="param.inputId"
+        (valueChange)="onChangeProperty($event)"
+        [readonly]="readonly">
+    </ui-element-dropdown>
     <span
         *ngIf="!filteredInputProps.length && isAssociateWorkflow"
         class="no-properties-error">
@@ -56,7 +56,7 @@
 <div class="cell field-mandatory" *ngIf="!isAssociateWorkflow">
     <checkbox
         *ngIf="!isAssociateWorkflow"
-        data-tests-id="paramMandatory"
+        [attr.data-tests-id]="'param-mandatory-' + (param.name || 'unnamed')"
         [(checked)]="param.required"
         [ngClass]="{'disabled':readonly}">
     </checkbox>
 
 <div class="cell remove" *ngIf="!isAssociateWorkflow && !readonly">
     <svg-icon
-      name="trash-o"
-      mode="info"
-      size="small"
-      testId="removeInputParam"
-      (click)="onRemoveParam(param)"
-      [clickable]="true">
+        name="trash-o"
+        mode="info"
+        size="small"
+        [attr.data-tests-id]="'param-remove-' + (param.name || 'unnamed')"
+        (click)="onRemoveParam(param)"
+        [clickable]="true">
   </svg-icon>
 </div>