aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/activities-list/activities-list.component.html
blob: ce8eb2f51df2f934920073be519f9c63620e4efb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!--
 * ============LICENSE_START=======================================================
 * SDC
 * ================================================================================
 * Copyright (C) 2023 Nordix Foundation. All rights reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END=========================================================
-->

<div class="sub-operation-activities">
  <div class="group-with-border content-row">
    <form novalidate class="w-sdc-form two-columns" [formGroup]="activityForm">
      <div formArrayName="activityFormList">
        <label class="activities-label"> Activities </label>
        <div *ngFor="let activity of activities; let idx = index">
          <div class="side-by-side group-with-border-blue">
            <div class="form-item">
              <label class="sdc-timeout-label">Type: </label>
              <div class="sdc-dropdown">
                <select class="i-sdc-form-select"
                        data-tests-id="activity-type"
                        [value]="activity.type"
                        [disabled]="isViewOnly"
                        (change)="onActivityTypeChange($event.target.value, idx)"
                        required>
                  <option *ngIf="activity" [value]="activity.type" hidden selected>
                    {{ activity.type }}
                  </option>
                  <option *ngFor="let activityType of activityTypes"
                          [value]="activityType">
                    {{ activityType }}
                  </option>
                </select>
              </div>
            </div>
            <div class="form-item">
              <div class="side-by-side">
                <div class="form-item-big">
                  <label>Workflow: </label>
                  <input type="text"
                     class="i-sdc-form-input"
                     [disabled]="isViewOnly"
                     (input)="onActivityValueChange($event.target.value, idx)"
                     [value]="activity.workflow"
                     [ngClass]="{'disabled': isViewOnly}"
                     required/>
                </div>
                <div class="form-item-icon">
                  <span class="sprite-new delete-btn" [ngClass]="{'disabled': isViewOnly}" (click)="removeFromActivities(idx)"></span>
                </div>
              </div>
            </div>
          </div>
          <div class="w-sdc-form-columns-wrapper">
            <div class="validation-errors">
              <ng-container *ngFor="let validation of validationMessages.activity">
                <div class="input-error" *ngIf="activityFormArray.at(idx).hasError(validation.type);">
                  {{ validation.message }}
                </div>
              </ng-container>
            </div>
          </div>
          <div class="group-with-border content-row" *ngIf="dataTypeMap">
            <input-list
                [title]="'INPUT_LIST_TITLE' | translate"
                [emptyMessage]="'INPUT_LIST_EMPTY' | translate"
                [inputs]="getInputs(idx)"
                [dataTypeMap]="dataTypeMap"
                [isViewOnly]="isViewOnly"
                [allowDeletion]="true"
                [componentInstanceMap]="componentInstanceMap"
                (onValueChange)="onInputValueChange($event, idx)"
                (onDelete)="onInputDelete($event, idx)"
            >
            </input-list>
          </div>
          <div class="group-with-border content-row">
              <app-add-input
                  [dataTypeMap]="dataTypeMap$"
                  [isView]="isViewOnly"
                  [defaultType]="DEFAULT_INPUT_TYPE"
                  [existingInputNames]="collectInputNames(idx)"
                  (onAddInput)="onAddInput($event, idx)"
              >
              </app-add-input>
          </div>
        </div>
        <div class="add-button-container group-with-border" *ngIf="!isViewOnly">
          <a class="add-btn" data-tests-id="add-input.add-input-link"
             (click)="addActivity()">Add Activity</a>
        </div>
      </div>
    </form>
  </div>
</div>