Implement adding Interface to VFC
[sdc.git] / catalog-ui / src / app / ng2 / pages / interface-definition / operation-creator / param-row / param-row.component.html
1 <!--
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2022 Nordix Foundation. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19 -->
20  
21 <div class="cell field-name">
22     <ui-element-input
23         *ngIf="!isAssociateWorkflow"
24         [testId]="'param-name-' + (param.name || 'unnamed')"
25         [(value)]="param.name"
26         (valueChange)="onChangeName()"
27         [readonly]="readonly">
28     </ui-element-input>
29     <span *ngIf="isAssociateWorkflow">{{param.name}}</span>
30 </div>
31
32 <div class="cell field-type">
33     <ui-element-dropdown
34         *ngIf="!isAssociateWorkflow"
35         [testId]="'param-type-' + (param.name || 'unnamed')"
36         [values]="propTypeEnum"
37         [(value)]="param.type"
38         (valueChange)="onChangeType()"
39         [readonly]="readonly">
40     </ui-element-dropdown>
41     <span *ngIf="isAssociateWorkflow">{{param.type}}</span>
42 </div>
43
44 <div class="cell field-property" *ngIf="isInputParam">
45     <select
46         *ngIf="filteredInputProps.length || operationOutputCats.length || !isAssociateWorkflow"
47         [(ngModel)]="param.inputId"
48         (change)="onChangeProperty($event)"
49         [ngClass]="{'disabled': readonly}"
50         [attr.data-tests-id]="'value-param-property-' + (param.name || 'unnamed')">
51         <option
52             *ngFor="let prop of filteredInputProps"
53             [ngValue]="prop.value">
54             {{prop.label}}
55         </option>
56         <optgroup
57             *ngFor="let operation of operationOutputCats"
58             label="{{operation.operationName}}">
59             <option
60                 *ngFor="let output of operation.outputs"
61                 [ngValue]="output.value">
62                 {{output.label}}
63             </option>
64         </optgroup>
65         <optgroup
66                 *ngFor="let cap of filteredCapabilitiesProps"
67                 label="{{cap.capabilityName}}">
68             <option
69                     *ngFor="let prop of cap.properties"
70                     [ngValue]="prop.value">
71                 {{prop.label}}
72             </option>
73         </optgroup>
74     </select>
75     <span
76         *ngIf="!filteredInputProps.length && !operationOutputCats.length && isAssociateWorkflow"
77         class="no-properties-error">
78         {{ 'PARAM_NONE_OF_TYPE' | translate }}
79     </span>
80 </div>
81
82 <div class="cell field-mandatory" *ngIf="!isAssociateWorkflow">
83     <checkbox
84         *ngIf="!isAssociateWorkflow"
85         [attr.data-tests-id]="'param-mandatory-' + (param.name || 'unnamed')"
86         [(checked)]="param.required"
87         [ngClass]="{'disabled':readonly}">
88     </checkbox>
89 </div>
90
91 <div class="cell remove" *ngIf="!isAssociateWorkflow && !readonly">
92     <svg-icon
93         name="trash-o"
94         mode="info"
95         size="small"
96         [attr.data-tests-id]="'param-remove-' + (param.name || 'unnamed')"
97         (click)="onRemoveParam(param)"
98         [clickable]="true">
99   </svg-icon>
100 </div>