/
plans.component.html
144 lines (136 loc) · 6.42 KB
/
plans.component.html
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
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright (c) 2017-2018 Contributors to the Eclipse Foundation
~
~ See the NOTICE file(s) distributed with this work for additional
~ information regarding copyright ownership.
~
~ This program and the accompanying materials are made available under the
~ terms of the Eclipse Public License 2.0 which is available at
~ http://www.eclipse.org/legal/epl-2.0, or the Apache Software License 2.0
~ which is available at https://www.apache.org/licenses/LICENSE-2.0.
~
~ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<div *ngIf="loading; else elseBlock">
<winery-loader></winery-loader>
</div>
<ng-template #elseBlock>
<winery-table *ngIf="plansApiData"
[title]="'Embedded Plans'"
[columns]="embeddedPlansColumns"
[data]="plansApiData"
[disableButtons]="!sharedData?.currentVersion?.editable"
[enableEditButton]="enableEditButton"
[enableIOButton]="true"
(cellSelected)="onCellSelected($event)"
(addBtnClicked)="onAddPlanType();"
(editBtnClicked)="onEditPlan($event);"
(removeBtnClicked)="onRemovePlan($event);"
(ioBtnClicked)="onEditPlanIOParameters($event);">
<div class="button-group pull-right">
<button type="button" class="btn btn-primary"
(click)="onGeneratePlans()">
Generate Plans
</button>
</div>
</winery-table>
<winery-table *ngIf="linkedPlans"
[title]="'Linked Plans'"
[columns]="linkedPlansColumns"
[data]="linkedPlans"
[disableButtons]="true">
</winery-table>
</ng-template>
<winery-modal bsModal #addPlanModal="bs-modal" [modalRef]="addPlanModal">
<winery-modal-header [title]="'Add Plan'">
</winery-modal-header>
<winery-modal-body>
<form #addPlanFrom="ngForm" id="addPlanForm">
<div class="form-group">
<label class="control-label" for="key">Name</label>
<input #propName="ngModel"
id="key"
class="form-control"
type="text"
name="key"
autocomplete=off
required
[(ngModel)]="newPlan.name"/>
<div *ngIf="propName.errors && (propName.dirty || propName.touched)"
class="alert alert-danger">
<div [hidden]="!propName.errors.required">
Name is required
</div>
</div>
</div>
<div class="form-group">
<label class="control-label" for="planType">Type</label>
<ng-select id="planType" [items]="planTypes" [active]="[selectedPlanType]"
(selected)="planTypeSelected($event)"></ng-select>
<button class="btn btn-info btn-xs" (click)="refreshPlanTypes()">Refresh</button>
<button class="btn btn-info btn-xs" [routerLink]="['/admin/plantypes']">Manage</button>
</div>
<div class="form-group">
<label class="control-label" for="planLanguage">Language</label>
<ng-select id="planLanguage" [items]="planLanguages" [active]="[selectedPlanLanguage]"
(selected)="planLanguageSelected($event)"></ng-select>
<button class="btn btn-info btn-xs" (click)="refreshPlanLanguages()">Refresh</button>
<button class="btn btn-info btn-xs" [routerLink]="['/admin/planlanguages']">Manage</button>
</div>
<div [hidden]="!showArchiveUpload" class="form-group">
<label for="uploader">Archive</label>
<winery-uploader #uploader id="uploader"
[uploadUrl]="uploaderUrl"
(onFileDropped)="onFileDropped($event);"
[uploadImmediately]="false"
[uploadMethod]="'PUT'"
[isEditable]="sharedData?.currentVersion?.editable"
(onSuccess)="getPlanTypesData()"
(onError)="handleError($event)">
</winery-uploader>
</div>
</form>
</winery-modal-body>
<winery-modal-footer
(onOk)="addPlan()"
[closeButtonLabel]="'Cancel'"
[okButtonLabel]="'Add'"
[disableOkButton]="!addPlanFrom?.form.valid || !fileDropped">
</winery-modal-footer>
</winery-modal>
<ng-template #ioModal>
<winery-modal-header [modalRef]="ioModalRef" [title]="'Edit Parameters'">
</winery-modal-header>
<winery-modal-body>
<winery-io-parameter [inputParameters]="newPlan.inputParameters.inputParameter"
[outputParameters]="newPlan.outputParameters.outputParameter">
</winery-io-parameter>
</winery-modal-body>
<winery-modal-footer
[modalRef]="ioModalRef"
(onOk)="editPlan()"
[closeButtonLabel]="'Cancel'"
[okButtonLabel]="'Save'">
</winery-modal-footer>
</ng-template>
<winery-modal bsModal #confirmDeleteModal="bs-modal" [modalRef]="confirmDeleteModal">
<winery-modal-header [title]="'Delete Property'">
</winery-modal-header>
<winery-modal-body>
<p *ngIf="elementToRemove != null">
Do you want to delete the Element <span style="font-weight:bold;">{{ elementToRemove.name }}</span>?
</p>
</winery-modal-body>
<winery-modal-footer (onOk)="deletePlan();"
[closeButtonLabel]="'Cancel'"
[okButtonLabel]="'Delete'">
</winery-modal-footer>
</winery-modal>
<winery-modal bsModal #confirmPlanGeneration="bs-modal" [modalRef]="confirmPlanGeneration">
<winery-modal-header [title]="'Generate Plans'"></winery-modal-header>
<winery-modal-body>
<p>Do you want to generate plans for your Service Template?<br>Existing plans may get overridden.</p>
</winery-modal-body>
<winery-modal-footer (onOk)="generatePlans()" [closeButtonLabel]="'Cancel'"
[okButtonLabel]="'Generate'"></winery-modal-footer>
</winery-modal>