-
Notifications
You must be signed in to change notification settings - Fork 6
/
dialog.component.html
347 lines (313 loc) · 14.7 KB
/
dialog.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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<div [ngSwitch]="data.mode" class="dialog-content">
<!-- all about USER -->
<!-- Create new user profile -->
<div *ngSwitchCase="'createUser'">
<app-dialog-header [title]="'appLabels.form.user.title.profile' | translate"
[subtitle]="'appLabels.form.user.title.new' | translate">
</app-dialog-header>
<app-user-form [name]="data.name" [projectCode]="data.project" (closeDialog)="dialogRef.close()">
</app-user-form>
</div>
<!-- Modify user data -->
<div *ngSwitchCase="'editUser'">
<app-dialog-header [title]="data.name" [subtitle]="'appLabels.form.user.title.edit' | translate">
</app-dialog-header>
<app-user-form [username]="data.name" (closeDialog)="dialogRef.close()"></app-user-form>
</div>
<!-- Update password -->
<div *ngSwitchCase="'editPassword'">
<app-dialog-header [title]="data.name" [subtitle]="'appLabels.form.user.title.password' | translate">
</app-dialog-header>
<app-password-form [username]="data.name" (closeDialog)="dialogRef.close()"></app-password-form>
</div>
<!-- Delete user -->
<div *ngSwitchCase="'deleteUser'">
<app-dialog-header [title]="data.name" [subtitle]="'Suspend user'"></app-dialog-header>
Do you want to suspend this user?
<!-- TODO: create a mat dialog actions component with the following buttons: Cancel to reset and OK to confirm action -->
<mat-dialog-actions>
<button mat-button mat-dialog-close class="cancel-button center" [mat-dialog-close]="false">
Cancel
</button>
<span class="fill-remaining-space"></span>
<button mat-button mat-raised-button [color]="'warn'" class="confirm-button center"
[mat-dialog-close]="true">
Suspend
</button>
</mat-dialog-actions>
</div>
<!-- Reactivate user -->
<div *ngSwitchCase="'activateUser'">
<app-dialog-header [title]="data.name" [subtitle]="'Activate user'"></app-dialog-header>
Do you want to reactivate this user?
<mat-dialog-actions>
<button mat-button mat-dialog-close class="cancel-button center" [mat-dialog-close]="false">
Cancel
</button>
<span class="fill-remaining-space"></span>
<button mat-button mat-raised-button [color]="'primary'" class="confirm-button center"
[mat-dialog-close]="true">
Reactivate
</button>
</mat-dialog-actions>
</div>
<!-- Remove user from project -->
<div *ngSwitchCase="'removeFromProject'">
<app-dialog-header [title]="data.name" [subtitle]="'Remove user from Project'"></app-dialog-header>
Do you want to remove this user from the project?
<mat-dialog-actions>
<button mat-button mat-dialog-close class="cancel-button center" [mat-dialog-close]="false">
Cancel
</button>
<span class="fill-remaining-space"></span>
<button mat-button mat-raised-button [color]="'accent'" class="confirm-button center"
[mat-dialog-close]="true">
Remove
</button>
</mat-dialog-actions>
</div>
<!-- Manage user project membership -->
<div *ngSwitchCase="'manageProjectMembership'">
<app-dialog-header [title]="data.name" [subtitle]="'Manage project membership'">
</app-dialog-header>
<app-membership [username]="data.name" (closeDialog)="dialogRef.close()"></app-membership>
<mat-dialog-actions>
<button mat-button mat-dialog-close class="cancel-button center" [mat-dialog-close]="false">
Cancel
</button>
</mat-dialog-actions>
</div>
<!-- all about PROJECT -->
<!-- Create project -->
<div *ngSwitchCase="'createProject'">
<app-dialog-header [title]="'appLabels.form.project.title.profile' | translate"
[subtitle]="'appLabels.form.project.title.new' | translate">
</app-dialog-header>
<app-project-form (closeDialog)="dialogRef.close()"></app-project-form>
</div>
<!-- Modify project information -->
<div *ngSwitchCase="'editProject'">
<app-dialog-header [title]="data.name" [subtitle]="'appLabels.form.project.title.edit' | translate">
</app-dialog-header>
<app-project-form [projectCode]="data.project" (closeDialog)="dialogRef.close()"></app-project-form>
</div>
<!-- Delete project -->
<div *ngSwitchCase="'deleteProject'">
<app-dialog-header [title]="data.name" [subtitle]="'appLabels.form.project.title.delete' | translate">
</app-dialog-header>
Do you want to deactivate this project?
<mat-dialog-actions>
<button mat-button mat-dialog-close class="cancel-button center" [mat-dialog-close]="false">
Cancel
</button>
<span class="fill-remaining-space"></span>
<button mat-button mat-raised-button [color]="'warn'" class="confirm-button center"
[mat-dialog-close]="true">
Deactivate
</button>
</mat-dialog-actions>
</div>
<!-- Reactivate project -->
<div *ngSwitchCase="'activateProject'">
<app-dialog-header [title]="data.name" [subtitle]="'appLabels.form.project.title.activate' | translate">
</app-dialog-header>
Do you want to reactivate this project?
<mat-dialog-actions>
<button mat-button mat-dialog-close class="cancel-button center" [mat-dialog-close]="false">
Cancel
</button>
<span class="fill-remaining-space"></span>
<button mat-button mat-raised-button [color]="'primary'" class="confirm-button center"
[mat-dialog-close]="true">
Reactivate
</button>
</mat-dialog-actions>
</div>
<!-- all about LISTS -->
<!-- Create new list -->
<div *ngSwitchCase="'createList'">
<app-dialog-header [title]="'Create new list'" [subtitle]=""></app-dialog-header>
<app-list-info-form [projectCode]="data.project" [mode]="'create'" [projectIri]="data.id"
(closeDialog)="dialogRef.close($event)">
</app-list-info-form>
</div>
<!-- Insert list child node -->
<div *ngSwitchCase="'insertListNode'">
<app-dialog-header [title]="'Insert new child node'" [subtitle]="">
</app-dialog-header>
<app-edit-list-item [iri]="data.id" [projectIri]="data.project" mode="insert" [projectCode]="data.projectCode"
[parentIri]="data.parentIri" [position]="data.position" (closeDialog)="dialogRef.close($event)">
</app-edit-list-item>
</div>
<!-- Update list info -->
<div *ngSwitchCase="'editListInfo'">
<app-dialog-header [title]="data.title" [subtitle]="'Edit list info'">
</app-dialog-header>
<app-list-info-form [iri]="data.id" [mode]="'update'" [projectIri]="data.project"
(closeDialog)="dialogRef.close()">
</app-list-info-form>
</div>
<!-- Update list child node -->
<div *ngSwitchCase="'editListNode'">
<app-dialog-header [title]="data.title" [subtitle]="'Edit child node'">
</app-dialog-header>
<app-edit-list-item [iri]="data.id" [projectIri]="data.project" mode="update"
(closeDialog)="dialogRef.close($event)"></app-edit-list-item>
</div>
<!-- Delete list node-->
<div *ngSwitchCase="'deleteListNode'">
<app-dialog-header [title]="data.title" [subtitle]="'appLabels.form.lists.title.deleteListNode' | translate">
</app-dialog-header>
Do you want to delete this node?
<mat-dialog-actions>
<button mat-button mat-dialog-close class="cancel-button center" [mat-dialog-close]="false">
Cancel
</button>
<span class="fill-remaining-space"></span>
<button mat-button mat-raised-button [color]="'warn'" class="confirm-button center"
[mat-dialog-close]="true">
Delete
</button>
</mat-dialog-actions>
</div>
<!-- Delete list node error-->
<div *ngSwitchCase="'deleteListNodeError'">
Unable to delete this list node as it is in use.
<mat-dialog-actions>
<span class="fill-remaining-space"></span>
<button mat-button mat-raised-button [color]="'warn'" class="confirm-button center"
[mat-dialog-close]="true">
Okay
</button>
</mat-dialog-actions>
</div>
<!-- Delete list -->
<div *ngSwitchCase="'deleteList'">
<app-dialog-header [title]="data.title" [subtitle]="'appLabels.form.lists.title.deleteList' | translate">
</app-dialog-header>
Do you want to delete this list?
<mat-dialog-actions>
<button mat-button mat-dialog-close class="cancel-button center" [mat-dialog-close]="false">
Cancel
</button>
<span class="fill-remaining-space"></span>
<button mat-button mat-raised-button [color]="'warn'" class="confirm-button center"
[mat-dialog-close]="true">
Delete
</button>
</mat-dialog-actions>
</div>
<!-- Ontology editor: create new ontology -->
<div *ngSwitchCase="'createOntology'">
<app-dialog-header [title]="data.title" [subtitle]="'Create new'"></app-dialog-header>
<app-ontology-form [projectCode]="data.project" (closeDialog)="dialogRef.close($event)"
[existingOntologyNames]="data.existing"></app-ontology-form>
</div>
<div *ngSwitchCase="'editOntology'">
<app-dialog-header [title]="data.title" [subtitle]="'Customize data model'" (close)="dialogRef.close()">
</app-dialog-header>
<app-ontology-form [iri]="data.id" [projectCode]="data.project" (closeDialog)="dialogRef.close($event)"
[existingOntologyNames]="data.existing"></app-ontology-form>
</div>
<div *ngSwitchCase="'deleteOntology'">
<app-dialog-header [title]="data.title" [subtitle]="'Delete data model'"></app-dialog-header>
Do you want to delete this data model?
<mat-dialog-actions>
<button mat-button mat-dialog-close class="cancel-button center" [mat-dialog-close]="false">
Cancel
</button>
<span class="fill-remaining-space"></span>
<button mat-button mat-raised-button [color]="'warn'" class="confirm-button center"
[mat-dialog-close]="true">
Delete
</button>
</mat-dialog-actions>
</div>
<!-- Ontology editor: customize and add resource class -->
<div *ngSwitchCase="'createResourceClass'">
<app-dialog-header [title]="data.title" [subtitle]="data.subtitle"></app-dialog-header>
<app-resource-class-form [iri]="data.id" [name]="data.title" [projectCode]="data.project"
(closeDialog)="dialogRef.close()" (updateParent)="replaceTitle($event)">
</app-resource-class-form>
</div>
<div *ngSwitchCase="'editResourceClass'">
<app-dialog-header [title]="data.title" [subtitle]="data.subtitle">
</app-dialog-header>
<app-resource-class-form [iri]="data.id" [name]="data.title" [projectCode]="data.project"
[showResourceClassForm]="true" [edit]="true" (closeDialog)="dialogRef.close()">
</app-resource-class-form>
</div>
<div *ngSwitchCase="'deleteResourceClass'">
<app-dialog-header [title]="data.title" [subtitle]="'Delete resource class'"></app-dialog-header>
Do you want to delete this resource class?
<mat-dialog-actions>
<button mat-button mat-dialog-close class="cancel-button center" [mat-dialog-close]="false">
Cancel
</button>
<span class="fill-remaining-space"></span>
<button mat-button mat-raised-button [color]="'warn'" class="confirm-button center"
[mat-dialog-close]="true">
Delete
</button>
</mat-dialog-actions>
</div>
<div *ngSwitchCase="'updateCardinality'">
<app-dialog-header [title]="data.title" [subtitle]="data.subtitle">
</app-dialog-header>
<app-resource-class-form [iri]="data.id" [name]="data.title" [projectCode]="data.project"
[showResourceClassForm]="false" [edit]="true" (closeDialog)="dialogRef.close()">
</app-resource-class-form>
</div>
<div *ngSwitchCase="'createProperty'">
<app-dialog-header [title]="data.title" [subtitle]="data.subtitle">
</app-dialog-header>
<app-property-form [propertyInfo]="data.propInfo" (closeDialog)="dialogRef.close()">
</app-property-form>
</div>
<div *ngSwitchCase="'editProperty'">
<app-dialog-header [title]="data.title" [subtitle]="data.subtitle">
</app-dialog-header>
<app-property-form [propertyInfo]="data.propInfo" (closeDialog)="dialogRef.close()">
</app-property-form>
</div>
<div *ngSwitchCase="'deleteProperty'">
<app-dialog-header [title]="data.title" [subtitle]="'Delete property'"></app-dialog-header>
Do you want to delete this property?
<mat-dialog-actions>
<button mat-button mat-dialog-close class="cancel-button center" [mat-dialog-close]="false">
Cancel
</button>
<span class="fill-remaining-space"></span>
<button mat-button mat-raised-button [color]="'warn'" class="confirm-button center"
[mat-dialog-close]="true">
Delete
</button>
</mat-dialog-actions>
</div>
<!-- all about RESOURCE -->
<!-- Create resource -->
<div *ngSwitchCase="'createResource'">
<app-dialog-header [title]="data.title" [subtitle]="data.subtitle">
</app-dialog-header>
<app-resource-instance-form (closeDialog)="dialogRef.close()" (updateParent)="replaceTitle($event)">
</app-resource-instance-form>
</div>
<!-- general error message -->
<div *ngSwitchCase="'error'">
<app-error [status]="data.id"></app-error>
</div>
<!-- Unknown method (or not yet defined) -->
<!-- Default dialog content component -->
<div *ngSwitchDefault>
<app-dialog-header [title]="'Not yet implemented'" [subtitle]="'ERROR 400'" (close)="dialogRef.close()">
</app-dialog-header>
<p class="todo" [innerHtml]="notYetImplemented"></p>
<mat-dialog-actions>
<span class="fill-remaining-space"></span>
<button mat-button mat-dialog-close class="cancel-button center" [mat-dialog-close]="false">
OK
</button>
<span class="fill-remaining-space"></span>
</mat-dialog-actions>
</div>
</div>