7a73a5babc9e057b85ea8b46367ca268e14cd698
[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-input
29                     label="{{ 'OPERATION_INTERFACE_TYPE' | translate }}"
30                     [(value)]="interfaceType"
31                     [disabled]=!isViewOnly>
32                 </sdc-input>
33             </div>
34
35             <div class="form-item">
36                 <sdc-input
37                     label="{{ 'OPERATION_NAME' | translate }}"
38                     [(value)]="operationToUpdate.name"
39                     [disabled]=!isViewOnly>
40                 </sdc-input>
41             </div>
42         </div>
43
44         <div class="form-item">
45             <sdc-input
46                 label="{{'OPERATION_DESCRIPTION' | translate}}"
47                 [(value)]="operationToUpdate.description"
48                 testId="interface-operation-description"
49                 (valueChange)="onDescriptionChange($event)"
50                 [disabled]=isViewOnly>
51             </sdc-input>
52         </div>
53
54         <div class="group-with-border content-row">
55             <label class="occurrences-label"> {{ 'INTERFACE_OPERATION_IMPLEMENTATION' | translate}}</label>
56             <div class="form-item">
57                 <checkbox [label]="'Add Artifact To Implementation'"
58                           [(checked)]="enableAddArtifactImplementation"
59                           (checkedChange)="onMarkToAddArtifactToImplementation($event)"
60                           [disabled]=isViewOnly>
61                 </checkbox>
62             </div>
63             <div class="form-item" *ngIf="!enableAddArtifactImplementation">
64                 <sdc-input
65                     label="{{'INTERFACE_OPERATION_IMPLEMENTATION_NAME' | translate}}"
66                     testId="interface-operation-implementation-name"
67                     [(value)]="artifactName"
68                     (valueChange)="onImplementationNameChange($event)"
69                     [disabled]=isViewOnly>
70                 </sdc-input>
71             </div>
72
73             <div class="side-by-side" *ngIf="enableAddArtifactImplementation">
74                 <div class="form-item" *ngIf="toscaArtifactTypes">
75                     <sdc-dropdown
76                         label="{{ 'TOSCA_ARTIFACT_TYPE' | translate }}"
77                         testId="selectToscaArtifactType"
78                         [required]="true"
79                         [selectedOption]="toscaArtifactTypeSelected"
80                         placeHolder="{{toscaArtifactTypeSelected != undefined ? toscaArtifactTypeSelected : 'Select...'}}"
81                         (changed)="onSelectToscaArtifactType($event)"
82                         [options]="toscaArtifactTypes"
83                         [disabled]=isViewOnly>
84                     </sdc-dropdown>
85                 </div>
86                 <div class="form-item" *ngIf="toscaArtifactTypeSelected && enableAddArtifactImplementation">
87                     <sdc-input
88                         label="{{ 'INTERFACE_OPERATION_IMPLEMENTATION_FILE' | translate }}"
89                         data-tests-id="artifactFile"
90                         [(value)]="artifactName"
91                         [required]="true"
92                         (valueChange)="onArtifactFileChange($event)"
93                         [disabled]=isViewOnly>
94                     </sdc-input>
95                 </div>
96                 <div class="form-item">
97                     <sdc-input
98                         label="{{ 'ARTIFACT_VERSION' | translate }}"
99                         data-tests-id="artifactVersion"
100                         [(value)]="artifactVersion"
101                         (valueChange)="onArtifactVersionChange($event)"
102                         [disabled]=isViewOnly>
103                     </sdc-input>
104                 </div>
105             </div>
106             <div class="form-item" *ngIf="toscaArtifactTypeSelected && enableAddArtifactImplementation">
107                 <input-list
108                     *ngIf="artifactTypeProperties && dataTypeMap"
109                     [title]="'ARTIFACT_PROPERTY_LIST_TITLE' | translate"
110                     [emptyMessage]="'ARTIFACT_PROPERTY_LIST_EMPTY' | translate"
111                     [inputs]="artifactTypeProperties"
112                     [dataTypeMap]="dataTypeMap"
113                     [isViewOnly]="isViewOnly"
114                     [allowDeletion]="false"
115                     (onValueChange)="onArtifactPropertyValueChange($event)"
116                 >
117                 </input-list>
118             </div>
119         </div>
120         <div class="group-with-border content-row" *ngIf="dataTypeMap">
121             <input-list
122                 [title]="'INPUT_LIST_TITLE' | translate"
123                 [emptyMessage]="'INPUT_LIST_EMPTY' | translate"
124                 [inputs]="inputs"
125                 [dataTypeMap]="dataTypeMap"
126                 [isViewOnly]="isViewOnly"
127                 [allowDeletion]="true"
128                 (onValueChange)="onInputValueChange($event)"
129                 (onDelete)="onInputDelete($event)"
130             >
131             </input-list>
132         </div>
133         <div class="group-with-border content-row">
134             <app-add-input
135                 [dataTypeMap]="dataTypeMap$"
136                 [isView]="isViewOnly"
137                 [existingInputNames]="collectInputNames()"
138                 (onAddInput)="onAddInput($event)"
139             >
140             </app-add-input>
141         </div>
142     </form>
143 </div>