@juice-js/tenants 1.1.2-alpha.3 → 1.1.2-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/esm2022/lib/confirm-dialog/confirm-dialog.component.mjs +53 -0
  2. package/{esm2020 → esm2022}/lib/shared/material.module.mjs +59 -59
  3. package/{esm2020 → esm2022}/lib/shared/services/tenant-admin.service.mjs +4 -4
  4. package/esm2022/lib/tenant-create/tenant-create.component.mjs +69 -0
  5. package/esm2022/lib/tenant-detail/tenant-detail.component.mjs +40 -0
  6. package/esm2022/lib/tenant-settings/tenant-settings.component.mjs +46 -0
  7. package/esm2022/lib/tenant-summary/tenant-summary.component.mjs +32 -0
  8. package/esm2022/lib/tenant-update/tenant-update.component.mjs +77 -0
  9. package/esm2022/lib/tenants.component.mjs +503 -0
  10. package/esm2022/lib/tenants.module.mjs +93 -0
  11. package/fesm2022/juice-js-tenants.mjs +1148 -0
  12. package/fesm2022/juice-js-tenants.mjs.map +1 -0
  13. package/lib/tenant-detail/tenant-detail.component.d.ts +1 -1
  14. package/lib/tenant-settings/tenant-settings.component.d.ts +17 -0
  15. package/lib/tenant-summary/tenant-summary.component.d.ts +1 -1
  16. package/lib/tenant-update/tenant-update.component.d.ts +1 -1
  17. package/lib/tenants.module.d.ts +9 -7
  18. package/package.json +10 -23
  19. package/theming/_tenants.component-theme.scss +37 -37
  20. package/esm2020/lib/confirm-dialog/confirm-dialog.component.mjs +0 -53
  21. package/esm2020/lib/tenant-create/tenant-create.component.mjs +0 -69
  22. package/esm2020/lib/tenant-detail/tenant-detail.component.mjs +0 -36
  23. package/esm2020/lib/tenant-summary/tenant-summary.component.mjs +0 -30
  24. package/esm2020/lib/tenant-update/tenant-update.component.mjs +0 -77
  25. package/esm2020/lib/tenants.component.mjs +0 -502
  26. package/esm2020/lib/tenants.module.mjs +0 -86
  27. package/fesm2015/juice-js-tenants.mjs +0 -1109
  28. package/fesm2015/juice-js-tenants.mjs.map +0 -1
  29. package/fesm2020/juice-js-tenants.mjs +0 -1101
  30. package/fesm2020/juice-js-tenants.mjs.map +0 -1
  31. /package/{esm2020 → esm2022}/juice-js-tenants.mjs +0 -0
  32. /package/{esm2020 → esm2022}/lib/shared/custom-error-state-matcher.mjs +0 -0
  33. /package/{esm2020 → esm2022}/lib/shared/models/table.query-result.mjs +0 -0
  34. /package/{esm2020 → esm2022}/lib/shared/models/tenant.create.model.mjs +0 -0
  35. /package/{esm2020 → esm2022}/lib/shared/models/tenant.model.mjs +0 -0
  36. /package/{esm2020 → esm2022}/lib/shared/models/tenant.setting.model.mjs +0 -0
  37. /package/{esm2020 → esm2022}/lib/shared/models/tenant.status.mjs +0 -0
  38. /package/{esm2020 → esm2022}/lib/shared/models/tenant.update.model.mjs +0 -0
  39. /package/{esm2020 → esm2022}/lib/shared/tenant-configuration.mjs +0 -0
  40. /package/{esm2020 → esm2022}/public-api.mjs +0 -0
