summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.html
blob: 7abc1a52c092fcdbf466c4bc3d139f14e63ff0e4 (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!--
  ~ Copyright © 2016-2018 European Support Limited
  ~
  ~ 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.
  -->
  
<div class="operation-creator">
    <loader [display]="isLoading" [size]="'large'" [relative]="true"></loader>

    <form class="w-sdc-form">

        <div class="side-by-side">
            <div class="form-item">
                <sdc-dropdown
                    label="{{ 'OPERATION_INTERFACE_TYPE' | translate }}"
                    [required]="true"
                    testId="interface-name"
                    selectedOption="{{operation.interfaceType}}"
                    placeHolder="Select..."
                    [disabled]="readonly"
                    (changed)="onSelectInterface($event)"
                    [options]="interfaceNames">
                </sdc-dropdown>
            </div>

            <div class="form-item" *ngIf="!isInterfaceOther()">
                <sdc-dropdown
                    label="{{ 'OPERATION_NAME' | translate }}"
                    [required]="true"
                    testId="operation-name"
                    selectedOption="{{operation.name}}"
                    placeHolder="Select..."
                    [disabled]="readonly"
                    (changed)="onSelectOperationName($event)"
                    [options]="operationNames">
                </sdc-dropdown>
            </div>
            <div class="form-item" *ngIf="isInterfaceOther()">
                <sdc-input
                    label="{{ 'OPERATION_NAME' | translate }}"
                    [(value)]="operation.name"
                    testId="operationName"
                    (valueChange)="onChangeName()">
                </sdc-input>
            </div>

        </div>

        <div class="i-sdc-form-item sdc-input">
            <span class="sdc-input__label">{{ 'OPERATION_DESCRIPTION' | translate }}</span>
            <textarea
                data-tests-id="operationDescription"
                rows="2"
                name="description"
                [(ngModel)]="descriptionValue"
                [ngClass]="{'disabled': readonly}">
            </textarea>
        </div>

        <div class="side-by-side" *ngIf="enableWorkflowAssociation">
            <div class="form-item">
                <sdc-dropdown
                    label="{{ 'OPERATION_WORKFLOW_ASSIGNMENT' | translate }}"
                    placeHolder="Select..."
                    testId="association-type"
                    selectedOption="{{workflowAssociationType}}"
                    [options]="associationOptions"
                    (changed)="toggleAssociateWorkflow($event)"
                    [disabled]="readonly">
                </sdc-dropdown>
            </div>

            <div class="form-item" *ngIf="!isUsingExistingWF()"></div>

            <div class="form-item sdc-input" *ngIf="isUsingExistingWF()">
                <label class="sdc-input__label required">{{ 'OPERATION_WORKFLOW' | translate }}
                    <span class="archive-warning" *ngIf="workflowIsOnline && archivedWorkflowId === operation.workflowId">({{ 'OPERATION_WORKFLOW_ARCHIVED' | translate }})</span>
                    <span class="no-workflow-warning" *ngIf="!workflowIsOnline">Failed to load workflows</span>
                    <span class="no-workflow-warning" *ngIf="workflowIsOnline && !workflows.length">{{ 'OPERATION_NO_WORKFLOW_ERROR' | translate }}</span>
                </label>
                <sdc-dropdown
                    placeHolder="Select..."
                    testId="associated-workflow"
                    selectedOption="{{operation.workflowId}}"
                    [options]="workflows"
                    (changed)="onSelectWorkflow($event)"
                    [disabled]="readonly || !workflows.length || !workflowIsOnline">
                </sdc-dropdown>
            </div>

            <div class="form-item sdc-input" *ngIf="isUsingExistingWF()">
                <sdc-dropdown
                    *ngIf="workflowIsOnline && workflows.length"
                    label="{{ 'OPERATION_WORKFLOW_VERSION' | translate }}"
                    testId="associated-workflow-version"
                    selectedOption="{{operation.workflowVersionId}}"
                    [options]="workflowVersions"
                    (changed)="changeWorkflowVersion($event)"
                    [disabled]="!operation.workflowId || archivedWorkflowId === operation.workflowId || readonly">
                </sdc-dropdown>
            </div>
        </div>

        <div class="separator-buttons">
            <tabs #propertyInputTabs tabStyle="round-tabs" (tabChanged)="tabChanged($event)" [hideIndicationOnTabChange]="true">
                <tab tabTitle="Inputs"></tab>
                <tab tabTitle="Outputs"></tab>
            </tabs>
            <a
                class="add-param-link add-btn"
                *ngIf="!isUsingExistingWF() && !readonly"
                data-tests-id="addInputParameter"
                [ngClass]="{'disabled':!canAdd()}"
                (click)="addParam()">{{ currentTab === TYPE_INPUT ? 'Add Input' : 'Add Output' }}</a>
        </div>

        <div class="generic-table">
            <div class="header-row table-row">
                <span class="cell header-cell field-name">{{ 'OPERATION_PARAM_NAME' | translate }}</span>
                <span class="cell header-cell field-type">{{ 'OPERATION_PARAM_TYPE' | translate }}</span>
                <span class="cell header-cell field-property" *ngIf="currentTab == TYPE_INPUT">
                    {{ 'OPERATION_PARAM_PROPERTY' | translate }}
                    <span
                        *ngIf="!isUsingExistingWF()"
                        class="sprite-new info-icon"
                        tooltip="{{propertyTooltipText}}"
                        tooltipDelay="0">
                    </span>
                </span>
                <span class="cell header-cell field-mandatory" *ngIf="!isUsingExistingWF()">{{ 'OPERATION_PARAM_MANDATORY' | translate }}</span>
                <span class="cell header-cell remove" *ngIf="!isUsingExistingWF() && !readonly">●●●</span>
            </div>

            <div class="empty-msg data-row" *ngIf="tableParameters.length === 0">
                <div>{{ 'EMPTY_PARAM_TABLE_HEADER' | translate }}</div>
                <div *ngIf="isUsingExistingWF() && !operation.workflowVersionId">
                    <div *ngIf="workflows.length">
                        <span class="bold-message">{{ 'EMPTY_PARAM_TABLE_NO_SELECTED_WORKFLOW_1' | translate }}</span>
                        <span>{{ 'EMPTY_PARAM_TABLE_NO_SELECTED_WORKFLOW_2' | translate }}</span>
                    </div>
                </div>
            </div>

            <param-row
                *ngFor="let param of tableParameters"
                class="data-row"
                [isInputParam]="currentTab === TYPE_INPUT"
                [isAssociateWorkflow]="isUsingExistingWF()"
                [param]="param"
                [inputProps]="inputProperties"
                [operationOutputs]="operationOutputs"
                [onRemoveParam]="onRemoveParam"
                [readonly]="readonly"
                [validityChanged]="validityChanged">
            </param-row>
        </div>

    </form>
</div>