Implement adding Interface to VFC
[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                 <checkbox [label]="'Add Artifact To Implementation'"
69                           [(checked)]="enableAddArtifactImplementation"
70                           (checkedChange)="onMarkToAddArtifactToImplementation($event)"
71                           [disabled]=isViewOnly>
72                 </checkbox>
73             </div>
74             <div class="form-item" *ngIf="!enableAddArtifactImplementation">
75                 <sdc-input
76                     label="{{'INTERFACE_OPERATION_IMPLEMENTATION_NAME' | translate}}"
77                     testId="interface-operation-implementation-name"
78                     [(value)]="artifactName"
79                     (valueChange)="onImplementationNameChange($event)"
80                     [disabled]=isViewOnly>
81                 </sdc-input>
82             </div>
83
84             <div class="side-by-side" *ngIf="enableAddArtifactImplementation">
85                 <div class="form-item" *ngIf="toscaArtifactTypes">
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="toscaArtifactTypeSelected && enableAddArtifactImplementation">
98                     <sdc-input
99                         label="{{ 'INTERFACE_OPERATION_IMPLEMENTATION_FILE' | translate }}"
100                         data-tests-id="artifactFile"
101                         [(value)]="artifactName"
102                         [required]="true"
103                         (valueChange)="onArtifactFileChange($event)"
104                         [disabled]=isViewOnly>
105                     </sdc-input>
106                 </div>
107                 <div class="form-item">
108                     <sdc-input
109                         label="{{ 'ARTIFACT_VERSION' | translate }}"
110                         data-tests-id="artifactVersion"
111                         [(value)]="artifactVersion"
112                         (valueChange)="onArtifactVersionChange($event)"
113                         [disabled]=isViewOnly>
114                     </sdc-input>
115                 </div>
116             </div>
117             <div class="form-item" *ngIf="toscaArtifactTypeSelected && enableAddArtifactImplementation">
118                 <input-list
119                     *ngIf="artifactTypeProperties && dataTypeMap"
120                     [title]="'ARTIFACT_PROPERTY_LIST_TITLE' | translate"
121                     [emptyMessage]="'ARTIFACT_PROPERTY_LIST_EMPTY' | translate"
122                     [inputs]="artifactTypeProperties"
123                     [dataTypeMap]="dataTypeMap"
124                     [isViewOnly]="isViewOnly"
125                     [allowDeletion]="false"
126                     (onValueChange)="onArtifactPropertyValueChange($event)"
127                 >
128                 </input-list>
129             </div>
130         </div>
131         <div class="group-with-border content-row" *ngIf="dataTypeMap">
132             <input-list
133                 [title]="'INPUT_LIST_TITLE' | translate"
134                 [emptyMessage]="'INPUT_LIST_EMPTY' | translate"
135                 [inputs]="inputs"
136                 [dataTypeMap]="dataTypeMap"
137                 [isViewOnly]="isViewOnly"
138                 [allowDeletion]="true"
139                 (onValueChange)="onInputValueChange($event)"
140                 (onDelete)="onInputDelete($event)"
141             >
142             </input-list>
143         </div>
144         <div class="group-with-border content-row">
145             <app-add-input
146                 [dataTypeMap]="dataTypeMap$"
147                 [isView]="isViewOnly"
148                 [existingInputNames]="collectInputNames()"
149                 (onAddInput)="onAddInput($event)"
150             >
151             </app-add-input>
152         </div>
153     </form>
154 </div>