@@ -0,0 +1,1148 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, Input, Output, ViewChild, Inject, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/common/http';
4
+ import { HttpParams } from '@angular/common/http';
5
+ import * as i19 from 'ngx-mat-multi-sort';
6
+ import { TableData, MatMultiSortTableDataSource, MatMultiSort, MatMultiSortModule } from 'ngx-mat-multi-sort';
7
+ import * as i14 from '@angular/material/paginator';
8
+ import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
9
+ import * as i4$2 from '@angular/forms';
10
+ import { FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
11
+ import * as i4$1 from '@juice-js/dict-builder';
12
+ import { ModelType, KeyValue, DictBuilderModule } from '@juice-js/dict-builder';
13
+ import * as i3 from '@angular/material/button';
14
+ import { MatButtonModule } from '@angular/material/button';
15
+ import * as i4 from '@angular/material/dialog';
16
+ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
17
+ import * as i5 from '@angular/material/icon';
18
+ import { MatIconModule } from '@angular/material/icon';
19
+ import * as i7 from '@ngx-translate/core';
20
+ import { TranslateModule } from '@ngx-translate/core';
21
+ import * as i2 from '@angular/router';
22
+ import * as i3$1 from '@angular/common';
23
+ import { CommonModule } from '@angular/common';
24
+ import * as i6 from '@angular/material/snack-bar';
25
+ import { MatSnackBarModule } from '@angular/material/snack-bar';
26
+ import * as i7$1 from '@angular/material/input';
27
+ import { MatInputModule } from '@angular/material/input';
28
+ import * as i8 from '@angular/material/form-field';
29
+ import * as i13 from '@angular/material/menu';
30
+ import { MatMenuModule } from '@angular/material/menu';
31
+ import * as i15 from '@angular/material/select';
32
+ import { MatSelectModule } from '@angular/material/select';
33
+ import * as i16 from '@angular/material/core';
34
+ import { MatNativeDateModule, MatRippleModule } from '@angular/material/core';
35
+ import * as i17 from '@angular/material/table';
36
+ import { MatTableModule } from '@angular/material/table';
37
+ import * as i18 from '@angular/cdk/clipboard';
38
+ import { ClipboardModule } from '@angular/cdk/clipboard';
39
+ import * as i6$1 from '@angular/material/list';
40
+ import { MatListModule } from '@angular/material/list';
41
+ import { MatCardModule } from '@angular/material/card';
42
+ import { MatCheckboxModule } from '@angular/material/checkbox';
43
+ import { MatDatepickerModule } from '@angular/material/datepicker';
44
+ import { MatDividerModule } from '@angular/material/divider';
45
+ import { MatExpansionModule } from '@angular/material/expansion';
46
+ import { MatGridListModule } from '@angular/material/grid-list';
47
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
48
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
49
+ import { MatRadioModule } from '@angular/material/radio';
50
+ import { MatSliderModule } from '@angular/material/slider';
51
+ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
52
+ import { MatSortModule } from '@angular/material/sort';
53
+ import { MatTabsModule } from '@angular/material/tabs';
54
+ import { MatToolbarModule } from '@angular/material/toolbar';
55
+ import { MatTooltipModule } from '@angular/material/tooltip';
56
+ import { MatTreeModule } from '@angular/material/tree';
57
+
58
+ // import { InjectionToken } from '@angular/core';
59
+ // export const TENANT_OPTIONS_TOKEN = new InjectionToken<TenantConfiguration>('tenant.options');
60
+ class TenantConfiguration {
61
+ constructor() {
62
+ this.apiEndpoint = "";
63
+ this.apiVersion = "2";
64
+ this.dialogWidth = "800px";
65
+ this.dialogMaxHeight = "600px";
66
+ }
67
+ }
68
+
69
+ class TenantAdminService {
70
+ constructor(http, options) {
71
+ this.http = http;
72
+ this.options = options;
73
+ }
74
+ getTenants(filterText = "", statuses = [], sortColumns = [], sortDirections = [], pageIndex = 0, pageSize = 20) {
75
+ var params = new HttpParams()
76
+ .set('q', filterText)
77
+ .set('page', pageIndex + 1)
78
+ .set('pageSize', pageSize);
79
+ if (statuses.length > 0) {
80
+ for (var i = 0; i < statuses.length; i++) {
81
+ params = params.append('statuses', statuses[i]);
82
+ }
83
+ }
84
+ if (sortColumns.length > 0) {
85
+ if (sortDirections.length != sortColumns.length)
86
+ throw new Error("sortColumns and sortDirections must be the same length");
87
+ for (var i = 0; i < sortColumns.length; i++) {
88
+ params = params.set("sorts[" + i + "].property", sortColumns[i])
89
+ .set("sorts[" + i + "].sortDir", sortDirections[i]);
90
+ }
91
+ }
92
+ return this.http.get(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/tenants`, { params: params });
93
+ }
94
+ getTenant(identifier) {
95
+ return this.http.get(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${identifier}`);
96
+ }
97
+ getSummary(identifier) {
98
+ return this.http.get(`${this.options.apiEndpoint}/${identifier}/api/v${this.options.apiVersion}/operation`);
99
+ }
100
+ createTenant(tenant) {
101
+ return this.http.post(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin`, tenant);
102
+ }
103
+ updateTenant(id, tenant) {
104
+ return this.http.put(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}`, tenant);
105
+ }
106
+ deleteTenant(id) {
107
+ return this.http.delete(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}`);
108
+ }
109
+ activateTenant(id) {
110
+ return this.http.post(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/activate`, null);
111
+ }
112
+ deactivateTenant(id) {
113
+ return this.http.post(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/deactivate`, null);
114
+ }
115
+ reactivateTenant(id) {
116
+ return this.http.post(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/reactivate`, null);
117
+ }
118
+ suspendTenant(id) {
119
+ return this.http.post(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/suspend`, null);
120
+ }
121
+ approveTenant(id) {
122
+ return this.http.post(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/approve`, null);
123
+ }
124
+ rejectTenant(id) {
125
+ return this.http.post(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/reject`, null);
126
+ }
127
+ abandonTenant(id) {
128
+ return this.http.put(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/abandon`, null);
129
+ }
130
+ getTenantSettings(id) {
131
+ return this.http.get(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/settings`);
132
+ }
133
+ updateTenantSettings(id, settings) {
134
+ return this.http.put(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/admin/${id}/settings`, settings);
135
+ }
136
+ getRootSettings() {
137
+ return this.http.get(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/settings`);
138
+ }
139
+ updateRootSettings(settings) {
140
+ return this.http.put(`${this.options.apiEndpoint}/api/v${this.options.apiVersion}/settings`, settings);
141
+ }
142
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantAdminService, deps: [{ token: i1.HttpClient }, { token: TenantConfiguration }], target: i0.ɵɵFactoryTarget.Injectable }); }
143
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantAdminService, providedIn: 'root' }); }
144
+ }
145
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantAdminService, decorators: [{
146
+ type: Injectable,
147
+ args: [{
148
+ providedIn: 'root'
149
+ }]
150
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: TenantConfiguration }]; } });
151
+
152
+ var TenantStatus;
153
+ (function (TenantStatus) {
154
+ TenantStatus[TenantStatus["New"] = 0] = "New";
155
+ TenantStatus[TenantStatus["PendingApproval"] = 1] = "PendingApproval";
156
+ TenantStatus[TenantStatus["Approved"] = 2] = "Approved";
157
+ TenantStatus[TenantStatus["Rejected"] = 3] = "Rejected";
158
+ TenantStatus[TenantStatus["Initializing"] = 4] = "Initializing";
159
+ TenantStatus[TenantStatus["Initialized"] = 5] = "Initialized";
160
+ TenantStatus[TenantStatus["PendingToActive"] = 6] = "PendingToActive";
161
+ TenantStatus[TenantStatus["Inactive"] = 7] = "Inactive";
162
+ TenantStatus[TenantStatus["Active"] = 8] = "Active";
163
+ TenantStatus[TenantStatus["Suspended"] = 9] = "Suspended";
164
+ TenantStatus[TenantStatus["Abandoned"] = 10] = "Abandoned";
165
+ })(TenantStatus || (TenantStatus = {}));
166
+ class TenantStatusHelper {
167
+ static getColor(status) {
168
+ var s = (typeof status == "string" ? TenantStatus[status] : status);
169
+ switch (s) {
170
+ case TenantStatus.New:
171
+ return "accent-color";
172
+ case TenantStatus.Initialized:
173
+ return "success-color";
174
+ case TenantStatus.Approved:
175
+ return "success-color";
176
+ case TenantStatus.PendingApproval:
177
+ return "accent-color";
178
+ case TenantStatus.PendingToActive:
179
+ return "accent-color";
180
+ case TenantStatus.Active:
181
+ return "success-color";
182
+ case TenantStatus.Inactive:
183
+ return "warn-color";
184
+ case TenantStatus.Suspended:
185
+ return "warn-color";
186
+ case TenantStatus.Abandoned:
187
+ return "warn-color";
188
+ default:
189
+ return "";
190
+ }
191
+ }
192
+ }
193
+
194
+ class TenantSetting {
195
+ constructor(key, value, inherited = false, overridden = false) {
196
+ this.key = "";
197
+ this.value = "";
198
+ this.inherited = false;
199
+ this.overridden = false;
200
+ this.key = key;
201
+ this.value = value;
202
+ this.inherited = inherited;
203
+ this.overridden = overridden;
204
+ }
205
+ }
206
+
207
+ class TenantSettingsComponent {
208
+ constructor() {
209
+ this.title = "Settings";
210
+ this.saved = new EventEmitter();
211
+ this.cancelled = new EventEmitter();
212
+ this.type = ModelType.StandardObject;
213
+ this.loading = false;
214
+ }
215
+ setModel(model) {
216
+ this.dictBuilder.models = model;
217
+ }
218
+ getModel() {
219
+ return this.dictBuilder.models;
220
+ }
221
+ save() {
222
+ var model = this.dictBuilder.save();
223
+ this.saved.emit(model);
224
+ }
225
+ cancel() {
226
+ this.cancelled.emit();
227
+ }
228
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantSettingsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
229
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TenantSettingsComponent, selector: "juice-tenant-settings", inputs: { title: "title" }, outputs: { saved: "saved", cancelled: "cancelled" }, viewQueries: [{ propertyName: "dictBuilder", first: true, predicate: ["dict"], descendants: true }], ngImport: i0, template: "<h2 mat-dialog-title>{{ title | translate }}</h2>\n<mat-dialog-content>\n <juice-dict-builder #dict></juice-dict-builder>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button [disabled]=\"loading\" color=\"primary\" (click)=\"save()\"><mat-icon>save</mat-icon>{{ 'Save' | translate }}</button>\n <button mat-raised-button (click)=\"cancel()\"><mat-icon>cancel</mat-icon>{{ 'Cancel' | translate }}</button>\n</mat-dialog-actions>", styles: [""], dependencies: [{ kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$1.DictBuilderComponent, selector: "juice-dict-builder", inputs: ["model", "parent", "type"], outputs: ["onchange"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] }); }
230
+ }
231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantSettingsComponent, decorators: [{
232
+ type: Component,
233
+ args: [{ selector: 'juice-tenant-settings', template: "<h2 mat-dialog-title>{{ title | translate }}</h2>\n<mat-dialog-content>\n <juice-dict-builder #dict></juice-dict-builder>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button [disabled]=\"loading\" color=\"primary\" (click)=\"save()\"><mat-icon>save</mat-icon>{{ 'Save' | translate }}</button>\n <button mat-raised-button (click)=\"cancel()\"><mat-icon>cancel</mat-icon>{{ 'Cancel' | translate }}</button>\n</mat-dialog-actions>" }]
234
+ }], propDecorators: { title: [{
235
+ type: Input
236
+ }], saved: [{
237
+ type: Output
238
+ }], cancelled: [{
239
+ type: Output
240
+ }], dictBuilder: [{
241
+ type: ViewChild,
242
+ args: ['dict']
243
+ }] } });
244
+
245
+ class TenantsComponent {
246
+ get statuses() {
247
+ return this.form.get("statuses");
248
+ }
249
+ get filterText() {
250
+ return this.form.get("filterText");
251
+ }
252
+ constructor(tenantService, router, route, location, serializer, fb, dialog, snackBar, localizer, options) {
253
+ this.tenantService = tenantService;
254
+ this.router = router;
255
+ this.route = route;
256
+ this.location = location;
257
+ this.serializer = serializer;
258
+ this.fb = fb;
259
+ this.dialog = dialog;
260
+ this.snackBar = snackBar;
261
+ this.localizer = localizer;
262
+ this.options = options;
263
+ this.displayedColumns = ['name', 'identifier', 'status', 'actions'];
264
+ this.tenantStatus = TenantStatus;
265
+ this.statusHelper = TenantStatusHelper;
266
+ this.statusOptions = Object.values(TenantStatus).filter(value => typeof value === 'string')
267
+ .map(value => value);
268
+ this.form = new FormGroup({});
269
+ this.table = new TableData([
270
+ { id: 'id', name: 'Id' },
271
+ { id: 'name', name: 'Name' },
272
+ { id: 'identifier', name: 'Identifier' },
273
+ { id: 'status', name: 'Status' },
274
+ { id: 'actions', name: 'Actions' }
275
+ ]);
276
+ this.table.dataSource = new MatMultiSortTableDataSource(new MatMultiSort(), false);
277
+ this.table.displayedColumns = this.displayedColumns;
278
+ }
279
+ initRouteEvents() {
280
+ let firstLoad = true;
281
+ this.route.queryParams.subscribe(params => {
282
+ console.debug("route.queryParams.subscribe", params, firstLoad);
283
+ if (firstLoad) {
284
+ firstLoad = false;
285
+ this.initFormAndTableEvents();
286
+ this.getData(true);
287
+ return;
288
+ }
289
+ var q = params['q'] || "";
290
+ this.filterText?.setValue(q);
291
+ if (!params['statuses']) {
292
+ this.statuses?.setValue([]);
293
+ }
294
+ else {
295
+ this.statuses?.setValue(Array.isArray(params['statuses']) ? params['statuses'] : [params['statuses']]);
296
+ }
297
+ this.table.pageSize = params['pageSize'] ? Number.parseInt(params['pageSize']) : 10;
298
+ this.table.pageIndex = params['page'] ? Number.parseInt(params['page']) : 0;
299
+ var sortParams = params['sortParams'];
300
+ var sortDirs = params['sortDirs'];
301
+ if (sortParams && sortDirs) {
302
+ if (Array.isArray(sortParams) && Array.isArray(sortDirs)) {
303
+ this.table.sortParams = sortParams;
304
+ this.table.sortDirs = sortDirs;
305
+ }
306
+ else if (typeof sortParams == "string"
307
+ && typeof (sortDirs) == "string") {
308
+ this.table.sortParams = [sortParams];
309
+ this.table.sortDirs = [sortDirs];
310
+ }
311
+ }
312
+ });
313
+ }
314
+ ngOnInit() {
315
+ this.form = this.fb.group({
316
+ filterText: [],
317
+ statuses: []
318
+ });
319
+ this.initRouteEvents();
320
+ }
321
+ initFormAndTableEvents() {
322
+ this.table.nextObservable.subscribe(() => { this.getData(); });
323
+ this.table.sortObservable.subscribe((e) => { this.getData(); });
324
+ this.table.previousObservable.subscribe(() => { this.getData(); });
325
+ this.table.sizeObservable.subscribe(() => { this.getData(); });
326
+ this.form.controls['statuses'].valueChanges.subscribe(value => {
327
+ this.getData();
328
+ });
329
+ }
330
+ ngAfterViewInit() {
331
+ this.table.dataSource.sort = this.sort;
332
+ }
333
+ //#region filters
334
+ clearStatuses() {
335
+ this.statuses?.setValue([]);
336
+ }
337
+ clearFilterText() {
338
+ this.filterText?.setValue("");
339
+ this.getData();
340
+ }
341
+ getData(fromRoute = false) {
342
+ var q = this.filterText?.value ?? "";
343
+ if (!fromRoute) {
344
+ var statuses = this.statuses?.value;
345
+ const tree = this.router.createUrlTree([], { queryParams: {
346
+ q: q,
347
+ statuses: statuses,
348
+ page: this.table.pageIndex,
349
+ pageSize: this.table.pageSize,
350
+ sortParams: this.table.sortParams,
351
+ sortDirs: this.table.sortDirs
352
+ } });
353
+ this.location.go(this.serializer.serialize(tree));
354
+ }
355
+ this.tenantService.getTenants(q, this.statuses?.value || [], this.table.sortParams, this.table.sortDirs, this.table.pageIndex, this.table.pageSize)
356
+ .subscribe((rs) => {
357
+ this.table.totalElements = rs.count;
358
+ this.table.pageIndex = rs.page - 1;
359
+ this.table.pageSize = rs.pageSize;
360
+ this.table.data = rs.data;
361
+ });
362
+ }
363
+ //#endregion
364
+ //#region actions
365
+ add() {
366
+ const dialogRef = this.dialog.open(TenantCreateComponent, {
367
+ width: this.options.dialogWidth,
368
+ maxHeight: this.options.dialogMaxHeight,
369
+ data: {}
370
+ });
371
+ let instance = dialogRef.componentInstance;
372
+ instance.created.subscribe((id) => {
373
+ this.getData();
374
+ this.openSnackBar("Tenant was created!");
375
+ dialogRef.close();
376
+ });
377
+ instance.cancelled.subscribe(() => {
378
+ this.openSnackBar("Tenant creation was cancelled!");
379
+ dialogRef.close();
380
+ });
381
+ }
382
+ edit(id) {
383
+ console.debug("edit", id);
384
+ const dialogRef = this.dialog.open(TenantUpdateComponent, {
385
+ width: this.options.dialogWidth,
386
+ maxHeight: this.options.dialogMaxHeight,
387
+ data: { id: id }
388
+ });
389
+ let instance = dialogRef.componentInstance;
390
+ instance.setId(id);
391
+ instance.updated.subscribe((id) => {
392
+ this.getData();
393
+ this.openSnackBar("Tenant was updated!");
394
+ dialogRef.close();
395
+ });
396
+ instance.cancelled.subscribe(() => {
397
+ this.openSnackBar("Tenant update was cancelled!");
398
+ dialogRef.close();
399
+ });
400
+ }
401
+ detail(id) {
402
+ const dialogRef = this.dialog.open(TenantDetailComponent, {
403
+ width: this.options.dialogWidth,
404
+ maxHeight: this.options.dialogMaxHeight,
405
+ });
406
+ let instance = dialogRef.componentInstance;
407
+ instance.loadTenant(id);
408
+ }
409
+ delete(id) {
410
+ console.debug("delete", id);
411
+ this.confirm(this.doDelete.bind(this, id), {
412
+ title: "Dangerous action!",
413
+ message: "Please confirm that you want to delete this tenant? All data will be deleted and this action cannot be undone.",
414
+ messageClasses: "warn-color",
415
+ buttonText: "Delete forever",
416
+ buttonColor: "warn"
417
+ });
418
+ }
419
+ doDelete(id) {
420
+ this.tenantService.deleteTenant(id).subscribe({
421
+ complete: () => {
422
+ this.getData();
423
+ this.openSnackBar("Tenant was deleted!");
424
+ }, error: (error) => {
425
+ this.openSnackBar("Error deleting tenant!");
426
+ console.debug(error);
427
+ }
428
+ });
429
+ }
430
+ activate(id) {
431
+ console.debug("activate", id);
432
+ this.confirm(this.doActivate.bind(this, id), {
433
+ message: "Please confirm that you want to activate this tenant.",
434
+ messageClasses: "success-color",
435
+ buttonText: "Activate",
436
+ buttonColor: "success"
437
+ });
438
+ }
439
+ doActivate(id) {
440
+ this.tenantService.activateTenant(id).subscribe({
441
+ complete: () => {
442
+ this.getData();
443
+ this.openSnackBar("Tenant was activated!");
444
+ }, error: (error) => {
445
+ this.openSnackBar("Error activating tenant!");
446
+ console.debug(error);
447
+ }
448
+ });
449
+ }
450
+ reactivate(id) {
451
+ console.debug("reactivate", id);
452
+ this.confirm(this.doReactivate.bind(this, id), {
453
+ message: "Please confirm that you want to reactivate this tenant.",
454
+ messageClasses: "success-color",
455
+ buttonText: "Reactivate"
456
+ });
457
+ }
458
+ doReactivate(id) {
459
+ this.tenantService.reactivateTenant(id).subscribe({
460
+ complete: () => {
461
+ this.getData();
462
+ this.openSnackBar("Tenant was reactivated!");
463
+ }, error: (error) => {
464
+ this.openSnackBar("Error reactivating tenant!");
465
+ console.debug(error);
466
+ }
467
+ });
468
+ }
469
+ deactivate(id) {
470
+ console.debug("deactivate", id);
471
+ this.confirm(this.doDeactivate.bind(this, id), {
472
+ message: "Please confirm that you want to deactivate this tenant. Users will not be able to login!",
473
+ messageClasses: "warn-color",
474
+ buttonText: "Deactivate",
475
+ buttonColor: "warn"
476
+ });
477
+ }
478
+ doDeactivate(id) {
479
+ this.tenantService.deactivateTenant(id).subscribe({
480
+ complete: () => {
481
+ this.getData();
482
+ this.openSnackBar("Tenant was activated!");
483
+ }, error: (error) => {
484
+ this.openSnackBar("Error activating tenant!");
485
+ console.debug(error);
486
+ }
487
+ });
488
+ }
489
+ suspend(id) {
490
+ console.debug("suspend", id);
491
+ this.confirm(this.doSuspend.bind(this, id), {
492
+ message: "Please confirm that you want to suspend this tenant. Users will not be able to login!",
493
+ messageClasses: "warn-color",
494
+ buttonText: "Suspend",
495
+ buttonColor: "warn"
496
+ });
497
+ }
498
+ doSuspend(id) {
499
+ this.tenantService.suspendTenant(id).subscribe({
500
+ complete: () => {
501
+ this.getData();
502
+ this.openSnackBar("Tenant was suspended!");
503
+ }, error: (error) => {
504
+ this.openSnackBar("Error suspending tenant!");
505
+ console.debug(error);
506
+ }
507
+ });
508
+ }
509
+ abandon(id) {
510
+ console.debug("abandon", id);
511
+ this.confirm(this.doAbandon.bind(this, id), {
512
+ message: "Please confirm that you want to abandon this tenant. All data will be deleted and this action cannot be undone.",
513
+ messageClasses: "warn-color",
514
+ buttonText: "Abandon",
515
+ buttonColor: "warn"
516
+ });
517
+ }
518
+ doAbandon(id) {
519
+ this.tenantService.abandonTenant(id).subscribe({
520
+ complete: () => {
521
+ this.getData();
522
+ this.openSnackBar("Tenant was abandoned!");
523
+ }, error: (error) => {
524
+ this.openSnackBar("Error abandoning tenant!");
525
+ console.debug(error);
526
+ }
527
+ });
528
+ }
529
+ approve(id) {
530
+ console.debug("approve", id);
531
+ this.confirm(this.doApprove.bind(this, id), {
532
+ message: "Please confirm that you want to approve this tenant.",
533
+ messageClasses: "success-color",
534
+ buttonText: "Approve",
535
+ buttonColor: "success"
536
+ });
537
+ }
538
+ doApprove(id) {
539
+ this.tenantService.approveTenant(id).subscribe({
540
+ complete: () => {
541
+ this.getData();
542
+ this.openSnackBar("Tenant was approved!");
543
+ }, error: (error) => {
544
+ this.openSnackBar("Error approving tenant!");
545
+ console.debug(error);
546
+ }
547
+ });
548
+ }
549
+ reject(id) {
550
+ console.debug("reject", id);
551
+ this.confirm(this.doReject.bind(this, id), {
552
+ message: "Please confirm that you want to reject this tenant.",
553
+ messageClasses: "warn-color",
554
+ buttonText: "Reject",
555
+ buttonColor: "warn"
556
+ });
557
+ }
558
+ doReject(id) {
559
+ this.tenantService.rejectTenant(id).subscribe({
560
+ complete: () => {
561
+ this.getData();
562
+ this.openSnackBar("Tenant was rejected!");
563
+ }, error: (error) => {
564
+ this.openSnackBar("Error rejecting tenant!");
565
+ console.debug(error);
566
+ }
567
+ });
568
+ }
569
+ settings(id) {
570
+ const dialogRef = this.dialog.open(TenantSettingsComponent, {
571
+ width: this.options.dialogWidth,
572
+ maxHeight: this.options.dialogMaxHeight,
573
+ });
574
+ let instance = dialogRef.componentInstance;
575
+ instance.title = "Tenant settings";
576
+ instance.loading = true;
577
+ instance.type = ModelType.Configuration;
578
+ this.tenantService.getTenantSettings(id).subscribe({
579
+ next: (settings) => {
580
+ instance.loading = false;
581
+ instance.setModel(settings.map(s => new KeyValue(s.key, s.value, s.inherited, s.overridden)));
582
+ }, error: (error) => {
583
+ this.openSnackBar("Error getting tenant settings!");
584
+ console.debug(error);
585
+ }
586
+ });
587
+ instance.saved.subscribe((model) => {
588
+ var settings = instance.getModel().map(m => new TenantSetting(m.key, m.value, m.inherited));
589
+ this.tenantService.updateTenantSettings(id, settings).subscribe({
590
+ next: () => {
591
+ this.openSnackBar("Tenant settings was updated!");
592
+ dialogRef.close();
593
+ }, error: (error) => {
594
+ this.openSnackBar("Error updating tenant settings!");
595
+ console.debug(error);
596
+ }
597
+ });
598
+ });
599
+ instance.cancelled.subscribe(() => {
600
+ this.openSnackBar("Tenant setting was cancelled!");
601
+ dialogRef.close();
602
+ });
603
+ }
604
+ rootSettings() {
605
+ const dialogRef = this.dialog.open(TenantSettingsComponent, {
606
+ width: this.options.dialogWidth,
607
+ maxHeight: this.options.dialogMaxHeight,
608
+ });
609
+ let instance = dialogRef.componentInstance;
610
+ instance.title = "Root settings";
611
+ instance.loading = true;
612
+ instance.type = ModelType.Configuration;
613
+ this.tenantService.getRootSettings().subscribe({
614
+ next: (settings) => {
615
+ instance.loading = false;
616
+ instance.setModel(settings.map(s => new KeyValue(s.key, s.value, false, false)));
617
+ }, error: (error) => {
618
+ this.openSnackBar("Error getting root settings!");
619
+ console.debug(error);
620
+ }
621
+ });
622
+ instance.saved.subscribe((model) => {
623
+ var settings = instance.getModel().map(m => new TenantSetting(m.key, m.value, false));
624
+ this.tenantService.updateRootSettings(settings).subscribe({
625
+ next: () => {
626
+ this.openSnackBar("Root settings was updated!");
627
+ dialogRef.close();
628
+ }, error: (error) => {
629
+ this.openSnackBar("Error updating root settings!");
630
+ console.debug(error);
631
+ }
632
+ });
633
+ });
634
+ instance.cancelled.subscribe(() => {
635
+ this.openSnackBar("Root setting was cancelled!");
636
+ dialogRef.close();
637
+ });
638
+ }
639
+ //#endregion
640
+ //#region status rules
641
+ canActivate(status) {
642
+ var s = (typeof status == "string" ? TenantStatus[status] : status);
643
+ return s == TenantStatus.New
644
+ || s == TenantStatus.Initialized
645
+ || s == TenantStatus.Approved
646
+ || s == TenantStatus.PendingToActive;
647
+ }
648
+ canReactivate(status) {
649
+ var s = (typeof status == "string" ? TenantStatus[status] : status);
650
+ return s == TenantStatus.Inactive || s == TenantStatus.Suspended;
651
+ }
652
+ canDeactivate(status) {
653
+ var s = (typeof status == "string" ? TenantStatus[status] : status);
654
+ return s == TenantStatus.Active;
655
+ }
656
+ canSuspend(status) {
657
+ var s = (typeof status == "string" ? TenantStatus[status] : status);
658
+ return s == TenantStatus.Active || s == TenantStatus.Inactive;
659
+ }
660
+ canDelete(status) {
661
+ var s = (typeof status == "string" ? TenantStatus[status] : status);
662
+ return s == TenantStatus.New
663
+ || s == TenantStatus.Initialized
664
+ || s == TenantStatus.Approved
665
+ || s == TenantStatus.PendingToActive
666
+ || s == TenantStatus.Inactive
667
+ || s == TenantStatus.Suspended
668
+ || s == TenantStatus.Abandoned;
669
+ }
670
+ canAbandon(status) {
671
+ var s = (typeof status == "string" ? TenantStatus[status] : status);
672
+ return s != TenantStatus.Abandoned;
673
+ }
674
+ canApproval(status) {
675
+ var s = (typeof status == "string" ? TenantStatus[status] : status);
676
+ return s == TenantStatus.PendingApproval;
677
+ }
678
+ //#endregion
679
+ //#region common
680
+ statusCompareFn(o1, o2) {
681
+ return o1 == o2 || (o1 == null && o2 == null) || (o1 == undefined && o2 == undefined)
682
+ || (o1 == null && o2 == undefined) || (o1 == undefined && o2 == null);
683
+ }
684
+ confirm(callback, options) {
685
+ const dialogRef = this.dialog.open(ConfirmDialogComponent, {
686
+ width: '350px',
687
+ data: options
688
+ });
689
+ let instance = dialogRef.componentInstance;
690
+ instance.confirmed.subscribe(() => {
691
+ dialogRef.close();
692
+ callback();
693
+ });
694
+ instance.cancelled.subscribe(() => {
695
+ dialogRef.close();
696
+ });
697
+ }
698
+ openSnackBar(message) {
699
+ this.localizer.get([message, "Close"]).subscribe((value) => {
700
+ this.snackBar.open(value[message], value["Close"], {
701
+ duration: 3000
702
+ });
703
+ });
704
+ }
705
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantsComponent, deps: [{ token: TenantAdminService }, { token: i2.Router }, { token: i2.ActivatedRoute }, { token: i3$1.Location }, { token: i2.UrlSerializer }, { token: i4$2.FormBuilder }, { token: i4.MatDialog }, { token: i6.MatSnackBar }, { token: i7.TranslateService }, { token: TenantConfiguration }], target: i0.ɵɵFactoryTarget.Component }); }
706
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TenantsComponent, selector: "juice-tenants", viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatMultiSort, descendants: true }], ngImport: i0, template: "<div class=\"mat-elevation-z2 density-compact\">\n <div class=\"controls\">\n <form [formGroup]=\"form\" class=\"table-form \">\n <mat-form-field [style.width.px]=\"300\">\n <input matInput type=\"text\" placeholder=\"{{ 'Search' | translate }}\" formControlName=\"filterText\" (keyup.enter)=\"getData()\">\n <button *ngIf=\"filterText?.value\" type=\"button\" matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"clearFilterText();\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <mat-form-field [style.width.px]=\"200\">\n <mat-label>{{ 'Statuses' | translate }}</mat-label>\n <mat-select formControlName=\"statuses\" multiple [compareWith]=\"statusCompareFn\" placeholder=\"{{ 'Any status' | translate }}\">\n <mat-select-trigger>\n {{statusOptions[statuses?.value?.[0]||-1] || ('Any status' | translate)}}\n <span *ngIf=\"(statuses?.value?.length || 0) > 1\" class=\"additional-selection\">\n (+{{(statuses?.value?.length || 0) - 1}} {{statuses?.value?.length === 2 ? 'other' : 'others'}})\n </span>\n </mat-select-trigger>\n <option class=\"clear-statuses mat-mdc-option\" (click)=\"clearStatuses()\">{{'Any status' | translate}}</option>\n <mat-option *ngFor=\"let s of statusOptions | keyvalue\" [value]=\"s.key\">\n {{s.value}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n \n </form>\n <div class=\"control-buttons\">\n <div class=\"control-buttons-container\">\n <button mat-button (click)=\"rootSettings()\">\n <mat-icon>settings</mat-icon>{{'Settings' | translate}}\n </button>\n <button type=\"button\" mat-button (click)=\"add()\" color=\"primary\"><mat-icon>add</mat-icon> {{ 'New Organization'}}</button>\n </div>\n <div class=\"spacer\"></div>\n </div>\n </div>\n <table mat-table [dataSource]=\"table.dataSource\" matMultiSort (matSortChange)=\"table.onSortEvent()\">\n \n <!--- Note that these columns can be defined in any order.\n The actual rendered columns are set as a property on the row definition\" -->\n <ng-container matColumnDef=\"identifier\">\n <th mat-header-cell *matHeaderCellDef mat-multi-sort-header=\"identifier\" disableClear=\"true\"> {{ 'Identifier' | translate }} </th>\n <td class=\"button-cell\" mat-cell *matCellDef=\"let row\"> {{row.identifier}} \n <button mat-icon-button [cdkCopyToClipboard]=\"row.identifier\" \n [attr.aria-label]=\"'Copy' | translate\">\n <mat-icon>content_copy</mat-icon>\n </button>\n </td>\n </ng-container>\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef > {{'Name'|translate}} </th>\n <td mat-cell *matCellDef=\"let row\"> \n {{row.name}}\n </td>\n </ng-container>\n <ng-container matColumnDef=\"status\">\n <th mat-header-cell *matHeaderCellDef > {{'Status'|translate}} </th>\n <td mat-cell *matCellDef=\"let row\" [class]=\"statusHelper.getColor(row.status)\"> \n {{row.status}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef style=\"text-align: center;\"> {{'Actions'|translate}} </th>\n <td mat-cell *matCellDef=\"let row\" > \n <div class=\"actions-cell\">\n <button mat-button (click)=\"settings(row.id)\">\n <mat-icon>settings</mat-icon>{{'Settings' | translate}}\n </button>\n <button mat-button (click)=\"detail(row.id)\">\n <mat-icon>info</mat-icon>{{'Detail' | translate}}\n </button>\n <button mat-button (click)=\"edit(row.id)\">\n <mat-icon>edit</mat-icon>{{'Edit' | translate}}\n </button>\n \n <button mat-icon-button [matMenuTriggerFor]=\"appMenu\" [matMenuTriggerData]=\"{id: row.id, status: row.status}\">\n <mat-icon>more_vert</mat-icon>\n </button>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n </table>\n <mat-paginator [pageSize]=\"table.pageSize\" [pageIndex]=\"table.pageIndex\" \n [pageSizeOptions]=\"table.pageSizeOptions\"\n [length]=\"table.totalElements ? table.totalElements : 0\" \n (page)=\"table.onPaginationEvent($event)\"\n aria-label=\"Items per page\"\n showFirstLastButtons>\n </mat-paginator>\n\n</div>\n<mat-menu #appMenu=\"matMenu\" class=\"minimum-density\">\n <ng-template matMenuContent let-id=\"id\" let-status=\"status\">\n <button *ngIf=\"canApproval(status)\" class=\"color-success\" mat-menu-item (click)=\"approve(id)\">\n <mat-icon>check_circle_outline</mat-icon>{{'Approve' | translate}}\n </button>\n <button *ngIf=\"canApproval(status)\" class=\"color-warn\" mat-menu-item (click)=\"reject(id)\">\n <mat-icon>highlight_off</mat-icon>{{'Reject' | translate}}\n </button>\n <button *ngIf=\"canActivate(status)\" class=\"color-success\" mat-menu-item (click)=\"activate(id)\">\n <mat-icon>present_to_all</mat-icon>{{'Activate' | translate}}\n </button>\n <button *ngIf=\"canReactivate(status)\" class=\"color-success\" mat-menu-item (click)=\"reactivate(id)\">\n <mat-icon >present_to_all</mat-icon>{{'Activate' | translate}}\n </button>\n <button *ngIf=\"canDeactivate(status)\" class=\"color-warn\" mat-menu-item (click)=\"deactivate(id)\">\n <mat-icon >cancel_presentation</mat-icon>{{'Deactivate' | translate}}\n </button>\n <button *ngIf=\"canSuspend(status)\" class=\"color-warn\" mat-menu-item (click)=\"suspend(id)\">\n <mat-icon >cancel_presentation</mat-icon>{{'Suspend' | translate}}\n </button>\n <button [disabled]=\"!canAbandon(status)\" mat-menu-item (click)=\"abandon(id)\" class=\"color-warn\">\n <mat-icon >delete</mat-icon>{{'Abandon' | translate}}\n </button>\n <button *ngIf=\"canDelete(status)\" class=\"color-warn\" mat-menu-item (click)=\"delete(id)\">\n <mat-icon >delete</mat-icon>{{'Delete' | translate}}\n </button>\n </ng-template>\n</mat-menu>", styles: [":host{display:block}mat-form-field{width:100%}.additional-selection{opacity:.75;font-size:.75em;line-height:0}.clear-statuses{padding:10px;cursor:pointer}.button-cell,.actions-cell{display:flex;align-items:center;padding-top:2px;padding-bottom:2px}.button-cell{justify-content:space-between}.actions-cell{justify-content:center}.actions-cell .mdc-button{padding-top:20px;padding-bottom:20px}.table-form{display:flex;flex-direction:row;align-items:center}.table-form mat-card-actions{flex:1 1 auto}.mat-mdc-menu-item{min-height:38px}.controls{display:flex}.controls .control-buttons{flex:1;display:flex;flex-direction:column}.controls .control-buttons .control-buttons-container{flex:1;display:flex;align-items:center;justify-content:flex-end}.controls .spacer{height:22px}\n"], dependencies: [{ kind: "directive", type: i4$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4$2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4$2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i8.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i13.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i13.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i13.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "directive", type: i13.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i14.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: i15.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "panelWidth", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "directive", type: i15.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i16.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i17.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i17.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i17.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i17.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i17.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i17.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i17.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i17.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i17.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i17.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i18.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "component", type: i19.MatMultiSortHeaderComponent, selector: "[mat-multi-sort-header]", inputs: ["mat-multi-sort-header"], exportAs: ["matMultiSortHeader"] }, { kind: "directive", type: i19.MatMultiSort, selector: "[matMultiSort]", exportAs: ["matMultiSort"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }, { kind: "pipe", type: i3$1.KeyValuePipe, name: "keyvalue" }] }); }
707
+ }
708
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantsComponent, decorators: [{
709
+ type: Component,
710
+ args: [{ selector: 'juice-tenants', template: "<div class=\"mat-elevation-z2 density-compact\">\n <div class=\"controls\">\n <form [formGroup]=\"form\" class=\"table-form \">\n <mat-form-field [style.width.px]=\"300\">\n <input matInput type=\"text\" placeholder=\"{{ 'Search' | translate }}\" formControlName=\"filterText\" (keyup.enter)=\"getData()\">\n <button *ngIf=\"filterText?.value\" type=\"button\" matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"clearFilterText();\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <mat-form-field [style.width.px]=\"200\">\n <mat-label>{{ 'Statuses' | translate }}</mat-label>\n <mat-select formControlName=\"statuses\" multiple [compareWith]=\"statusCompareFn\" placeholder=\"{{ 'Any status' | translate }}\">\n <mat-select-trigger>\n {{statusOptions[statuses?.value?.[0]||-1] || ('Any status' | translate)}}\n <span *ngIf=\"(statuses?.value?.length || 0) > 1\" class=\"additional-selection\">\n (+{{(statuses?.value?.length || 0) - 1}} {{statuses?.value?.length === 2 ? 'other' : 'others'}})\n </span>\n </mat-select-trigger>\n <option class=\"clear-statuses mat-mdc-option\" (click)=\"clearStatuses()\">{{'Any status' | translate}}</option>\n <mat-option *ngFor=\"let s of statusOptions | keyvalue\" [value]=\"s.key\">\n {{s.value}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n \n </form>\n <div class=\"control-buttons\">\n <div class=\"control-buttons-container\">\n <button mat-button (click)=\"rootSettings()\">\n <mat-icon>settings</mat-icon>{{'Settings' | translate}}\n </button>\n <button type=\"button\" mat-button (click)=\"add()\" color=\"primary\"><mat-icon>add</mat-icon> {{ 'New Organization'}}</button>\n </div>\n <div class=\"spacer\"></div>\n </div>\n </div>\n <table mat-table [dataSource]=\"table.dataSource\" matMultiSort (matSortChange)=\"table.onSortEvent()\">\n \n <!--- Note that these columns can be defined in any order.\n The actual rendered columns are set as a property on the row definition\" -->\n <ng-container matColumnDef=\"identifier\">\n <th mat-header-cell *matHeaderCellDef mat-multi-sort-header=\"identifier\" disableClear=\"true\"> {{ 'Identifier' | translate }} </th>\n <td class=\"button-cell\" mat-cell *matCellDef=\"let row\"> {{row.identifier}} \n <button mat-icon-button [cdkCopyToClipboard]=\"row.identifier\" \n [attr.aria-label]=\"'Copy' | translate\">\n <mat-icon>content_copy</mat-icon>\n </button>\n </td>\n </ng-container>\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef > {{'Name'|translate}} </th>\n <td mat-cell *matCellDef=\"let row\"> \n {{row.name}}\n </td>\n </ng-container>\n <ng-container matColumnDef=\"status\">\n <th mat-header-cell *matHeaderCellDef > {{'Status'|translate}} </th>\n <td mat-cell *matCellDef=\"let row\" [class]=\"statusHelper.getColor(row.status)\"> \n {{row.status}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef style=\"text-align: center;\"> {{'Actions'|translate}} </th>\n <td mat-cell *matCellDef=\"let row\" > \n <div class=\"actions-cell\">\n <button mat-button (click)=\"settings(row.id)\">\n <mat-icon>settings</mat-icon>{{'Settings' | translate}}\n </button>\n <button mat-button (click)=\"detail(row.id)\">\n <mat-icon>info</mat-icon>{{'Detail' | translate}}\n </button>\n <button mat-button (click)=\"edit(row.id)\">\n <mat-icon>edit</mat-icon>{{'Edit' | translate}}\n </button>\n \n <button mat-icon-button [matMenuTriggerFor]=\"appMenu\" [matMenuTriggerData]=\"{id: row.id, status: row.status}\">\n <mat-icon>more_vert</mat-icon>\n </button>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n </table>\n <mat-paginator [pageSize]=\"table.pageSize\" [pageIndex]=\"table.pageIndex\" \n [pageSizeOptions]=\"table.pageSizeOptions\"\n [length]=\"table.totalElements ? table.totalElements : 0\" \n (page)=\"table.onPaginationEvent($event)\"\n aria-label=\"Items per page\"\n showFirstLastButtons>\n </mat-paginator>\n\n</div>\n<mat-menu #appMenu=\"matMenu\" class=\"minimum-density\">\n <ng-template matMenuContent let-id=\"id\" let-status=\"status\">\n <button *ngIf=\"canApproval(status)\" class=\"color-success\" mat-menu-item (click)=\"approve(id)\">\n <mat-icon>check_circle_outline</mat-icon>{{'Approve' | translate}}\n </button>\n <button *ngIf=\"canApproval(status)\" class=\"color-warn\" mat-menu-item (click)=\"reject(id)\">\n <mat-icon>highlight_off</mat-icon>{{'Reject' | translate}}\n </button>\n <button *ngIf=\"canActivate(status)\" class=\"color-success\" mat-menu-item (click)=\"activate(id)\">\n <mat-icon>present_to_all</mat-icon>{{'Activate' | translate}}\n </button>\n <button *ngIf=\"canReactivate(status)\" class=\"color-success\" mat-menu-item (click)=\"reactivate(id)\">\n <mat-icon >present_to_all</mat-icon>{{'Activate' | translate}}\n </button>\n <button *ngIf=\"canDeactivate(status)\" class=\"color-warn\" mat-menu-item (click)=\"deactivate(id)\">\n <mat-icon >cancel_presentation</mat-icon>{{'Deactivate' | translate}}\n </button>\n <button *ngIf=\"canSuspend(status)\" class=\"color-warn\" mat-menu-item (click)=\"suspend(id)\">\n <mat-icon >cancel_presentation</mat-icon>{{'Suspend' | translate}}\n </button>\n <button [disabled]=\"!canAbandon(status)\" mat-menu-item (click)=\"abandon(id)\" class=\"color-warn\">\n <mat-icon >delete</mat-icon>{{'Abandon' | translate}}\n </button>\n <button *ngIf=\"canDelete(status)\" class=\"color-warn\" mat-menu-item (click)=\"delete(id)\">\n <mat-icon >delete</mat-icon>{{'Delete' | translate}}\n </button>\n </ng-template>\n</mat-menu>", styles: [":host{display:block}mat-form-field{width:100%}.additional-selection{opacity:.75;font-size:.75em;line-height:0}.clear-statuses{padding:10px;cursor:pointer}.button-cell,.actions-cell{display:flex;align-items:center;padding-top:2px;padding-bottom:2px}.button-cell{justify-content:space-between}.actions-cell{justify-content:center}.actions-cell .mdc-button{padding-top:20px;padding-bottom:20px}.table-form{display:flex;flex-direction:row;align-items:center}.table-form mat-card-actions{flex:1 1 auto}.mat-mdc-menu-item{min-height:38px}.controls{display:flex}.controls .control-buttons{flex:1;display:flex;flex-direction:column}.controls .control-buttons .control-buttons-container{flex:1;display:flex;align-items:center;justify-content:flex-end}.controls .spacer{height:22px}\n"] }]
711
+ }], ctorParameters: function () { return [{ type: TenantAdminService }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i3$1.Location }, { type: i2.UrlSerializer }, { type: i4$2.FormBuilder }, { type: i4.MatDialog }, { type: i6.MatSnackBar }, { type: i7.TranslateService }, { type: TenantConfiguration }]; }, propDecorators: { paginator: [{
712
+ type: ViewChild,
713
+ args: [MatPaginator]
714
+ }], sort: [{
715
+ type: ViewChild,
716
+ args: [MatMultiSort]
717
+ }] } });
718
+
719
+ class TenantDetailComponent {
720
+ constructor(tenantService) {
721
+ this.tenantService = tenantService;
722
+ this.tenantIdentifier = "";
723
+ this.statusHelper = TenantStatusHelper;
724
+ }
725
+ loadTenant(identifier) {
726
+ this.tenantService.getTenant(identifier).subscribe(tenant => {
727
+ this.tenant = tenant;
728
+ let properties = JSON.parse(tenant.serializedProperties);
729
+ this.properties = {};
730
+ Object.entries(properties).forEach(([key, value], index) => {
731
+ this.properties[key] = typeof value == 'object' ? JSON.stringify(value) : value;
732
+ });
733
+ });
734
+ }
735
+ ngOnChanges() {
736
+ this.loadTenant(this.tenantIdentifier);
737
+ }
738
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantDetailComponent, deps: [{ token: TenantAdminService }], target: i0.ɵɵFactoryTarget.Component }); }
739
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TenantDetailComponent, selector: "juice-tenant-detail", inputs: { tenantIdentifier: "tenantIdentifier" }, usesOnChanges: true, ngImport: i0, template: "<h2 mat-dialog-title>{{ 'Organization information' | translate }}</h2>\n\n<mat-dialog-content *ngIf=\"tenant\">\n <h3>{{ tenant.name }}</h3>\n\n <mat-list>\n <mat-list-item>\n <span matListItemTitle>{{ 'Unique Id' | translate }}</span>\n <span matListItemLine>{{ tenant.id }} \n <button style=\"margin-left: 6px;\" mat-icon-button [cdkCopyToClipboard]=\"tenant.id\" \n [attr.aria-label]=\"'Copy' | translate\">\n <mat-icon>content_copy</mat-icon>\n </button>\n </span>\n </mat-list-item>\n\n <mat-list-item>\n <span matListItemTitle>{{ 'Identifier' | translate }}</span>\n <span matListItemLine>{{ tenant.identifier }}</span>\n </mat-list-item>\n\n <mat-list-item>\n <span matListItemTitle>{{ 'Status' | translate }}</span>\n <span matListItemLine [class]=\"statusHelper.getColor(tenant.status)\">{{ tenant.status }}</span>\n </mat-list-item>\n\n <mat-list-item>\n <span matListItemTitle>{{ 'ConnectionString' | translate }}</span>\n <span matListItemLine>{{ tenant.connectionString }}</span>\n </mat-list-item>\n\n <mat-list-item>\n <span matListItemTitle>{{ 'Owner' | translate }}</span>\n <span matListItemLine>{{ tenant.ownerName }}</span>\n </mat-list-item>\n\n <mat-list-item>\n <span matListItemTitle>{{ 'Properties' | translate }}</span>\n <span matListItemLine *ngFor=\"let property of properties | keyvalue\">\n {{ property.key }}: {{ property.value }}\n </span>\n </mat-list-item>\n </mat-list>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button mat-dialog-close>{{ 'Close' | translate }}</button>\n</mat-dialog-actions>", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i4.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6$1.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i6$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i6$1.MatListItemLine, selector: "[matListItemLine]" }, { kind: "directive", type: i6$1.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "directive", type: i18.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }, { kind: "pipe", type: i3$1.KeyValuePipe, name: "keyvalue" }] }); }
740
+ }
741
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantDetailComponent, decorators: [{
742
+ type: Component,
743
+ args: [{ selector: 'juice-tenant-detail', template: "<h2 mat-dialog-title>{{ 'Organization information' | translate }}</h2>\n\n<mat-dialog-content *ngIf=\"tenant\">\n <h3>{{ tenant.name }}</h3>\n\n <mat-list>\n <mat-list-item>\n <span matListItemTitle>{{ 'Unique Id' | translate }}</span>\n <span matListItemLine>{{ tenant.id }} \n <button style=\"margin-left: 6px;\" mat-icon-button [cdkCopyToClipboard]=\"tenant.id\" \n [attr.aria-label]=\"'Copy' | translate\">\n <mat-icon>content_copy</mat-icon>\n </button>\n </span>\n </mat-list-item>\n\n <mat-list-item>\n <span matListItemTitle>{{ 'Identifier' | translate }}</span>\n <span matListItemLine>{{ tenant.identifier }}</span>\n </mat-list-item>\n\n <mat-list-item>\n <span matListItemTitle>{{ 'Status' | translate }}</span>\n <span matListItemLine [class]=\"statusHelper.getColor(tenant.status)\">{{ tenant.status }}</span>\n </mat-list-item>\n\n <mat-list-item>\n <span matListItemTitle>{{ 'ConnectionString' | translate }}</span>\n <span matListItemLine>{{ tenant.connectionString }}</span>\n </mat-list-item>\n\n <mat-list-item>\n <span matListItemTitle>{{ 'Owner' | translate }}</span>\n <span matListItemLine>{{ tenant.ownerName }}</span>\n </mat-list-item>\n\n <mat-list-item>\n <span matListItemTitle>{{ 'Properties' | translate }}</span>\n <span matListItemLine *ngFor=\"let property of properties | keyvalue\">\n {{ property.key }}: {{ property.value }}\n </span>\n </mat-list-item>\n </mat-list>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button mat-dialog-close>{{ 'Close' | translate }}</button>\n</mat-dialog-actions>", styles: [":host{display:block}\n"] }]
744
+ }], ctorParameters: function () { return [{ type: TenantAdminService }]; }, propDecorators: { tenantIdentifier: [{
745
+ type: Input
746
+ }] } });
747
+
748
+ class TenantSummaryComponent {
749
+ constructor(tenantService) {
750
+ this.tenantService = tenantService;
751
+ this.tenantIdentifier = "";
752
+ }
753
+ loadTenant(identifier) {
754
+ this.tenantService.getSummary(identifier).subscribe(tenant => {
755
+ this.tenant = tenant;
756
+ });
757
+ }
758
+ ngOnChanges() {
759
+ this.loadTenant(this.tenantIdentifier);
760
+ }
761
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantSummaryComponent, deps: [{ token: TenantAdminService }], target: i0.ɵɵFactoryTarget.Component }); }
762
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TenantSummaryComponent, selector: "juice-tenant-summary", inputs: { tenantIdentifier: "tenantIdentifier" }, usesOnChanges: true, ngImport: i0, template: "<h2 mat-dialog-title>{{ 'Organization summary' | translate }}</h2>\n\n<mat-dialog-content *ngIf=\"tenant\">\n <h3>{{ tenant.name }}</h3>\n\n <mat-list>\n <mat-list-item>\n <span matListItemTitle>{{ 'Unique Id' | translate }}</span>\n <span matListItemLine>{{ tenant.id }}</span>\n </mat-list-item>\n\n <mat-list-item>\n <span matListItemTitle>{{ 'Identifier' | translate }}</span>\n <span matListItemLine>{{ tenant.identifier }}</span>\n </mat-list-item>\n\n <mat-list-item>\n <span matListItemTitle>{{ 'Status' | translate }}</span>\n <span matListItemLine>{{ tenant.status }}</span>\n </mat-list-item>\n\n </mat-list>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button mat-dialog-close><mat-icon>close</mat-icon>{{ 'Close' | translate }}</button>\n</mat-dialog-actions>", styles: [":host{display:block;margin:10px}\n"], dependencies: [{ kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i4.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6$1.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i6$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i6$1.MatListItemLine, selector: "[matListItemLine]" }, { kind: "directive", type: i6$1.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] }); }
763
+ }
764
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantSummaryComponent, decorators: [{
765
+ type: Component,
766
+ args: [{ selector: 'juice-tenant-summary', template: "<h2 mat-dialog-title>{{ 'Organization summary' | translate }}</h2>\n\n<mat-dialog-content *ngIf=\"tenant\">\n <h3>{{ tenant.name }}</h3>\n\n <mat-list>\n <mat-list-item>\n <span matListItemTitle>{{ 'Unique Id' | translate }}</span>\n <span matListItemLine>{{ tenant.id }}</span>\n </mat-list-item>\n\n <mat-list-item>\n <span matListItemTitle>{{ 'Identifier' | translate }}</span>\n <span matListItemLine>{{ tenant.identifier }}</span>\n </mat-list-item>\n\n <mat-list-item>\n <span matListItemTitle>{{ 'Status' | translate }}</span>\n <span matListItemLine>{{ tenant.status }}</span>\n </mat-list-item>\n\n </mat-list>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button mat-dialog-close><mat-icon>close</mat-icon>{{ 'Close' | translate }}</button>\n</mat-dialog-actions>", styles: [":host{display:block;margin:10px}\n"] }]
767
+ }], ctorParameters: function () { return [{ type: TenantAdminService }]; }, propDecorators: { tenantIdentifier: [{
768
+ type: Input
769
+ }] } });
770
+
771
+ class TenantCreate {
772
+ constructor() {
773
+ this.name = "";
774
+ this.identifier = "";
775
+ this.connectionString = "";
776
+ this.adminUser = "";
777
+ this.adminEmail = "";
778
+ this.properties = {};
779
+ }
780
+ }
781
+ class TenantCreated {
782
+ constructor() {
783
+ this.id = "";
784
+ this.identifier = "";
785
+ }
786
+ }
787
+
788
+ /** Error when invalid control is dirty, touched, or submitted. */
789
+ class CustomErrorStateMatcher {
790
+ isErrorState(control, form) {
791
+ const isSubmitted = form && form.submitted;
792
+ return !!(control && control.invalid && (control.dirty || control.touched || isSubmitted));
793
+ }
794
+ }
795
+
796
+ class TenantCreateComponent {
797
+ constructor(tenantService) {
798
+ this.tenantService = tenantService;
799
+ this.model = new TenantCreate();
800
+ this.emailFormControl = new FormControl('', [Validators.email]);
801
+ this.identifierFormControl = new FormControl('', [Validators.required]);
802
+ this.nameFormControl = new FormControl('', [Validators.required]);
803
+ this.createForm = new FormGroup({
804
+ identifier: this.identifierFormControl,
805
+ name: this.nameFormControl,
806
+ email: this.emailFormControl
807
+ });
808
+ this.matcher = new CustomErrorStateMatcher();
809
+ this.created = new EventEmitter();
810
+ this.cancelled = new EventEmitter();
811
+ }
812
+ ngOnInit() {
813
+ }
814
+ updateModel() {
815
+ var value = this.createForm.value;
816
+ this.model.identifier = value.identifier ?? '';
817
+ this.model.name = value.name ?? '';
818
+ this.model.adminEmail = value.email ?? '';
819
+ }
820
+ submit() {
821
+ if (this.createForm.valid) {
822
+ this.updateModel();
823
+ this.tenantService.createTenant(this.model).subscribe({
824
+ next: (result) => {
825
+ if (this.created != null) {
826
+ this.created.emit(result);
827
+ }
828
+ this.createForm.reset();
829
+ this.model = new TenantCreate();
830
+ },
831
+ error: (err) => {
832
+ }
833
+ });
834
+ }
835
+ }
836
+ cancel() {
837
+ this.cancelled.emit();
838
+ }
839
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantCreateComponent, deps: [{ token: TenantAdminService }], target: i0.ɵɵFactoryTarget.Component }); }
840
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TenantCreateComponent, selector: "juice-tenant-create", outputs: { created: "created", cancelled: "cancelled" }, ngImport: i0, template: "<h2 mat-dialog-title>{{ 'Create new organization' | translate }}</h2>\n\n<mat-dialog-content>\n <mat-form-field>\n <mat-label>{{ 'Identifier' | translate }}</mat-label>\n <input matInput [formControl]=\"identifierFormControl\" [errorStateMatcher]=\"matcher\">\n <mat-error *ngIf=\"identifierFormControl.hasError('required')\">\n {{ 'Please enter an identifier' | translate }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'Organization name' | translate }}</mat-label>\n <input matInput [formControl]=\"nameFormControl\" [errorStateMatcher]=\"matcher\">\n <mat-error *ngIf=\"nameFormControl.hasError('required')\">\n {{ 'Please enter a name' | translate }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'Admin user' | translate }}</mat-label>\n <input matInput [(ngModel)]=\"model.adminUser\">\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'Admin email' | translate }}</mat-label>\n <input matInput [formControl]=\"emailFormControl\" [errorStateMatcher]=\"matcher\">\n <mat-error *ngIf=\"emailFormControl.hasError('email') && !emailFormControl.hasError('required')\">\n {{ 'Please enter a valid email address' | translate }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'DB connection' | translate }}</mat-label>\n <input matInput [(ngModel)]=\"model.connectionString\">\n </mat-form-field>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button color=\"primary\" (click)=\"submit()\" [disabled]=\"createForm.invalid\"><mat-icon>save</mat-icon>{{ 'Submit' | translate }}</button>\n <button mat-raised-button (click)=\"cancel()\"><mat-icon>cancel</mat-icon>{{ 'Cancel' | translate }}</button>\n</mat-dialog-actions>\n", styles: [":host{display:block}mat-form-field{width:100%}.mat-mdc-button-base{margin:0 8px 8px 0}\n"], dependencies: [{ kind: "directive", type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i8.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] }); }
841
+ }
842
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantCreateComponent, decorators: [{
843
+ type: Component,
844
+ args: [{ selector: 'juice-tenant-create', template: "<h2 mat-dialog-title>{{ 'Create new organization' | translate }}</h2>\n\n<mat-dialog-content>\n <mat-form-field>\n <mat-label>{{ 'Identifier' | translate }}</mat-label>\n <input matInput [formControl]=\"identifierFormControl\" [errorStateMatcher]=\"matcher\">\n <mat-error *ngIf=\"identifierFormControl.hasError('required')\">\n {{ 'Please enter an identifier' | translate }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'Organization name' | translate }}</mat-label>\n <input matInput [formControl]=\"nameFormControl\" [errorStateMatcher]=\"matcher\">\n <mat-error *ngIf=\"nameFormControl.hasError('required')\">\n {{ 'Please enter a name' | translate }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'Admin user' | translate }}</mat-label>\n <input matInput [(ngModel)]=\"model.adminUser\">\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'Admin email' | translate }}</mat-label>\n <input matInput [formControl]=\"emailFormControl\" [errorStateMatcher]=\"matcher\">\n <mat-error *ngIf=\"emailFormControl.hasError('email') && !emailFormControl.hasError('required')\">\n {{ 'Please enter a valid email address' | translate }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'DB connection' | translate }}</mat-label>\n <input matInput [(ngModel)]=\"model.connectionString\">\n </mat-form-field>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button color=\"primary\" (click)=\"submit()\" [disabled]=\"createForm.invalid\"><mat-icon>save</mat-icon>{{ 'Submit' | translate }}</button>\n <button mat-raised-button (click)=\"cancel()\"><mat-icon>cancel</mat-icon>{{ 'Cancel' | translate }}</button>\n</mat-dialog-actions>\n", styles: [":host{display:block}mat-form-field{width:100%}.mat-mdc-button-base{margin:0 8px 8px 0}\n"] }]
845
+ }], ctorParameters: function () { return [{ type: TenantAdminService }]; }, propDecorators: { created: [{
846
+ type: Output
847
+ }], cancelled: [{
848
+ type: Output
849
+ }] } });
850
+
851
+ class TenantUpdate {
852
+ constructor() {
853
+ this.name = "";
854
+ this.identifier = "";
855
+ this.connectionString = "";
856
+ }
857
+ }
858
+
859
+ class TenantUpdateComponent {
860
+ constructor(tenantService) {
861
+ this.tenantService = tenantService;
862
+ this.model = new TenantUpdate();
863
+ this.identifierFormControl = new FormControl(this.model.identifier, [Validators.required]);
864
+ this.nameFormControl = new FormControl(this.model.name, [Validators.required]);
865
+ this.coneectionFormControl = new FormControl(this.model.connectionString, []);
866
+ this.updateForm = new FormGroup({
867
+ identifier: this.identifierFormControl,
868
+ name: this.nameFormControl,
869
+ connectionString: this.coneectionFormControl
870
+ });
871
+ this.matcher = new CustomErrorStateMatcher();
872
+ this.updated = new EventEmitter();
873
+ this.cancelled = new EventEmitter();
874
+ }
875
+ ngOnChanges() {
876
+ this.tenantService.getTenant(this.id).subscribe((result) => {
877
+ this.updateForm.patchValue(result);
878
+ this.updateModel();
879
+ if (this.id == result.identifier) {
880
+ this.id = result.id;
881
+ }
882
+ });
883
+ }
884
+ updateModel() {
885
+ var value = this.updateForm.value;
886
+ this.model.identifier = value.identifier ?? '';
887
+ this.model.name = value.name ?? '';
888
+ this.model.connectionString = value.connectionString ?? '';
889
+ }
890
+ // for modal control
891
+ setId(value) {
892
+ this.id = value;
893
+ this.ngOnChanges();
894
+ }
895
+ submit() {
896
+ if (this.updateForm.valid) {
897
+ this.updateModel();
898
+ this.tenantService.updateTenant(this.id, this.model).subscribe((_) => {
899
+ this.updateForm.reset();
900
+ this.model = new TenantUpdate();
901
+ this.updated.emit(this.id);
902
+ });
903
+ }
904
+ }
905
+ cancel() {
906
+ this.cancelled.emit(this.id);
907
+ }
908
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantUpdateComponent, deps: [{ token: TenantAdminService }], target: i0.ɵɵFactoryTarget.Component }); }
909
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TenantUpdateComponent, selector: "juice-tenant-update", inputs: { id: "id" }, outputs: { updated: "updated", cancelled: "cancelled" }, usesOnChanges: true, ngImport: i0, template: "\n<h2 mat-dialog-title>{{ 'Update organization information' | translate }}</h2>\n\n<mat-dialog-content>\n <mat-form-field>\n <mat-label>{{ 'Identifier' | translate }}</mat-label>\n <input matInput [formControl]=\"identifierFormControl\" [errorStateMatcher]=\"matcher\">\n <mat-error *ngIf=\"identifierFormControl.hasError('required')\">\n {{ 'Please enter an identifier' | translate }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'Organization name' | translate }}</mat-label>\n <input matInput [formControl]=\"nameFormControl\" [errorStateMatcher]=\"matcher\">\n <mat-error *ngIf=\"nameFormControl.hasError('required')\">\n {{ 'Please enter a name' | translate }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'DB connection' | translate }}</mat-label>\n <input matInput [formControl]=\"coneectionFormControl\">\n </mat-form-field>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button color=\"primary\" (click)=\"submit()\" [disabled]=\"updateForm.invalid\"><mat-icon>save</mat-icon>{{ 'Submit' | translate }}</button>\n <button mat-raised-button (click)=\"cancel()\"><mat-icon>cancel</mat-icon>{{ 'Cancel' | translate }}</button>\n</mat-dialog-actions>", styles: [":host{display:block}mat-form-field{width:100%}.mat-mdc-button-base{margin:0 8px 8px 0}\n"], dependencies: [{ kind: "directive", type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i8.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] }); }
910
+ }
911
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantUpdateComponent, decorators: [{
912
+ type: Component,
913
+ args: [{ selector: 'juice-tenant-update', template: "\n<h2 mat-dialog-title>{{ 'Update organization information' | translate }}</h2>\n\n<mat-dialog-content>\n <mat-form-field>\n <mat-label>{{ 'Identifier' | translate }}</mat-label>\n <input matInput [formControl]=\"identifierFormControl\" [errorStateMatcher]=\"matcher\">\n <mat-error *ngIf=\"identifierFormControl.hasError('required')\">\n {{ 'Please enter an identifier' | translate }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'Organization name' | translate }}</mat-label>\n <input matInput [formControl]=\"nameFormControl\" [errorStateMatcher]=\"matcher\">\n <mat-error *ngIf=\"nameFormControl.hasError('required')\">\n {{ 'Please enter a name' | translate }}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>{{ 'DB connection' | translate }}</mat-label>\n <input matInput [formControl]=\"coneectionFormControl\">\n </mat-form-field>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button color=\"primary\" (click)=\"submit()\" [disabled]=\"updateForm.invalid\"><mat-icon>save</mat-icon>{{ 'Submit' | translate }}</button>\n <button mat-raised-button (click)=\"cancel()\"><mat-icon>cancel</mat-icon>{{ 'Cancel' | translate }}</button>\n</mat-dialog-actions>", styles: [":host{display:block}mat-form-field{width:100%}.mat-mdc-button-base{margin:0 8px 8px 0}\n"] }]
914
+ }], ctorParameters: function () { return [{ type: TenantAdminService }]; }, propDecorators: { id: [{
915
+ type: Input
916
+ }], updated: [{
917
+ type: Output
918
+ }], cancelled: [{
919
+ type: Output
920
+ }] } });
921
+
922
+ class ConfirmDialogComponent {
923
+ constructor(data) {
924
+ this.data = data;
925
+ this.confirmed = new EventEmitter();
926
+ this.cancelled = new EventEmitter();
927
+ this.confirmMessage = "Are you sure?";
928
+ this.confirmMessageClasses = "";
929
+ this.confirmTitle = "Action required";
930
+ this.confirmButtonText = "Confirm";
931
+ this.confirmButtonColor = "primary";
932
+ if (data.title) {
933
+ this.confirmTitle = data.title;
934
+ }
935
+ if (data.message) {
936
+ this.confirmMessage = data.message;
937
+ }
938
+ if (data.buttonText) {
939
+ this.confirmButtonText = data.buttonText;
940
+ }
941
+ if (data.buttonColor) {
942
+ this.confirmButtonColor = data.buttonColor;
943
+ }
944
+ if (data.messageClasses) {
945
+ this.confirmMessageClasses = data.messageClasses;
946
+ }
947
+ }
948
+ confirm() {
949
+ this.confirmed.emit();
950
+ }
951
+ cancel() {
952
+ this.cancelled.emit();
953
+ }
954
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConfirmDialogComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
955
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ConfirmDialogComponent, selector: "juice-confirm-dialog", outputs: { confirmed: "confirmed", cancelled: "cancelled" }, ngImport: i0, template: "<h2 mat-dialog-title>{{ confirmTitle | translate }}</h2>\n<mat-dialog-content>\n <p [class]=\"confirmMessageClasses\">{{ confirmMessage | translate }}</p>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button (click)=\"confirm()\" [color]=\"confirmButtonColor\">{{ confirmButtonText | translate }}</button>\n <button mat-raised-button (click)=\"cancel()\">{{ 'Cancel' | translate }}</button>\n</mat-dialog-actions>\n", styles: [":host mat-card{width:350px}:host mat-card-subtitle{padding-top:12px!important;padding:12px}\n"], dependencies: [{ kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] }); }
956
+ }
957
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
958
+ type: Component,
959
+ args: [{ selector: 'juice-confirm-dialog', template: "<h2 mat-dialog-title>{{ confirmTitle | translate }}</h2>\n<mat-dialog-content>\n <p [class]=\"confirmMessageClasses\">{{ confirmMessage | translate }}</p>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <button mat-raised-button (click)=\"confirm()\" [color]=\"confirmButtonColor\">{{ confirmButtonText | translate }}</button>\n <button mat-raised-button (click)=\"cancel()\">{{ 'Cancel' | translate }}</button>\n</mat-dialog-actions>\n", styles: [":host mat-card{width:350px}:host mat-card-subtitle{padding-top:12px!important;padding:12px}\n"] }]
960
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
961
+ type: Inject,
962
+ args: [MAT_DIALOG_DATA]
963
+ }] }]; }, propDecorators: { confirmed: [{
964
+ type: Output
965
+ }], cancelled: [{
966
+ type: Output
967
+ }] } });
968
+
969
+ class MaterialModule {
970
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
971
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: MaterialModule, exports: [MatButtonModule,
972
+ MatCardModule,
973
+ MatCheckboxModule,
974
+ MatDatepickerModule,
975
+ MatDialogModule,
976
+ MatDividerModule,
977
+ MatExpansionModule,
978
+ MatGridListModule,
979
+ MatIconModule,
980
+ MatInputModule,
981
+ MatListModule,
982
+ MatMenuModule,
983
+ MatNativeDateModule,
984
+ MatPaginatorModule,
985
+ MatProgressBarModule,
986
+ MatProgressSpinnerModule,
987
+ MatRadioModule,
988
+ MatRippleModule,
989
+ MatSelectModule,
990
+ MatSliderModule,
991
+ MatSlideToggleModule,
992
+ MatSnackBarModule,
993
+ MatSortModule,
994
+ MatTableModule,
995
+ MatTabsModule,
996
+ MatToolbarModule,
997
+ MatTooltipModule,
998
+ MatTreeModule] }); }
999
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MaterialModule, imports: [MatButtonModule,
1000
+ MatCardModule,
1001
+ MatCheckboxModule,
1002
+ MatDatepickerModule,
1003
+ MatDialogModule,
1004
+ MatDividerModule,
1005
+ MatExpansionModule,
1006
+ MatGridListModule,
1007
+ MatIconModule,
1008
+ MatInputModule,
1009
+ MatListModule,
1010
+ MatMenuModule,
1011
+ MatNativeDateModule,
1012
+ MatPaginatorModule,
1013
+ MatProgressBarModule,
1014
+ MatProgressSpinnerModule,
1015
+ MatRadioModule,
1016
+ MatRippleModule,
1017
+ MatSelectModule,
1018
+ MatSliderModule,
1019
+ MatSlideToggleModule,
1020
+ MatSnackBarModule,
1021
+ MatSortModule,
1022
+ MatTableModule,
1023
+ MatTabsModule,
1024
+ MatToolbarModule,
1025
+ MatTooltipModule,
1026
+ MatTreeModule] }); }
1027
+ }
1028
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MaterialModule, decorators: [{
1029
+ type: NgModule,
1030
+ args: [{
1031
+ exports: [
1032
+ MatButtonModule,
1033
+ MatCardModule,
1034
+ MatCheckboxModule,
1035
+ MatDatepickerModule,
1036
+ MatDialogModule,
1037
+ MatDividerModule,
1038
+ MatExpansionModule,
1039
+ MatGridListModule,
1040
+ MatIconModule,
1041
+ MatInputModule,
1042
+ MatListModule,
1043
+ MatMenuModule,
1044
+ MatNativeDateModule,
1045
+ MatPaginatorModule,
1046
+ MatProgressBarModule,
1047
+ MatProgressSpinnerModule,
1048
+ MatRadioModule,
1049
+ MatRippleModule,
1050
+ MatSelectModule,
1051
+ MatSliderModule,
1052
+ MatSlideToggleModule,
1053
+ MatSnackBarModule,
1054
+ MatSortModule,
1055
+ MatTableModule,
1056
+ MatTabsModule,
1057
+ MatToolbarModule,
1058
+ MatTooltipModule,
1059
+ MatTreeModule
1060
+ ]
1061
+ }]
1062
+ }] });
1063
+
1064
+ class TenantsModule {
1065
+ static forRoot(environment) {
1066
+ return {
1067
+ ngModule: TenantsModule,
1068
+ providers: [
1069
+ TenantAdminService,
1070
+ {
1071
+ provide: TenantConfiguration,
1072
+ useValue: environment
1073
+ }
1074
+ ]
1075
+ };
1076
+ }
1077
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1078
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: TenantsModule, declarations: [TenantsComponent,
1079
+ TenantDetailComponent,
1080
+ TenantSummaryComponent,
1081
+ TenantCreateComponent,
1082
+ TenantUpdateComponent,
1083
+ ConfirmDialogComponent,
1084
+ TenantSettingsComponent], imports: [TranslateModule,
1085
+ FormsModule,
1086
+ ReactiveFormsModule,
1087
+ CommonModule,
1088
+ MaterialModule,
1089
+ ClipboardModule,
1090
+ MatMultiSortModule,
1091
+ DictBuilderModule], exports: [TenantsComponent,
1092
+ TenantDetailComponent,
1093
+ TenantSummaryComponent,
1094
+ TenantCreateComponent,
1095
+ TenantUpdateComponent,
1096
+ TranslateModule] }); }
1097
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantsModule, imports: [TranslateModule,
1098
+ FormsModule,
1099
+ ReactiveFormsModule,
1100
+ CommonModule,
1101
+ MaterialModule,
1102
+ ClipboardModule,
1103
+ MatMultiSortModule,
1104
+ DictBuilderModule, TranslateModule] }); }
1105
+ }
1106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TenantsModule, decorators: [{
1107
+ type: NgModule,
1108
+ args: [{
1109
+ declarations: [
1110
+ TenantsComponent,
1111
+ TenantDetailComponent,
1112
+ TenantSummaryComponent,
1113
+ TenantCreateComponent,
1114
+ TenantUpdateComponent,
1115
+ ConfirmDialogComponent,
1116
+ TenantSettingsComponent
1117
+ ],
1118
+ imports: [
1119
+ TranslateModule,
1120
+ FormsModule,
1121
+ ReactiveFormsModule,
1122
+ CommonModule,
1123
+ MaterialModule,
1124
+ ClipboardModule,
1125
+ MatMultiSortModule,
1126
+ DictBuilderModule
1127
+ ],
1128
+ exports: [
1129
+ TenantsComponent,
1130
+ TenantDetailComponent,
1131
+ TenantSummaryComponent,
1132
+ TenantCreateComponent,
1133
+ TenantUpdateComponent,
1134
+ TranslateModule
1135
+ ]
1136
+ }]
1137
+ }] });
1138
+
1139
+ /*
1140
+ * Public API Surface of tenants
1141
+ */
1142
+
1143
+ /**
1144
+ * Generated bundle index. Do not edit.
1145
+ */
1146
+
1147
+ export { ConfirmDialogComponent, TenantAdminService, TenantCreateComponent, TenantDetailComponent, TenantSummaryComponent, TenantUpdateComponent, TenantsComponent, TenantsModule };
1148
+ //# sourceMappingURL=juice-js-tenants.mjs.map