|
6 | 6 | <div *ngIf="workflowTemplate.editable && groups && groups.length === 0" class="ui orange message">
|
7 | 7 | {{'common_help_no_group' | translate}}
|
8 | 8 | </div>
|
9 |
| - <div *ngIf="workflowTemplate.editable && importFromURL" class="ui blue message"> |
| 9 | + <div *ngIf="workflowTemplate.editable" class="ui blue message"> |
10 | 10 | {{'workflow_template_help_edit_from' | translate}}
|
11 | 11 | </div>
|
12 | 12 | <div class="four fields">
|
13 | 13 | <div class="field">
|
14 | 14 | <label>{{'common_name' | translate}} *</label>
|
15 | 15 | <input class="ui input" type="text" name="name" [(ngModel)]="workflowTemplate.name"
|
16 |
| - [readonly]="!workflowTemplate.editable || importFromURL"> |
| 16 | + [readonly]="!workflowTemplate.editable"> |
17 | 17 | </div>
|
18 | 18 | <div class="field">
|
19 | 19 | <label>{{'common_slug' | translate}} *</label>
|
|
23 | 23 | <div class="field">
|
24 | 24 | <label>{{'common_group' | translate}} *</label>
|
25 | 25 | <sm-select class="fluid search" name="group"
|
26 |
| - *ngIf="groups && workflowTemplate.editable && !importFromURL" [disabled]="loading" |
| 26 | + *ngIf="groups && workflowTemplate.editable" [disabled]="loading" |
27 | 27 | [(model)]="workflowTemplate.group_id" [options]="{'fullTextSearch': true}">
|
28 | 28 | <option *ngFor="let group of groups" [value]="group.id">{{group.name}}</option>
|
29 | 29 | </sm-select>
|
30 |
| - <input *ngIf="!workflowTemplate.editable || importFromURL" class="ui input" type="text" |
| 30 | + <input *ngIf="!workflowTemplate.editable" class="ui input" type="text" |
31 | 31 | name="group" [ngModel]="workflowTemplate.group?.name" [readonly]="true">
|
32 | 32 | </div>
|
33 | 33 | <div class="field">
|
|
40 | 40 | <label>{{'common_description' | translate}}</label>
|
41 | 41 | <textarea name="description" [(ngModel)]="workflowTemplate.description"
|
42 | 42 | (ngModelChange)="descriptionChange()" [rows]="descriptionRows"
|
43 |
| - [readonly]="!workflowTemplate.editable || importFromURL"></textarea> |
| 43 | + [readonly]="!workflowTemplate.editable"></textarea> |
44 | 44 | </div>
|
45 | 45 | </div>
|
46 | 46 | <div *ngIf="workflowTemplate.editable" class="ui horizontal divider">
|
47 | 47 | {{'common_or' | translate}}
|
48 | 48 | </div>
|
49 |
| - <div *ngIf="workflowTemplate.editable || importFromURL" class="sixteen wide column"> |
50 |
| - <div class="wide fields"> |
51 |
| - <div class="four wide field centeredField"> |
52 |
| - <sui-checkbox *ngIf="workflowTemplate.editable" name="import-from-url" [ngModel]="importFromURL" |
53 |
| - class="toggle" (ngModelChange)="changeFromURL()"> |
54 |
| - {{'workflow_template_import_from_url' | translate}} |
55 |
| - </sui-checkbox> |
56 |
| - <span *ngIf="!workflowTemplate.editable">{{'workflow_template_imported_from_url' | |
57 |
| - translate}}</span> |
58 |
| - </div> |
59 |
| - <div class="twelve wide field"> |
60 |
| - <input class="ui input" type="text" name="import-url" placeholder="https://host/my-template.yml" |
61 |
| - [(ngModel)]="workflowTemplate.import_url" |
62 |
| - [readonly]="!workflowTemplate.editable || !importFromURL"> |
63 |
| - </div> |
64 |
| - </div> |
65 |
| - </div> |
66 |
| - <div class="sixteen wide column" *ngIf="!(mode === 'add' && importFromURL)"> |
67 |
| - <div *ngIf="(workflowTemplate.editable && !importFromURL) || parameterKeys.length > 0" |
| 49 | + <div class="sixteen wide column" *ngIf="!(mode === 'add')"> |
| 50 | + <div *ngIf="(workflowTemplate.editable) || parameterKeys.length > 0" |
68 | 51 | class="wide field">
|
69 | 52 | <label>{{ 'common_parameters' | translate }}</label>
|
70 | 53 | </div>
|
71 | 54 | <div class="sixteen wide fields" *ngFor="let k of parameterKeys; let index = index">
|
72 | 55 | <div class="eleven wide field">
|
73 | 56 | <input type="text" name="parameter-key-{{index}}" [placeholder]="'common_name' | translate"
|
74 | 57 | [(ngModel)]="parameterValues[k].key"
|
75 |
| - [readonly]="!workflowTemplate.editable || importFromURL"> |
| 58 | + [readonly]="!workflowTemplate.editable"> |
76 | 59 | </div>
|
77 | 60 | <div class="three wide field">
|
78 |
| - <sui-select *ngIf="workflowTemplate.editable && !importFromURL" class="selection" |
| 61 | + <sui-select *ngIf="workflowTemplate.editable" class="selection" |
79 | 62 | name="parameter-type-{{index}}" placeholder="{{'common_select' | translate}}"
|
80 | 63 | [options]="templateParameterTypes" isSearchable="true" [(ngModel)]="parameterValues[k].type"
|
81 | 64 | #selectType>
|
82 | 65 | <sui-select-option *ngFor="let option of selectType.filteredOptions" [value]="option">
|
83 | 66 | </sui-select-option>
|
84 | 67 | </sui-select>
|
85 |
| - <input *ngIf="!workflowTemplate.editable || importFromURL" class="ui input" type="text" |
| 68 | + <input *ngIf="!workflowTemplate.editable" class="ui input" type="text" |
86 | 69 | name="parameter-type-{{index}}" [ngModel]="parameterValues[k].type" [readonly]="true">
|
87 | 70 | </div>
|
88 | 71 | <div class="two wide field centeredField">
|
89 | 72 | <div class="ui checked checkbox">
|
90 | 73 | <input type="checkbox" name="parameter-required-{{index}}"
|
91 | 74 | [(ngModel)]="parameterValues[k].required"
|
92 |
| - [disabled]="!workflowTemplate.editable || importFromURL"> |
| 75 | + [disabled]="!workflowTemplate.editable"> |
93 | 76 | <label>{{'common_required' | translate}}</label>
|
94 | 77 | </div>
|
95 | 78 | </div>
|
96 |
| - <button *ngIf="workflowTemplate.editable && !importFromURL" class="ui icon red button" |
| 79 | + <button *ngIf="workflowTemplate.editable" class="ui icon red button" |
97 | 80 | (click)="clickRemoveParameter(k)">
|
98 | 81 | <i class="trash icon"></i>
|
99 | 82 | </button>
|
100 | 83 | </div>
|
101 |
| - <div *ngIf="workflowTemplate.editable && !importFromURL" class="sixteen wide fields"> |
| 84 | + <div *ngIf="workflowTemplate.editable" class="sixteen wide fields"> |
102 | 85 | <div class="eleven wide field">
|
103 | 86 | <input type="text" name="parameter-key-add" [placeholder]="'common_name' | translate"
|
104 | 87 | [(ngModel)]="parameterValueAdd.key">
|
|
125 | 108 | <div class="wide field">
|
126 | 109 | <label>{{ 'common_workflow' | translate }}</label>
|
127 | 110 | <app-workflow-template-editor name="workflow-value"
|
128 |
| - [editable]="workflowTemplate.editable && !importFromURL" [value]="workflowValue" |
| 111 | + [editable]="workflowTemplate.editable" [value]="workflowValue" |
129 | 112 | (changeValue)="workflowValueChange($event)" [error]="workflowError">
|
130 | 113 | </app-workflow-template-editor>
|
131 | 114 | </div>
|
132 |
| - <div *ngIf="(workflowTemplate.editable && !importFromURL) || pipelineKeys.length > 0" |
| 115 | + <div *ngIf="(workflowTemplate.editable) || pipelineKeys.length > 0" |
133 | 116 | class="wide field">
|
134 | 117 | <label>Pipelines</label>
|
135 | 118 | <div class="codeContainer field" *ngFor="let k of pipelineKeys">
|
136 | 119 | <app-workflow-template-editor name="pipeline-value-{{k}}"
|
137 |
| - [editable]="workflowTemplate.editable && !importFromURL" [removable]="true" |
| 120 | + [editable]="workflowTemplate.editable" [removable]="true" |
138 | 121 | [value]="pipelineValues[k]" (changeValue)="pipelineValueChange(k, $event)"
|
139 | 122 | (remove)="clickRemovePipeline(k)" [error]="pipelineErrors[k]">
|
140 | 123 | </app-workflow-template-editor>
|
141 | 124 | </div>
|
142 |
| - <button *ngIf="workflowTemplate.editable && !importFromURL" class="ui icon green button" |
| 125 | + <button *ngIf="workflowTemplate.editable" class="ui icon green button" |
143 | 126 | (click)="clickAddPipeline()">
|
144 | 127 | <i class="plus icon"></i>
|
145 | 128 | </button>
|
146 | 129 | </div>
|
147 |
| - <div *ngIf="(workflowTemplate.editable && !importFromURL) || applicationKeys.length > 0" |
| 130 | + <div *ngIf="(workflowTemplate.editable) || applicationKeys.length > 0" |
148 | 131 | class="wide field">
|
149 | 132 | <label>Applications</label>
|
150 | 133 | <div class="codeContainer field" *ngFor="let k of applicationKeys">
|
151 | 134 | <app-workflow-template-editor name="application-value-{{k}}"
|
152 |
| - [editable]="workflowTemplate.editable && !importFromURL" [removable]="true" |
| 135 | + [editable]="workflowTemplate.editable" [removable]="true" |
153 | 136 | [value]="applicationValues[k]" (changeValue)="applicationValueChange(k, $event)"
|
154 | 137 | (remove)="clickRemoveApplication(k)" [error]="applicationErrors[k]">
|
155 | 138 | </app-workflow-template-editor>
|
156 | 139 | </div>
|
157 |
| - <button *ngIf="workflowTemplate.editable && !importFromURL" class="ui icon green button" |
| 140 | + <button *ngIf="workflowTemplate.editable" class="ui icon green button" |
158 | 141 | (click)="clickAddApplication()">
|
159 | 142 | <i class="plus icon"></i>
|
160 | 143 | </button>
|
161 | 144 | </div>
|
162 |
| - <div *ngIf="(workflowTemplate.editable && !importFromURL) || environmentKeys.length > 0" |
| 145 | + <div *ngIf="(workflowTemplate.editable) || environmentKeys.length > 0" |
163 | 146 | class="wide field">
|
164 | 147 | <label>Environments</label>
|
165 | 148 | <div class="codeContainer field" *ngFor="let k of environmentKeys">
|
166 | 149 | <app-workflow-template-editor name="environment-value-{{k}}"
|
167 |
| - [editable]="workflowTemplate.editable && !importFromURL" [removable]="true" |
| 150 | + [editable]="workflowTemplate.editable" [removable]="true" |
168 | 151 | [value]="environmentValues[k]" (changeValue)="environmentValueChange(k, $event)"
|
169 | 152 | (remove)="clickRemoveEnvironment(k)" [error]="environmentErrors[k]">
|
170 | 153 | </app-workflow-template-editor>
|
171 | 154 | </div>
|
172 |
| - <button *ngIf="workflowTemplate.editable && !importFromURL" class="ui icon green button" |
| 155 | + <button *ngIf="workflowTemplate.editable" class="ui icon green button" |
173 | 156 | (click)="clickAddEnvironment()">
|
174 | 157 | <i class="plus icon"></i>
|
175 | 158 | </button>
|
176 | 159 | </div>
|
177 |
| - <div *ngIf="workflowTemplate.editable && !importFromURL && mode === 'edit'" class="wide field"> |
| 160 | + <div *ngIf="workflowTemplate.editable && mode === 'edit'" class="wide field"> |
178 | 161 | <textarea name="changeMessage" [(ngModel)]="changeMessage"
|
179 | 162 | [placeholder]="'workflow_template_change_message' | translate" [rows]="3"></textarea>
|
180 | 163 | </div>
|
|
184 | 167 | <app-delete-button *ngIf="mode === 'edit'" class="left floated" (event)="clickDelete()"
|
185 | 168 | [loading]="loading"></app-delete-button>
|
186 | 169 | <button class="ui positive right floated button" [class.loading]="loading" (click)="clickSave()">
|
187 |
| - <ng-container *ngIf="!importFromURL"> |
| 170 | + <ng-container> |
188 | 171 | <i class="ui icon save"></i>{{ 'btn_save' | translate }}
|
189 | 172 | </ng-container>
|
190 |
| - <ng-container *ngIf="importFromURL"> |
191 |
| - <i class="ui icon cloud download"></i>{{ 'btn_synchronize' | translate }} |
192 |
| - </ng-container> |
193 | 173 | </button>
|
194 | 174 | </div>
|
195 | 175 | </div>
|
|
0 commit comments