Support Tosca Function For Operation Implmentation Properties
[sdc.git] / catalog-ui / src / app / ng2 / pages / composition / interface-operatons / operation-creator / interface-operation-handler.component.html
1 <!--
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2021 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="operation-handler">
22     <loader [display]="isLoading" [size]="'large'" [relative]="true"></loader>
23
24     <form class="w-sdc-form">
25
26         <div class="side-by-side">
27             <div class="form-item">
28                 <sdc-dropdown
29                     label="{{ 'OPERATION_INTERFACE_TYPE' | translate }}"
30                     [required]="true"
31                     [testId]="'interface-name'"
32                     [selectedOption]="selectedInterfaceType"
33                     [placeHolder]="'Select...'"
34                     [disabled]="isViewOnly || isEdit"
35                     (changed)="onSelectInterface($event)"
36                     [options]="interfaceTypeOptions">
37                 </sdc-dropdown>
38             </div>
39
40             <div class="form-item">
41                 <sdc-dropdown
42                     #interfaceOperationDropDown
43                     label="{{ 'OPERATION_NAME' | translate }}"
44                     [required]="true"
45                     [testId]="'operation-name'"
46                     [selectedOption]="selectedInterfaceOperation"
47                     [placeHolder]="'Select...'"
48                     [disabled]="isViewOnly || isEdit"
49                     (changed)="onSelectOperation($event)"
50                     [options]="interfaceOperationOptions">
51                 </sdc-dropdown>
52             </div>
53         </div>
54
55         <div class="form-item">
56             <sdc-input
57                 label="{{'OPERATION_DESCRIPTION' | translate}}"
58                 [(value)]="operationToUpdate.description"
59                 testId="interface-operation-description"
60                 (valueChange)="onDescriptionChange($event)"
61                 [disabled]=isViewOnly>
62             </sdc-input>
63         </div>
64
65         <div class="group-with-border content-row">
66             <label class="occurrences-label"> {{ 'INTERFACE_OPERATION_IMPLEMENTATION' | translate}}</label>
67             <div class="form-item">
68                 <sdc-input
69                     label="{{'INTERFACE_OPERATION_IMPLEMENTATION_ARTIFACT_URI' | translate}}"
70                     testId="interface-operation-implementation-name"
71                     [(value)]="artifactName"
72                     (valueChange)="onURIChange($event)"
73                     [disabled]=isViewOnly>
74                 </sdc-input>
75             </div>
76             <br>
77             <div class="form-item">
78                 <checkbox [label]="'ADD_ARTIFACT_DETAILS' | translate"
79                     [(checked)]="enableAddArtifactImplementation"
80                     (checkedChange)="onMarkToAddArtifactToImplementation($event)"
81                     [disabled]=isViewOnly>
82                 </checkbox>
83             </div>
84             <div class="form-item" *ngIf="toscaArtifactTypes && enableAddArtifactImplementation">
85                 <br>
86                 <sdc-dropdown
87                     label="{{ 'TOSCA_ARTIFACT_TYPE' | translate }}"
88                     testId="selectToscaArtifactType"
89                     [required]="true"
90                     [selectedOption]="toscaArtifactTypeSelected"
91                     placeHolder="{{toscaArtifactTypeSelected != undefined ? toscaArtifactTypeSelected : 'Select...'}}"
92                     (changed)="onSelectToscaArtifactType($event)"
93                     [options]="toscaArtifactTypes"
94                     [disabled]=isViewOnly>
95                 </sdc-dropdown>
96             </div>
97             <div class="form-item" *ngIf="enableAddArtifactImplementation">
98                 <sdc-input
99                     label="{{ 'ARTIFACT_VERSION' | translate }}"
100                     data-tests-id="artifactVersion"
101                     [(value)]="artifactVersion"
102                     (valueChange)="onArtifactVersionChange($event)"
103                     [disabled]=isViewOnly>
104                 </sdc-input>
105             </div>
106             <div class="form-item" *ngIf="toscaArtifactTypeSelected && enableAddArtifactImplementation">
107                 <br>
108                 <input-list
109                     *ngIf="artifactTypeProperties && dataTypeMap"
110                     [title]="'ARTIFACT_PROPERTY_LIST_TITLE' | translate"
111                     [emptyMessage]="'ARTIFACT_PROPERTY_LIST_EMPTY' | translate"
112                     [inputs]="artifactTypeProperties"
113                     [dataTypeMap]="dataTypeMap"
114                     [isViewOnly]="isViewOnly"
115                     [showToscaFunctionOption]="true"
116                     [componentInstanceMap]="componentInstanceMap"
117                     [allowDeletion]="false"
118                     (onInputsValidityChange)="implementationPropsValidityChange($event)"
119                     (onValueChange)="onArtifactPropertyValueChange($event)"
120                 >
121                 </input-list>
122             </div>
123         </div>
124         <div class="group-with-border content-row" *ngIf="dataTypeMap">
125             <input-list
126                 [title]="'INPUT_LIST_TITLE' | translate"
127                 [emptyMessage]="'INPUT_LIST_EMPTY' | translate"
128                 [inputs]="inputs"
129                 [dataTypeMap]="dataTypeMap"
130                 [isViewOnly]="isViewOnly"
131                 [allowDeletion]="true"
132                 (onValueChange)="onInputValueChange($event)"
133                 (onDelete)="onInputDelete($event)"
134             >
135             </input-list>
136         </div>
137         <div class="group-with-border content-row">
138             <app-add-input
139                 [dataTypeMap]="dataTypeMap$"
140                 [isView]="isViewOnly"
141                 [existingInputNames]="collectInputNames()"
142                 (onAddInput)="onAddInput($event)"
143             >
144             </app-add-input>
145         </div>
146     </form>
147 </div>