a67364cd60d68ef125cf4cd283be184538a7b7d5
[sdc.git] / catalog-ui / src / app / ng2 / pages / properties-assignment / tosca-function / tosca-custom-function / tosca-custom-function.component.html
1 <!--
2   ~ -
3   ~  ============LICENSE_START=======================================================
4   ~  Copyright (C) 2023 Nordix Foundation.
5   ~  ================================================================================
6   ~  Licensed under the Apache License, Version 2.0 (the "License");
7   ~  you may not use this file except in compliance with the License.
8   ~  You may obtain a copy of the License at
9   ~
10   ~       http://www.apache.org/licenses/LICENSE-2.0
11   ~
12   ~  Unless required by applicable law or agreed to in writing, software
13   ~  distributed under the License is distributed on an "AS IS" BASIS,
14   ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   ~  See the License for the specific language governing permissions and
16   ~  limitations under the License.
17   ~
18   ~  SPDX-License-Identifier: Apache-2.0
19   ~  ============LICENSE_END=========================================================
20   -->
21
22 <div class="component-container">
23   <ng-container [formGroup]="formGroup">
24     <label>Custom function name: </label>
25     <input type="text" formControlName="customName" [value]="name" required/><br/><br/>
26     <div formArrayName="customParameterList">
27       <div *ngFor="let parameter of parameters; let idx = index">
28         <div *ngIf="idx > 0" class="text-center"><span class="custom-plus-icon"></span></div>
29         <div class="parameter-card">
30           <div class="card-content">
31             <ng-container *ngIf="parameter.type === STRING_FUNCTION_TYPE">
32               <input type="text" [formControlName]="idx" [value]="parameter.value"/><br/>
33             </ng-container>
34             <ng-container *ngIf="parameter.type !== STRING_FUNCTION_TYPE">
35               <tosca-function [property]="propertyInputList[idx]" [componentInstanceMap]="componentInstanceMap" [allowClear]="false"
36                               (onValidityChange)="onFunctionValidityChange($event, idx)">
37               </tosca-function>
38             </ng-container>
39             <div class="buttons-container">
40               <span class="delete-icon" (click)="removeParameter(idx)"></span>
41             </div>
42           </div>
43         </div>
44       </div>
45     </div>
46   </ng-container>
47   <div class="buttons-container">
48     <a class="add-link" (click)="addStringParameter()">String Value</a> <a class="add-link" (click)="addFunction()">TOSCA Function Expression</a>
49   </div>
50 </div>