@juice-js/tenants 1.0.6-alpha.5 → 1.0.6
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.
- package/esm2020/juice-js-tenants.mjs +5 -0
- package/esm2020/lib/confirm-dialog/confirm-dialog.component.mjs +53 -0
- package/esm2020/lib/shared/custom-error-state-matcher.mjs +8 -0
- package/esm2020/lib/shared/material.module.mjs +124 -0
- package/esm2020/lib/shared/models/table.query-result.mjs +2 -0
- package/esm2020/lib/shared/models/tenant.create.model.mjs +17 -0
- package/esm2020/lib/shared/models/tenant.model.mjs +2 -0
- package/esm2020/lib/shared/models/tenant.setting.model.mjs +13 -0
- package/esm2020/lib/shared/models/tenant.status.mjs +42 -0
- package/esm2020/lib/shared/models/tenant.update.model.mjs +8 -0
- package/esm2020/lib/shared/services/tenant-admin.service.mjs +88 -0
- package/esm2020/lib/shared/tenant-configuration.mjs +11 -0
- package/esm2020/lib/tenant-create/tenant-create.component.mjs +69 -0
- package/esm2020/lib/tenant-detail/tenant-detail.component.mjs +36 -0
- package/esm2020/lib/tenant-summary/tenant-summary.component.mjs +30 -0
- package/esm2020/lib/tenant-update/tenant-update.component.mjs +77 -0
- package/esm2020/lib/tenants.component.mjs +502 -0
- package/esm2020/lib/tenants.module.mjs +86 -0
- package/esm2020/public-api.mjs +12 -0
- package/fesm2015/juice-js-tenants.mjs +1109 -0
- package/fesm2015/juice-js-tenants.mjs.map +1 -0
- package/fesm2020/juice-js-tenants.mjs +1101 -0
- package/fesm2020/juice-js-tenants.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/confirm-dialog/confirm-dialog.component.d.ts +29 -0
- package/lib/shared/custom-error-state-matcher.d.ts +6 -0
- package/lib/shared/material.module.d.ts +33 -0
- package/{src/lib/shared/models/table.query-result.ts → lib/shared/models/table.query-result.d.ts} +2 -3
- package/lib/shared/models/tenant.create.model.d.ts +12 -0
- package/{src/lib/shared/models/tenant.model.ts → lib/shared/models/tenant.model.d.ts} +1 -3
- package/lib/shared/models/tenant.setting.model.d.ts +7 -0
- package/lib/shared/models/tenant.status.d.ts +16 -0
- package/lib/shared/models/tenant.update.model.d.ts +5 -0
- package/lib/shared/services/tenant-admin.service.d.ts +34 -0
- package/lib/shared/tenant-configuration.d.ts +12 -0
- package/lib/tenant-create/tenant-create.component.d.ts +28 -0
- package/lib/tenant-detail/tenant-detail.component.d.ts +17 -0
- package/lib/tenant-summary/tenant-summary.component.d.ts +14 -0
- package/lib/tenant-update/tenant-update.component.d.ts +30 -0
- package/lib/tenants.component.d.ts +76 -0
- package/lib/tenants.module.d.ts +21 -0
- package/package.json +26 -5
- package/{src/public-api.ts → public-api.d.ts} +0 -4
- package/.releaserc +0 -7
- package/ng-package.json +0 -10
- package/src/lib/confirm-dialog/confirm-dialog.component.html +0 -10
- package/src/lib/confirm-dialog/confirm-dialog.component.scss +0 -9
- package/src/lib/confirm-dialog/confirm-dialog.component.spec.ts +0 -33
- package/src/lib/confirm-dialog/confirm-dialog.component.ts +0 -49
- package/src/lib/shared/custom-error-state-matcher.ts +0 -15
- package/src/lib/shared/material.module.ts +0 -62
- package/src/lib/shared/models/tenant.create.model.ts +0 -13
- package/src/lib/shared/models/tenant.setting.model.ts +0 -14
- package/src/lib/shared/models/tenant.status.ts +0 -32
- package/src/lib/shared/models/tenant.update.model.ts +0 -5
- package/src/lib/shared/services/tenant-admin.service.ts +0 -109
- package/src/lib/shared/services/tenant.service.spec.ts +0 -28
- package/src/lib/shared/tenant-configuration.ts +0 -18
- package/src/lib/shared/tenant-testing.ts +0 -44
- package/src/lib/tenant-create/tenant-create.component.css +0 -10
- package/src/lib/tenant-create/tenant-create.component.html +0 -45
- package/src/lib/tenant-create/tenant-create.component.spec.ts +0 -32
- package/src/lib/tenant-create/tenant-create.component.ts +0 -68
- package/src/lib/tenant-detail/tenant-detail.component.html +0 -50
- package/src/lib/tenant-detail/tenant-detail.component.scss +0 -3
- package/src/lib/tenant-detail/tenant-detail.component.spec.ts +0 -29
- package/src/lib/tenant-detail/tenant-detail.component.ts +0 -31
- package/src/lib/tenant-summary/tenant-summary.component.css +0 -4
- package/src/lib/tenant-summary/tenant-summary.component.html +0 -28
- package/src/lib/tenant-summary/tenant-summary.component.spec.ts +0 -29
- package/src/lib/tenant-summary/tenant-summary.component.ts +0 -28
- package/src/lib/tenant-update/tenant-update.component.html +0 -32
- package/src/lib/tenant-update/tenant-update.component.scss +0 -9
- package/src/lib/tenant-update/tenant-update.component.spec.ts +0 -29
- package/src/lib/tenant-update/tenant-update.component.ts +0 -77
- package/src/lib/tenants.component.html +0 -117
- package/src/lib/tenants.component.scss +0 -56
- package/src/lib/tenants.component.spec.ts +0 -30
- package/src/lib/tenants.component.ts +0 -565
- package/src/lib/tenants.module.ts +0 -60
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
- /package/{src → theming}/_tenants.component-theme.scss +0 -0
|
@@ -0,0 +1,1109 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Component, ViewChild, Input, EventEmitter, Output, 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 from '@angular/forms';
|
|
10
|
+
import { FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
11
|
+
import { DictBuilderComponent, ModelType, KeyValue } from '@juice-js/dict-builder';
|
|
12
|
+
import * as i2 from '@angular/router';
|
|
13
|
+
import * as i3 from '@angular/common';
|
|
14
|
+
import { CommonModule } from '@angular/common';
|
|
15
|
+
import * as i5 from '@angular/material/dialog';
|
|
16
|
+
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
17
|
+
import * as i6 from '@angular/material/snack-bar';
|
|
18
|
+
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
19
|
+
import * as i7 from '@ngx-translate/core';
|
|
20
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
21
|
+
import * as i9 from '@angular/material/button';
|
|
22
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
23
|
+
import * as i6$1 from '@angular/material/icon';
|
|
24
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
25
|
+
import * as i7$1 from '@angular/material/input';
|
|
26
|
+
import { MatInputModule } from '@angular/material/input';
|
|
27
|
+
import * as i8 from '@angular/material/form-field';
|
|
28
|
+
import * as i13 from '@angular/material/menu';
|
|
29
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
30
|
+
import * as i15 from '@angular/material/select';
|
|
31
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
32
|
+
import * as i16 from '@angular/material/core';
|
|
33
|
+
import { MatNativeDateModule, MatRippleModule } from '@angular/material/core';
|
|
34
|
+
import * as i17 from '@angular/material/table';
|
|
35
|
+
import { MatTableModule } from '@angular/material/table';
|
|
36
|
+
import * as i18 from '@angular/cdk/clipboard';
|
|
37
|
+
import { ClipboardModule } from '@angular/cdk/clipboard';
|
|
38
|
+
import * as i5$1 from '@angular/material/card';
|
|
39
|
+
import { MatCardModule } from '@angular/material/card';
|
|
40
|
+
import * as i6$2 from '@angular/material/list';
|
|
41
|
+
import { MatListModule } from '@angular/material/list';
|
|
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
|
+
}
|
|
143
|
+
TenantAdminService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantAdminService, deps: [{ token: i1.HttpClient }, { token: TenantConfiguration }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
144
|
+
TenantAdminService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantAdminService, providedIn: 'root' });
|
|
145
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", 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 TenantsComponent {
|
|
208
|
+
get statuses() {
|
|
209
|
+
return this.form.get("statuses");
|
|
210
|
+
}
|
|
211
|
+
get filterText() {
|
|
212
|
+
return this.form.get("filterText");
|
|
213
|
+
}
|
|
214
|
+
constructor(tenantService, router, route, location, serializer, fb, dialog, snackBar, localizer, options) {
|
|
215
|
+
this.tenantService = tenantService;
|
|
216
|
+
this.router = router;
|
|
217
|
+
this.route = route;
|
|
218
|
+
this.location = location;
|
|
219
|
+
this.serializer = serializer;
|
|
220
|
+
this.fb = fb;
|
|
221
|
+
this.dialog = dialog;
|
|
222
|
+
this.snackBar = snackBar;
|
|
223
|
+
this.localizer = localizer;
|
|
224
|
+
this.options = options;
|
|
225
|
+
this.displayedColumns = ['name', 'identifier', 'status', 'actions'];
|
|
226
|
+
this.tenantStatus = TenantStatus;
|
|
227
|
+
this.statusHelper = TenantStatusHelper;
|
|
228
|
+
this.statusOptions = Object.values(TenantStatus).filter(value => typeof value === 'string')
|
|
229
|
+
.map(value => value);
|
|
230
|
+
this.form = new FormGroup({});
|
|
231
|
+
this.table = new TableData([
|
|
232
|
+
{ id: 'id', name: 'Id' },
|
|
233
|
+
{ id: 'name', name: 'Name' },
|
|
234
|
+
{ id: 'identifier', name: 'Identifier' },
|
|
235
|
+
{ id: 'status', name: 'Status' },
|
|
236
|
+
{ id: 'actions', name: 'Actions' }
|
|
237
|
+
]);
|
|
238
|
+
this.table.dataSource = new MatMultiSortTableDataSource(new MatMultiSort(), false);
|
|
239
|
+
this.table.displayedColumns = this.displayedColumns;
|
|
240
|
+
}
|
|
241
|
+
ngOnInit() {
|
|
242
|
+
this.form = this.fb.group({
|
|
243
|
+
filterText: [],
|
|
244
|
+
statuses: []
|
|
245
|
+
});
|
|
246
|
+
let firstLoad = true;
|
|
247
|
+
this.route.queryParams.subscribe(params => {
|
|
248
|
+
var _a, _b, _c;
|
|
249
|
+
console.debug("route.queryParams.subscribe", params);
|
|
250
|
+
if (firstLoad) {
|
|
251
|
+
firstLoad = false;
|
|
252
|
+
this.initFormAndTableEvents();
|
|
253
|
+
}
|
|
254
|
+
var q = params['q'] || "";
|
|
255
|
+
(_a = this.filterText) === null || _a === void 0 ? void 0 : _a.setValue(q);
|
|
256
|
+
if (params['statuses'] == 'any') {
|
|
257
|
+
(_b = this.statuses) === null || _b === void 0 ? void 0 : _b.setValue([]);
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
(_c = this.statuses) === null || _c === void 0 ? void 0 : _c.setValue(params['statuses'] ?
|
|
261
|
+
Array.isArray(params['statuses']) ? params['statuses'] : [params['statuses']]
|
|
262
|
+
: [TenantStatus.Active, TenantStatus.PendingApproval, TenantStatus.PendingToActive]);
|
|
263
|
+
}
|
|
264
|
+
this.table.pageSize = params['pageSize'] ? Number.parseInt(params['pageSize']) : 10;
|
|
265
|
+
this.table.pageIndex = params['page'] ? Number.parseInt(params['page']) : 0;
|
|
266
|
+
var sortParams = params['sortParams'];
|
|
267
|
+
var sortDirs = params['sortDirs'];
|
|
268
|
+
if (sortParams && sortDirs) {
|
|
269
|
+
if (Array.isArray(sortParams) && Array.isArray(sortDirs)) {
|
|
270
|
+
this.table.sortParams = sortParams;
|
|
271
|
+
this.table.sortDirs = sortDirs;
|
|
272
|
+
}
|
|
273
|
+
else if (typeof sortParams == "string"
|
|
274
|
+
&& typeof (sortDirs) == "string") {
|
|
275
|
+
this.table.sortParams = [sortParams];
|
|
276
|
+
this.table.sortDirs = [sortDirs];
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
initFormAndTableEvents() {
|
|
282
|
+
this.table.nextObservable.subscribe(() => { this.getData(); });
|
|
283
|
+
this.table.sortObservable.subscribe((e) => { this.getData(); });
|
|
284
|
+
this.table.previousObservable.subscribe(() => { this.getData(); });
|
|
285
|
+
this.table.sizeObservable.subscribe(() => { this.getData(); });
|
|
286
|
+
this.form.controls['statuses'].valueChanges.subscribe(value => {
|
|
287
|
+
this.getData();
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
ngAfterViewInit() {
|
|
291
|
+
this.table.dataSource.sort = this.sort;
|
|
292
|
+
}
|
|
293
|
+
//#region filters
|
|
294
|
+
clearStatuses() {
|
|
295
|
+
var _a;
|
|
296
|
+
(_a = this.statuses) === null || _a === void 0 ? void 0 : _a.setValue([]);
|
|
297
|
+
}
|
|
298
|
+
clearFilterText() {
|
|
299
|
+
var _a;
|
|
300
|
+
(_a = this.filterText) === null || _a === void 0 ? void 0 : _a.setValue("");
|
|
301
|
+
this.getData();
|
|
302
|
+
}
|
|
303
|
+
getData(fromRoute = false) {
|
|
304
|
+
var _a, _b, _c, _d;
|
|
305
|
+
var q = (_b = (_a = this.filterText) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "";
|
|
306
|
+
if (!fromRoute) {
|
|
307
|
+
var statuses = (_c = this.statuses) === null || _c === void 0 ? void 0 : _c.value;
|
|
308
|
+
if (!statuses || statuses.length == 0) {
|
|
309
|
+
statuses = 'any';
|
|
310
|
+
}
|
|
311
|
+
const tree = this.router.createUrlTree([], { queryParams: {
|
|
312
|
+
q: q,
|
|
313
|
+
statuses: statuses,
|
|
314
|
+
page: this.table.pageIndex,
|
|
315
|
+
pageSize: this.table.pageSize,
|
|
316
|
+
sortParams: this.table.sortParams,
|
|
317
|
+
sortDirs: this.table.sortDirs
|
|
318
|
+
} });
|
|
319
|
+
this.location.go(this.serializer.serialize(tree));
|
|
320
|
+
}
|
|
321
|
+
this.tenantService.getTenants(q, ((_d = this.statuses) === null || _d === void 0 ? void 0 : _d.value) || [], this.table.sortParams, this.table.sortDirs, this.table.pageIndex, this.table.pageSize)
|
|
322
|
+
.subscribe((rs) => {
|
|
323
|
+
this.table.totalElements = rs.count;
|
|
324
|
+
this.table.pageIndex = rs.page - 1;
|
|
325
|
+
this.table.pageSize = rs.pageSize;
|
|
326
|
+
this.table.data = rs.data;
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
//#endregion
|
|
330
|
+
//#region actions
|
|
331
|
+
add() {
|
|
332
|
+
const dialogRef = this.dialog.open(TenantCreateComponent, {
|
|
333
|
+
width: this.options.dialogWidth,
|
|
334
|
+
maxHeight: this.options.dialogMaxHeight,
|
|
335
|
+
data: {}
|
|
336
|
+
});
|
|
337
|
+
let instance = dialogRef.componentInstance;
|
|
338
|
+
instance.created.subscribe((id) => {
|
|
339
|
+
this.getData();
|
|
340
|
+
this.openSnackBar("Tenant was created!");
|
|
341
|
+
dialogRef.close();
|
|
342
|
+
});
|
|
343
|
+
instance.cancelled.subscribe(() => {
|
|
344
|
+
this.openSnackBar("Tenant creation was cancelled!");
|
|
345
|
+
dialogRef.close();
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
edit(id) {
|
|
349
|
+
console.debug("edit", id);
|
|
350
|
+
const dialogRef = this.dialog.open(TenantUpdateComponent, {
|
|
351
|
+
width: this.options.dialogWidth,
|
|
352
|
+
maxHeight: this.options.dialogMaxHeight,
|
|
353
|
+
data: { id: id }
|
|
354
|
+
});
|
|
355
|
+
let instance = dialogRef.componentInstance;
|
|
356
|
+
instance.setId(id);
|
|
357
|
+
instance.updated.subscribe((id) => {
|
|
358
|
+
this.getData();
|
|
359
|
+
this.openSnackBar("Tenant was updated!");
|
|
360
|
+
dialogRef.close();
|
|
361
|
+
});
|
|
362
|
+
instance.cancelled.subscribe(() => {
|
|
363
|
+
this.openSnackBar("Tenant update was cancelled!");
|
|
364
|
+
dialogRef.close();
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
detail(id) {
|
|
368
|
+
const dialogRef = this.dialog.open(TenantDetailComponent, {
|
|
369
|
+
width: this.options.dialogWidth,
|
|
370
|
+
maxHeight: this.options.dialogMaxHeight,
|
|
371
|
+
});
|
|
372
|
+
let instance = dialogRef.componentInstance;
|
|
373
|
+
instance.loadTenant(id);
|
|
374
|
+
}
|
|
375
|
+
delete(id) {
|
|
376
|
+
console.debug("delete", id);
|
|
377
|
+
this.confirm(this.doDelete.bind(this, id), {
|
|
378
|
+
title: "Dangerous action!",
|
|
379
|
+
message: "Please confirm that you want to delete this tenant? All data will be deleted and this action cannot be undone.",
|
|
380
|
+
messageClasses: "warn-color",
|
|
381
|
+
buttonText: "Delete forever",
|
|
382
|
+
buttonColor: "warn"
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
doDelete(id) {
|
|
386
|
+
this.tenantService.deleteTenant(id).subscribe({
|
|
387
|
+
complete: () => {
|
|
388
|
+
this.getData();
|
|
389
|
+
this.openSnackBar("Tenant was deleted!");
|
|
390
|
+
}, error: (error) => {
|
|
391
|
+
this.openSnackBar("Error deleting tenant!");
|
|
392
|
+
console.debug(error);
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
activate(id) {
|
|
397
|
+
console.debug("activate", id);
|
|
398
|
+
this.confirm(this.doActivate.bind(this, id), {
|
|
399
|
+
message: "Please confirm that you want to activate this tenant.",
|
|
400
|
+
messageClasses: "success-color",
|
|
401
|
+
buttonText: "Activate",
|
|
402
|
+
buttonColor: "success"
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
doActivate(id) {
|
|
406
|
+
this.tenantService.activateTenant(id).subscribe({
|
|
407
|
+
complete: () => {
|
|
408
|
+
this.getData();
|
|
409
|
+
this.openSnackBar("Tenant was activated!");
|
|
410
|
+
}, error: (error) => {
|
|
411
|
+
this.openSnackBar("Error activating tenant!");
|
|
412
|
+
console.debug(error);
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
reactivate(id) {
|
|
417
|
+
console.debug("reactivate", id);
|
|
418
|
+
this.confirm(this.doReactivate.bind(this, id), {
|
|
419
|
+
message: "Please confirm that you want to reactivate this tenant.",
|
|
420
|
+
messageClasses: "success-color",
|
|
421
|
+
buttonText: "Reactivate"
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
doReactivate(id) {
|
|
425
|
+
this.tenantService.reactivateTenant(id).subscribe({
|
|
426
|
+
complete: () => {
|
|
427
|
+
this.getData();
|
|
428
|
+
this.openSnackBar("Tenant was reactivated!");
|
|
429
|
+
}, error: (error) => {
|
|
430
|
+
this.openSnackBar("Error reactivating tenant!");
|
|
431
|
+
console.debug(error);
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
deactivate(id) {
|
|
436
|
+
console.debug("deactivate", id);
|
|
437
|
+
this.confirm(this.doDeactivate.bind(this, id), {
|
|
438
|
+
message: "Please confirm that you want to deactivate this tenant. Users will not be able to login!",
|
|
439
|
+
messageClasses: "warn-color",
|
|
440
|
+
buttonText: "Deactivate",
|
|
441
|
+
buttonColor: "warn"
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
doDeactivate(id) {
|
|
445
|
+
this.tenantService.deactivateTenant(id).subscribe({
|
|
446
|
+
complete: () => {
|
|
447
|
+
this.getData();
|
|
448
|
+
this.openSnackBar("Tenant was activated!");
|
|
449
|
+
}, error: (error) => {
|
|
450
|
+
this.openSnackBar("Error activating tenant!");
|
|
451
|
+
console.debug(error);
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
suspend(id) {
|
|
456
|
+
console.debug("suspend", id);
|
|
457
|
+
this.confirm(this.doSuspend.bind(this, id), {
|
|
458
|
+
message: "Please confirm that you want to suspend this tenant. Users will not be able to login!",
|
|
459
|
+
messageClasses: "warn-color",
|
|
460
|
+
buttonText: "Suspend",
|
|
461
|
+
buttonColor: "warn"
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
doSuspend(id) {
|
|
465
|
+
this.tenantService.suspendTenant(id).subscribe({
|
|
466
|
+
complete: () => {
|
|
467
|
+
this.getData();
|
|
468
|
+
this.openSnackBar("Tenant was suspended!");
|
|
469
|
+
}, error: (error) => {
|
|
470
|
+
this.openSnackBar("Error suspending tenant!");
|
|
471
|
+
console.debug(error);
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
abandon(id) {
|
|
476
|
+
console.debug("abandon", id);
|
|
477
|
+
this.confirm(this.doAbandon.bind(this, id), {
|
|
478
|
+
message: "Please confirm that you want to abandon this tenant. All data will be deleted and this action cannot be undone.",
|
|
479
|
+
messageClasses: "warn-color",
|
|
480
|
+
buttonText: "Abandon",
|
|
481
|
+
buttonColor: "warn"
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
doAbandon(id) {
|
|
485
|
+
this.tenantService.abandonTenant(id).subscribe({
|
|
486
|
+
complete: () => {
|
|
487
|
+
this.getData();
|
|
488
|
+
this.openSnackBar("Tenant was abandoned!");
|
|
489
|
+
}, error: (error) => {
|
|
490
|
+
this.openSnackBar("Error abandoning tenant!");
|
|
491
|
+
console.debug(error);
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
approve(id) {
|
|
496
|
+
console.debug("approve", id);
|
|
497
|
+
this.confirm(this.doApprove.bind(this, id), {
|
|
498
|
+
message: "Please confirm that you want to approve this tenant.",
|
|
499
|
+
messageClasses: "success-color",
|
|
500
|
+
buttonText: "Approve",
|
|
501
|
+
buttonColor: "success"
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
doApprove(id) {
|
|
505
|
+
this.tenantService.approveTenant(id).subscribe({
|
|
506
|
+
complete: () => {
|
|
507
|
+
this.getData();
|
|
508
|
+
this.openSnackBar("Tenant was approved!");
|
|
509
|
+
}, error: (error) => {
|
|
510
|
+
this.openSnackBar("Error approving tenant!");
|
|
511
|
+
console.debug(error);
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
reject(id) {
|
|
516
|
+
console.debug("reject", id);
|
|
517
|
+
this.confirm(this.doReject.bind(this, id), {
|
|
518
|
+
message: "Please confirm that you want to reject this tenant.",
|
|
519
|
+
messageClasses: "warn-color",
|
|
520
|
+
buttonText: "Reject",
|
|
521
|
+
buttonColor: "warn"
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
doReject(id) {
|
|
525
|
+
this.tenantService.rejectTenant(id).subscribe({
|
|
526
|
+
complete: () => {
|
|
527
|
+
this.getData();
|
|
528
|
+
this.openSnackBar("Tenant was rejected!");
|
|
529
|
+
}, error: (error) => {
|
|
530
|
+
this.openSnackBar("Error rejecting tenant!");
|
|
531
|
+
console.debug(error);
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
settings(id) {
|
|
536
|
+
const dialogRef = this.dialog.open(DictBuilderComponent, {
|
|
537
|
+
width: this.options.dialogWidth,
|
|
538
|
+
maxHeight: this.options.dialogMaxHeight,
|
|
539
|
+
});
|
|
540
|
+
let instance = dialogRef.componentInstance;
|
|
541
|
+
instance.title = "Tenant settings";
|
|
542
|
+
instance.loading = true;
|
|
543
|
+
instance.type = ModelType.Configuration;
|
|
544
|
+
this.tenantService.getTenantSettings(id).subscribe({
|
|
545
|
+
next: (settings) => {
|
|
546
|
+
instance.loading = false;
|
|
547
|
+
instance.models = settings.map(s => new KeyValue(s.key, s.value, s.inherited, s.overridden));
|
|
548
|
+
}, error: (error) => {
|
|
549
|
+
this.openSnackBar("Error getting tenant settings!");
|
|
550
|
+
console.debug(error);
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
instance.saved.subscribe((model) => {
|
|
554
|
+
var settings = instance.models.map(m => new TenantSetting(m.key, m.value, m.inherited));
|
|
555
|
+
this.tenantService.updateTenantSettings(id, settings).subscribe({
|
|
556
|
+
next: () => {
|
|
557
|
+
this.openSnackBar("Tenant settings was updated!");
|
|
558
|
+
dialogRef.close();
|
|
559
|
+
}, error: (error) => {
|
|
560
|
+
this.openSnackBar("Error updating tenant settings!");
|
|
561
|
+
console.debug(error);
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
});
|
|
565
|
+
instance.cancelled.subscribe(() => {
|
|
566
|
+
this.openSnackBar("Tenant setting was cancelled!");
|
|
567
|
+
dialogRef.close();
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
rootSettings() {
|
|
571
|
+
const dialogRef = this.dialog.open(DictBuilderComponent, {
|
|
572
|
+
width: this.options.dialogWidth,
|
|
573
|
+
maxHeight: this.options.dialogMaxHeight,
|
|
574
|
+
});
|
|
575
|
+
let instance = dialogRef.componentInstance;
|
|
576
|
+
instance.title = "Root settings";
|
|
577
|
+
instance.loading = true;
|
|
578
|
+
instance.type = ModelType.Configuration;
|
|
579
|
+
this.tenantService.getRootSettings().subscribe({
|
|
580
|
+
next: (settings) => {
|
|
581
|
+
instance.loading = false;
|
|
582
|
+
instance.models = settings.map(s => new KeyValue(s.key, s.value, false, false));
|
|
583
|
+
}, error: (error) => {
|
|
584
|
+
this.openSnackBar("Error getting root settings!");
|
|
585
|
+
console.debug(error);
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
instance.saved.subscribe((model) => {
|
|
589
|
+
var settings = instance.models.map(m => new TenantSetting(m.key, m.value, false));
|
|
590
|
+
this.tenantService.updateRootSettings(settings).subscribe({
|
|
591
|
+
next: () => {
|
|
592
|
+
this.openSnackBar("Root settings was updated!");
|
|
593
|
+
dialogRef.close();
|
|
594
|
+
}, error: (error) => {
|
|
595
|
+
this.openSnackBar("Error updating root settings!");
|
|
596
|
+
console.debug(error);
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
});
|
|
600
|
+
instance.cancelled.subscribe(() => {
|
|
601
|
+
this.openSnackBar("Root setting was cancelled!");
|
|
602
|
+
dialogRef.close();
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
//#endregion
|
|
606
|
+
//#region status rules
|
|
607
|
+
canActivate(status) {
|
|
608
|
+
var s = (typeof status == "string" ? TenantStatus[status] : status);
|
|
609
|
+
return s == TenantStatus.New
|
|
610
|
+
|| s == TenantStatus.Initialized
|
|
611
|
+
|| s == TenantStatus.Approved
|
|
612
|
+
|| s == TenantStatus.PendingToActive;
|
|
613
|
+
}
|
|
614
|
+
canReactivate(status) {
|
|
615
|
+
var s = (typeof status == "string" ? TenantStatus[status] : status);
|
|
616
|
+
return s == TenantStatus.Inactive || s == TenantStatus.Suspended;
|
|
617
|
+
}
|
|
618
|
+
canDeactivate(status) {
|
|
619
|
+
var s = (typeof status == "string" ? TenantStatus[status] : status);
|
|
620
|
+
return s == TenantStatus.Active;
|
|
621
|
+
}
|
|
622
|
+
canSuspend(status) {
|
|
623
|
+
var s = (typeof status == "string" ? TenantStatus[status] : status);
|
|
624
|
+
return s == TenantStatus.Active || s == TenantStatus.Inactive;
|
|
625
|
+
}
|
|
626
|
+
canDelete(status) {
|
|
627
|
+
var s = (typeof status == "string" ? TenantStatus[status] : status);
|
|
628
|
+
return s == TenantStatus.New
|
|
629
|
+
|| s == TenantStatus.Initialized
|
|
630
|
+
|| s == TenantStatus.Approved
|
|
631
|
+
|| s == TenantStatus.PendingToActive
|
|
632
|
+
|| s == TenantStatus.Inactive
|
|
633
|
+
|| s == TenantStatus.Suspended
|
|
634
|
+
|| s == TenantStatus.Abandoned;
|
|
635
|
+
}
|
|
636
|
+
canAbandon(status) {
|
|
637
|
+
var s = (typeof status == "string" ? TenantStatus[status] : status);
|
|
638
|
+
return s != TenantStatus.Abandoned;
|
|
639
|
+
}
|
|
640
|
+
canApproval(status) {
|
|
641
|
+
var s = (typeof status == "string" ? TenantStatus[status] : status);
|
|
642
|
+
return s == TenantStatus.PendingApproval;
|
|
643
|
+
}
|
|
644
|
+
//#endregion
|
|
645
|
+
//#region common
|
|
646
|
+
statusCompareFn(o1, o2) {
|
|
647
|
+
return o1 == o2 || (o1 == null && o2 == null) || (o1 == undefined && o2 == undefined)
|
|
648
|
+
|| (o1 == null && o2 == undefined) || (o1 == undefined && o2 == null);
|
|
649
|
+
}
|
|
650
|
+
confirm(callback, options) {
|
|
651
|
+
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
|
|
652
|
+
width: '350px',
|
|
653
|
+
data: options
|
|
654
|
+
});
|
|
655
|
+
let instance = dialogRef.componentInstance;
|
|
656
|
+
instance.confirmed.subscribe(() => {
|
|
657
|
+
dialogRef.close();
|
|
658
|
+
callback();
|
|
659
|
+
});
|
|
660
|
+
instance.cancelled.subscribe(() => {
|
|
661
|
+
dialogRef.close();
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
openSnackBar(message) {
|
|
665
|
+
this.localizer.get([message, "Close"]).subscribe((value) => {
|
|
666
|
+
this.snackBar.open(value[message], value["Close"], {
|
|
667
|
+
duration: 3000
|
|
668
|
+
});
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
TenantsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantsComponent, deps: [{ token: TenantAdminService }, { token: i2.Router }, { token: i2.ActivatedRoute }, { token: i3.Location }, { token: i2.UrlSerializer }, { token: i4.FormBuilder }, { token: i5.MatDialog }, { token: i6.MatSnackBar }, { token: i7.TranslateService }, { token: TenantConfiguration }], target: i0.ɵɵFactoryTarget.Component });
|
|
673
|
+
TenantsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", 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 minimum-density\">\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] || ''}}\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\" (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 <div style=\"flex: 1 auto; text-align: right;\">\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 </form>\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%}.mat-mdc-button-base{margin:0 8px 8px 0}.additional-selection{opacity:.75;font-size:.75em;line-height:0}.clear-statuses{padding:10px;cursor:pointer}.button-cell{display:flex;justify-content:space-between;align-items:center;padding-top:2px;padding-bottom:2px}.button-cell button{margin-top:6px;height:28px}.actions-cell{display:flex;justify-content:center;align-items:center;padding-top:2px;padding-bottom:2px}.actions-cell button{height:28px}.table-form{display:flex;flex-direction:row;align-items:baseline}.table-form mat-card-actions{flex:1 1 auto}.mat-mdc-menu-item{min-height:38px}\n"], dependencies: [{ kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i9.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: i9.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6$1.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", "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.KeyValuePipe, name: "keyvalue" }] });
|
|
674
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantsComponent, decorators: [{
|
|
675
|
+
type: Component,
|
|
676
|
+
args: [{ selector: 'juice-tenants', template: "<div class=\"mat-elevation-z2 minimum-density\">\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] || ''}}\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\" (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 <div style=\"flex: 1 auto; text-align: right;\">\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 </form>\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%}.mat-mdc-button-base{margin:0 8px 8px 0}.additional-selection{opacity:.75;font-size:.75em;line-height:0}.clear-statuses{padding:10px;cursor:pointer}.button-cell{display:flex;justify-content:space-between;align-items:center;padding-top:2px;padding-bottom:2px}.button-cell button{margin-top:6px;height:28px}.actions-cell{display:flex;justify-content:center;align-items:center;padding-top:2px;padding-bottom:2px}.actions-cell button{height:28px}.table-form{display:flex;flex-direction:row;align-items:baseline}.table-form mat-card-actions{flex:1 1 auto}.mat-mdc-menu-item{min-height:38px}\n"] }]
|
|
677
|
+
}], ctorParameters: function () { return [{ type: TenantAdminService }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i3.Location }, { type: i2.UrlSerializer }, { type: i4.FormBuilder }, { type: i5.MatDialog }, { type: i6.MatSnackBar }, { type: i7.TranslateService }, { type: TenantConfiguration }]; }, propDecorators: { paginator: [{
|
|
678
|
+
type: ViewChild,
|
|
679
|
+
args: [MatPaginator]
|
|
680
|
+
}], sort: [{
|
|
681
|
+
type: ViewChild,
|
|
682
|
+
args: [MatMultiSort]
|
|
683
|
+
}] } });
|
|
684
|
+
|
|
685
|
+
class TenantDetailComponent {
|
|
686
|
+
constructor(tenantService) {
|
|
687
|
+
this.tenantService = tenantService;
|
|
688
|
+
this.tenantIdentifier = "";
|
|
689
|
+
this.statusHelper = TenantStatusHelper;
|
|
690
|
+
}
|
|
691
|
+
loadTenant(identifier) {
|
|
692
|
+
this.tenantService.getTenant(identifier).subscribe(tenant => {
|
|
693
|
+
this.tenant = tenant;
|
|
694
|
+
this.properties = JSON.parse(tenant.serializedProperties);
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
ngOnChanges() {
|
|
698
|
+
this.loadTenant(this.tenantIdentifier);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
TenantDetailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantDetailComponent, deps: [{ token: TenantAdminService }], target: i0.ɵɵFactoryTarget.Component });
|
|
702
|
+
TenantDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TenantDetailComponent, selector: "juice-tenant-detail", inputs: { tenantIdentifier: "tenantIdentifier" }, usesOnChanges: true, ngImport: i0, template: "<mat-card>\n <mat-card-header>\n <mat-card-title>{{ 'Organization information' | translate }}</mat-card-title>\n </mat-card-header>\n\n <mat-card-content>\n <div *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 </div>\n </mat-card-content>\n</mat-card>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i9.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i5$1.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i5$1.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i5$1.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i6$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6$2.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i6$2.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i6$2.MatListItemLine, selector: "[matListItemLine]" }, { kind: "directive", type: i6$2.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.KeyValuePipe, name: "keyvalue" }] });
|
|
703
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantDetailComponent, decorators: [{
|
|
704
|
+
type: Component,
|
|
705
|
+
args: [{ selector: 'juice-tenant-detail', template: "<mat-card>\n <mat-card-header>\n <mat-card-title>{{ 'Organization information' | translate }}</mat-card-title>\n </mat-card-header>\n\n <mat-card-content>\n <div *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 </div>\n </mat-card-content>\n</mat-card>\n", styles: [":host{display:block}\n"] }]
|
|
706
|
+
}], ctorParameters: function () { return [{ type: TenantAdminService }]; }, propDecorators: { tenantIdentifier: [{
|
|
707
|
+
type: Input
|
|
708
|
+
}] } });
|
|
709
|
+
|
|
710
|
+
class TenantSummaryComponent {
|
|
711
|
+
constructor(tenantService) {
|
|
712
|
+
this.tenantService = tenantService;
|
|
713
|
+
this.tenantIdentifier = "";
|
|
714
|
+
}
|
|
715
|
+
loadTenant(identifier) {
|
|
716
|
+
this.tenantService.getSummary(identifier).subscribe(tenant => {
|
|
717
|
+
this.tenant = tenant;
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
ngOnChanges() {
|
|
721
|
+
this.loadTenant(this.tenantIdentifier);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
TenantSummaryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantSummaryComponent, deps: [{ token: TenantAdminService }], target: i0.ɵɵFactoryTarget.Component });
|
|
725
|
+
TenantSummaryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TenantSummaryComponent, selector: "juice-tenant-summary", inputs: { tenantIdentifier: "tenantIdentifier" }, usesOnChanges: true, ngImport: i0, template: "<mat-card>\n <mat-card-header>\n <mat-card-title>{{ 'Organization summary' | translate }}</mat-card-title>\n </mat-card-header>\n <mat-card-content>\n <div *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 </div>\n </mat-card-content>\n</mat-card>", styles: [":host{display:block;margin:10px}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i5$1.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i5$1.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i5$1.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i6$2.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i6$2.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i6$2.MatListItemLine, selector: "[matListItemLine]" }, { kind: "directive", type: i6$2.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] });
|
|
726
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantSummaryComponent, decorators: [{
|
|
727
|
+
type: Component,
|
|
728
|
+
args: [{ selector: 'juice-tenant-summary', template: "<mat-card>\n <mat-card-header>\n <mat-card-title>{{ 'Organization summary' | translate }}</mat-card-title>\n </mat-card-header>\n <mat-card-content>\n <div *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 </div>\n </mat-card-content>\n</mat-card>", styles: [":host{display:block;margin:10px}\n"] }]
|
|
729
|
+
}], ctorParameters: function () { return [{ type: TenantAdminService }]; }, propDecorators: { tenantIdentifier: [{
|
|
730
|
+
type: Input
|
|
731
|
+
}] } });
|
|
732
|
+
|
|
733
|
+
class TenantCreate {
|
|
734
|
+
constructor() {
|
|
735
|
+
this.name = "";
|
|
736
|
+
this.identifier = "";
|
|
737
|
+
this.connectionString = "";
|
|
738
|
+
this.adminUser = "";
|
|
739
|
+
this.adminEmail = "";
|
|
740
|
+
this.properties = {};
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
class TenantCreated {
|
|
744
|
+
constructor() {
|
|
745
|
+
this.id = "";
|
|
746
|
+
this.identifier = "";
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
/** Error when invalid control is dirty, touched, or submitted. */
|
|
751
|
+
class CustomErrorStateMatcher {
|
|
752
|
+
isErrorState(control, form) {
|
|
753
|
+
const isSubmitted = form && form.submitted;
|
|
754
|
+
return !!(control && control.invalid && (control.dirty || control.touched || isSubmitted));
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
class TenantCreateComponent {
|
|
759
|
+
constructor(tenantService) {
|
|
760
|
+
this.tenantService = tenantService;
|
|
761
|
+
this.model = new TenantCreate();
|
|
762
|
+
this.emailFormControl = new FormControl('', [Validators.email]);
|
|
763
|
+
this.identifierFormControl = new FormControl('', [Validators.required]);
|
|
764
|
+
this.nameFormControl = new FormControl('', [Validators.required]);
|
|
765
|
+
this.createForm = new FormGroup({
|
|
766
|
+
identifier: this.identifierFormControl,
|
|
767
|
+
name: this.nameFormControl,
|
|
768
|
+
email: this.emailFormControl
|
|
769
|
+
});
|
|
770
|
+
this.matcher = new CustomErrorStateMatcher();
|
|
771
|
+
this.created = new EventEmitter();
|
|
772
|
+
this.cancelled = new EventEmitter();
|
|
773
|
+
}
|
|
774
|
+
ngOnInit() {
|
|
775
|
+
}
|
|
776
|
+
updateModel() {
|
|
777
|
+
var _a, _b, _c;
|
|
778
|
+
var value = this.createForm.value;
|
|
779
|
+
this.model.identifier = (_a = value.identifier) !== null && _a !== void 0 ? _a : '';
|
|
780
|
+
this.model.name = (_b = value.name) !== null && _b !== void 0 ? _b : '';
|
|
781
|
+
this.model.adminEmail = (_c = value.email) !== null && _c !== void 0 ? _c : '';
|
|
782
|
+
}
|
|
783
|
+
submit() {
|
|
784
|
+
if (this.createForm.valid) {
|
|
785
|
+
this.updateModel();
|
|
786
|
+
this.tenantService.createTenant(this.model).subscribe({
|
|
787
|
+
next: (result) => {
|
|
788
|
+
if (this.created != null) {
|
|
789
|
+
this.created.emit(result);
|
|
790
|
+
}
|
|
791
|
+
this.createForm.reset();
|
|
792
|
+
this.model = new TenantCreate();
|
|
793
|
+
},
|
|
794
|
+
error: (err) => {
|
|
795
|
+
}
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
cancel() {
|
|
800
|
+
this.cancelled.emit();
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
TenantCreateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantCreateComponent, deps: [{ token: TenantAdminService }], target: i0.ɵɵFactoryTarget.Component });
|
|
804
|
+
TenantCreateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TenantCreateComponent, selector: "juice-tenant-create", outputs: { created: "created", cancelled: "cancelled" }, ngImport: i0, template: "\n<mat-card>\n <mat-card-header>\n <mat-card-title>{{ 'Create new organization' | translate }}</mat-card-title>\n </mat-card-header>\n <mat-card-content style=\"padding-top: 10px;\">\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-card-content>\n <mat-card-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-card-actions>\n</mat-card>", styles: [":host{display:block}mat-form-field{width:100%}.mat-mdc-button-base{margin:0 8px 8px 0}\n"], dependencies: [{ kind: "directive", type: i4.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i9.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: i5$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i5$1.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i5$1.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i5$1.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i5$1.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i6$1.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" }] });
|
|
805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantCreateComponent, decorators: [{
|
|
806
|
+
type: Component,
|
|
807
|
+
args: [{ selector: 'juice-tenant-create', template: "\n<mat-card>\n <mat-card-header>\n <mat-card-title>{{ 'Create new organization' | translate }}</mat-card-title>\n </mat-card-header>\n <mat-card-content style=\"padding-top: 10px;\">\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-card-content>\n <mat-card-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-card-actions>\n</mat-card>", styles: [":host{display:block}mat-form-field{width:100%}.mat-mdc-button-base{margin:0 8px 8px 0}\n"] }]
|
|
808
|
+
}], ctorParameters: function () { return [{ type: TenantAdminService }]; }, propDecorators: { created: [{
|
|
809
|
+
type: Output
|
|
810
|
+
}], cancelled: [{
|
|
811
|
+
type: Output
|
|
812
|
+
}] } });
|
|
813
|
+
|
|
814
|
+
class TenantUpdate {
|
|
815
|
+
constructor() {
|
|
816
|
+
this.name = "";
|
|
817
|
+
this.identifier = "";
|
|
818
|
+
this.connectionString = "";
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
class TenantUpdateComponent {
|
|
823
|
+
constructor(tenantService) {
|
|
824
|
+
this.tenantService = tenantService;
|
|
825
|
+
this.model = new TenantUpdate();
|
|
826
|
+
this.identifierFormControl = new FormControl(this.model.identifier, [Validators.required]);
|
|
827
|
+
this.nameFormControl = new FormControl(this.model.name, [Validators.required]);
|
|
828
|
+
this.coneectionFormControl = new FormControl(this.model.connectionString, []);
|
|
829
|
+
this.updateForm = new FormGroup({
|
|
830
|
+
identifier: this.identifierFormControl,
|
|
831
|
+
name: this.nameFormControl,
|
|
832
|
+
connectionString: this.coneectionFormControl
|
|
833
|
+
});
|
|
834
|
+
this.matcher = new CustomErrorStateMatcher();
|
|
835
|
+
this.updated = new EventEmitter();
|
|
836
|
+
this.cancelled = new EventEmitter();
|
|
837
|
+
}
|
|
838
|
+
ngOnChanges() {
|
|
839
|
+
this.tenantService.getTenant(this.id).subscribe((result) => {
|
|
840
|
+
this.updateForm.patchValue(result);
|
|
841
|
+
this.updateModel();
|
|
842
|
+
if (this.id == result.identifier) {
|
|
843
|
+
this.id = result.id;
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
updateModel() {
|
|
848
|
+
var _a, _b, _c;
|
|
849
|
+
var value = this.updateForm.value;
|
|
850
|
+
this.model.identifier = (_a = value.identifier) !== null && _a !== void 0 ? _a : '';
|
|
851
|
+
this.model.name = (_b = value.name) !== null && _b !== void 0 ? _b : '';
|
|
852
|
+
this.model.connectionString = (_c = value.connectionString) !== null && _c !== void 0 ? _c : '';
|
|
853
|
+
}
|
|
854
|
+
// for modal control
|
|
855
|
+
setId(value) {
|
|
856
|
+
this.id = value;
|
|
857
|
+
this.ngOnChanges();
|
|
858
|
+
}
|
|
859
|
+
submit() {
|
|
860
|
+
if (this.updateForm.valid) {
|
|
861
|
+
this.updateModel();
|
|
862
|
+
this.tenantService.updateTenant(this.id, this.model).subscribe((_) => {
|
|
863
|
+
this.updateForm.reset();
|
|
864
|
+
this.model = new TenantUpdate();
|
|
865
|
+
this.updated.emit(this.id);
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
cancel() {
|
|
870
|
+
this.cancelled.emit(this.id);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
TenantUpdateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantUpdateComponent, deps: [{ token: TenantAdminService }], target: i0.ɵɵFactoryTarget.Component });
|
|
874
|
+
TenantUpdateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TenantUpdateComponent, selector: "juice-tenant-update", inputs: { id: "id" }, outputs: { updated: "updated", cancelled: "cancelled" }, usesOnChanges: true, ngImport: i0, template: "\n<mat-card>\n <mat-card-header>\n <mat-card-title>{{ 'Update organization information' | translate }}</mat-card-title>\n </mat-card-header>\n <mat-card-content style=\"padding-top: 10px;\">\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-card-content>\n <mat-card-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-card-actions>\n</mat-card>", styles: [":host{display:block}mat-form-field{width:100%}.mat-mdc-button-base{margin:0 8px 8px 0}\n"], dependencies: [{ kind: "directive", type: i4.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i9.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: i5$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i5$1.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i5$1.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i5$1.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i5$1.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i6$1.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" }] });
|
|
875
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantUpdateComponent, decorators: [{
|
|
876
|
+
type: Component,
|
|
877
|
+
args: [{ selector: 'juice-tenant-update', template: "\n<mat-card>\n <mat-card-header>\n <mat-card-title>{{ 'Update organization information' | translate }}</mat-card-title>\n </mat-card-header>\n <mat-card-content style=\"padding-top: 10px;\">\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-card-content>\n <mat-card-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-card-actions>\n</mat-card>", styles: [":host{display:block}mat-form-field{width:100%}.mat-mdc-button-base{margin:0 8px 8px 0}\n"] }]
|
|
878
|
+
}], ctorParameters: function () { return [{ type: TenantAdminService }]; }, propDecorators: { id: [{
|
|
879
|
+
type: Input
|
|
880
|
+
}], updated: [{
|
|
881
|
+
type: Output
|
|
882
|
+
}], cancelled: [{
|
|
883
|
+
type: Output
|
|
884
|
+
}] } });
|
|
885
|
+
|
|
886
|
+
class ConfirmDialogComponent {
|
|
887
|
+
constructor(data) {
|
|
888
|
+
this.data = data;
|
|
889
|
+
this.confirmed = new EventEmitter();
|
|
890
|
+
this.cancelled = new EventEmitter();
|
|
891
|
+
this.confirmMessage = "Are you sure?";
|
|
892
|
+
this.confirmMessageClasses = "";
|
|
893
|
+
this.confirmTitle = "Action required";
|
|
894
|
+
this.confirmButtonText = "Confirm";
|
|
895
|
+
this.confirmButtonColor = "primary";
|
|
896
|
+
if (data.title) {
|
|
897
|
+
this.confirmTitle = data.title;
|
|
898
|
+
}
|
|
899
|
+
if (data.message) {
|
|
900
|
+
this.confirmMessage = data.message;
|
|
901
|
+
}
|
|
902
|
+
if (data.buttonText) {
|
|
903
|
+
this.confirmButtonText = data.buttonText;
|
|
904
|
+
}
|
|
905
|
+
if (data.buttonColor) {
|
|
906
|
+
this.confirmButtonColor = data.buttonColor;
|
|
907
|
+
}
|
|
908
|
+
if (data.messageClasses) {
|
|
909
|
+
this.confirmMessageClasses = data.messageClasses;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
confirm() {
|
|
913
|
+
this.confirmed.emit();
|
|
914
|
+
}
|
|
915
|
+
cancel() {
|
|
916
|
+
this.cancelled.emit();
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
ConfirmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfirmDialogComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
920
|
+
ConfirmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ConfirmDialogComponent, selector: "juice-confirm-dialog", outputs: { confirmed: "confirmed", cancelled: "cancelled" }, ngImport: i0, template: "<mat-card>\n <mat-card-header>\n <mat-card-title>{{ confirmTitle | translate }}</mat-card-title>\n <mat-card-subtitle [class]=\"confirmMessageClasses\">{{ confirmMessage | translate }}</mat-card-subtitle>\n </mat-card-header>\n <mat-card-actions align=\"end\">\n <button mat-button (click)=\"confirm()\" [color]=\"confirmButtonColor\">{{ confirmButtonText | translate }}</button>\n <button mat-button (click)=\"cancel()\">{{ 'Cancel' | translate }}</button>\n </mat-card-actions>\n </mat-card>", styles: [":host mat-card{width:350px}:host mat-card-subtitle{padding-top:12px!important;padding:12px}\n"], dependencies: [{ kind: "component", type: i9.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: i5$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i5$1.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "component", type: i5$1.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i5$1.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { kind: "directive", type: i5$1.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] });
|
|
921
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
|
|
922
|
+
type: Component,
|
|
923
|
+
args: [{ selector: 'juice-confirm-dialog', template: "<mat-card>\n <mat-card-header>\n <mat-card-title>{{ confirmTitle | translate }}</mat-card-title>\n <mat-card-subtitle [class]=\"confirmMessageClasses\">{{ confirmMessage | translate }}</mat-card-subtitle>\n </mat-card-header>\n <mat-card-actions align=\"end\">\n <button mat-button (click)=\"confirm()\" [color]=\"confirmButtonColor\">{{ confirmButtonText | translate }}</button>\n <button mat-button (click)=\"cancel()\">{{ 'Cancel' | translate }}</button>\n </mat-card-actions>\n </mat-card>", styles: [":host mat-card{width:350px}:host mat-card-subtitle{padding-top:12px!important;padding:12px}\n"] }]
|
|
924
|
+
}], ctorParameters: function () {
|
|
925
|
+
return [{ type: undefined, decorators: [{
|
|
926
|
+
type: Inject,
|
|
927
|
+
args: [MAT_DIALOG_DATA]
|
|
928
|
+
}] }];
|
|
929
|
+
}, propDecorators: { confirmed: [{
|
|
930
|
+
type: Output
|
|
931
|
+
}], cancelled: [{
|
|
932
|
+
type: Output
|
|
933
|
+
}] } });
|
|
934
|
+
|
|
935
|
+
class MaterialModule {
|
|
936
|
+
}
|
|
937
|
+
MaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
938
|
+
MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: MaterialModule, exports: [MatButtonModule,
|
|
939
|
+
MatCardModule,
|
|
940
|
+
MatCheckboxModule,
|
|
941
|
+
MatDatepickerModule,
|
|
942
|
+
MatDialogModule,
|
|
943
|
+
MatDividerModule,
|
|
944
|
+
MatExpansionModule,
|
|
945
|
+
MatGridListModule,
|
|
946
|
+
MatIconModule,
|
|
947
|
+
MatInputModule,
|
|
948
|
+
MatListModule,
|
|
949
|
+
MatMenuModule,
|
|
950
|
+
MatNativeDateModule,
|
|
951
|
+
MatPaginatorModule,
|
|
952
|
+
MatProgressBarModule,
|
|
953
|
+
MatProgressSpinnerModule,
|
|
954
|
+
MatRadioModule,
|
|
955
|
+
MatRippleModule,
|
|
956
|
+
MatSelectModule,
|
|
957
|
+
MatSliderModule,
|
|
958
|
+
MatSlideToggleModule,
|
|
959
|
+
MatSnackBarModule,
|
|
960
|
+
MatSortModule,
|
|
961
|
+
MatTableModule,
|
|
962
|
+
MatTabsModule,
|
|
963
|
+
MatToolbarModule,
|
|
964
|
+
MatTooltipModule,
|
|
965
|
+
MatTreeModule] });
|
|
966
|
+
MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MaterialModule, imports: [MatButtonModule,
|
|
967
|
+
MatCardModule,
|
|
968
|
+
MatCheckboxModule,
|
|
969
|
+
MatDatepickerModule,
|
|
970
|
+
MatDialogModule,
|
|
971
|
+
MatDividerModule,
|
|
972
|
+
MatExpansionModule,
|
|
973
|
+
MatGridListModule,
|
|
974
|
+
MatIconModule,
|
|
975
|
+
MatInputModule,
|
|
976
|
+
MatListModule,
|
|
977
|
+
MatMenuModule,
|
|
978
|
+
MatNativeDateModule,
|
|
979
|
+
MatPaginatorModule,
|
|
980
|
+
MatProgressBarModule,
|
|
981
|
+
MatProgressSpinnerModule,
|
|
982
|
+
MatRadioModule,
|
|
983
|
+
MatRippleModule,
|
|
984
|
+
MatSelectModule,
|
|
985
|
+
MatSliderModule,
|
|
986
|
+
MatSlideToggleModule,
|
|
987
|
+
MatSnackBarModule,
|
|
988
|
+
MatSortModule,
|
|
989
|
+
MatTableModule,
|
|
990
|
+
MatTabsModule,
|
|
991
|
+
MatToolbarModule,
|
|
992
|
+
MatTooltipModule,
|
|
993
|
+
MatTreeModule] });
|
|
994
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MaterialModule, decorators: [{
|
|
995
|
+
type: NgModule,
|
|
996
|
+
args: [{
|
|
997
|
+
exports: [
|
|
998
|
+
MatButtonModule,
|
|
999
|
+
MatCardModule,
|
|
1000
|
+
MatCheckboxModule,
|
|
1001
|
+
MatDatepickerModule,
|
|
1002
|
+
MatDialogModule,
|
|
1003
|
+
MatDividerModule,
|
|
1004
|
+
MatExpansionModule,
|
|
1005
|
+
MatGridListModule,
|
|
1006
|
+
MatIconModule,
|
|
1007
|
+
MatInputModule,
|
|
1008
|
+
MatListModule,
|
|
1009
|
+
MatMenuModule,
|
|
1010
|
+
MatNativeDateModule,
|
|
1011
|
+
MatPaginatorModule,
|
|
1012
|
+
MatProgressBarModule,
|
|
1013
|
+
MatProgressSpinnerModule,
|
|
1014
|
+
MatRadioModule,
|
|
1015
|
+
MatRippleModule,
|
|
1016
|
+
MatSelectModule,
|
|
1017
|
+
MatSliderModule,
|
|
1018
|
+
MatSlideToggleModule,
|
|
1019
|
+
MatSnackBarModule,
|
|
1020
|
+
MatSortModule,
|
|
1021
|
+
MatTableModule,
|
|
1022
|
+
MatTabsModule,
|
|
1023
|
+
MatToolbarModule,
|
|
1024
|
+
MatTooltipModule,
|
|
1025
|
+
MatTreeModule
|
|
1026
|
+
]
|
|
1027
|
+
}]
|
|
1028
|
+
}] });
|
|
1029
|
+
|
|
1030
|
+
class TenantsModule {
|
|
1031
|
+
static forRoot(environment) {
|
|
1032
|
+
return {
|
|
1033
|
+
ngModule: TenantsModule,
|
|
1034
|
+
providers: [
|
|
1035
|
+
TenantAdminService,
|
|
1036
|
+
{
|
|
1037
|
+
provide: TenantConfiguration,
|
|
1038
|
+
useValue: environment
|
|
1039
|
+
}
|
|
1040
|
+
]
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
TenantsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1045
|
+
TenantsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: TenantsModule, declarations: [TenantsComponent,
|
|
1046
|
+
TenantDetailComponent,
|
|
1047
|
+
TenantSummaryComponent,
|
|
1048
|
+
TenantCreateComponent,
|
|
1049
|
+
TenantUpdateComponent,
|
|
1050
|
+
ConfirmDialogComponent], imports: [TranslateModule,
|
|
1051
|
+
FormsModule,
|
|
1052
|
+
ReactiveFormsModule,
|
|
1053
|
+
CommonModule,
|
|
1054
|
+
MaterialModule,
|
|
1055
|
+
ClipboardModule,
|
|
1056
|
+
MatMultiSortModule], exports: [TenantsComponent,
|
|
1057
|
+
TenantDetailComponent,
|
|
1058
|
+
TenantSummaryComponent,
|
|
1059
|
+
TenantCreateComponent,
|
|
1060
|
+
TenantUpdateComponent,
|
|
1061
|
+
TranslateModule] });
|
|
1062
|
+
TenantsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantsModule, imports: [TranslateModule,
|
|
1063
|
+
FormsModule,
|
|
1064
|
+
ReactiveFormsModule,
|
|
1065
|
+
CommonModule,
|
|
1066
|
+
MaterialModule,
|
|
1067
|
+
ClipboardModule,
|
|
1068
|
+
MatMultiSortModule, TranslateModule] });
|
|
1069
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantsModule, decorators: [{
|
|
1070
|
+
type: NgModule,
|
|
1071
|
+
args: [{
|
|
1072
|
+
declarations: [
|
|
1073
|
+
TenantsComponent,
|
|
1074
|
+
TenantDetailComponent,
|
|
1075
|
+
TenantSummaryComponent,
|
|
1076
|
+
TenantCreateComponent,
|
|
1077
|
+
TenantUpdateComponent,
|
|
1078
|
+
ConfirmDialogComponent
|
|
1079
|
+
],
|
|
1080
|
+
imports: [
|
|
1081
|
+
TranslateModule,
|
|
1082
|
+
FormsModule,
|
|
1083
|
+
ReactiveFormsModule,
|
|
1084
|
+
CommonModule,
|
|
1085
|
+
MaterialModule,
|
|
1086
|
+
ClipboardModule,
|
|
1087
|
+
MatMultiSortModule
|
|
1088
|
+
],
|
|
1089
|
+
exports: [
|
|
1090
|
+
TenantsComponent,
|
|
1091
|
+
TenantDetailComponent,
|
|
1092
|
+
TenantSummaryComponent,
|
|
1093
|
+
TenantCreateComponent,
|
|
1094
|
+
TenantUpdateComponent,
|
|
1095
|
+
TranslateModule
|
|
1096
|
+
]
|
|
1097
|
+
}]
|
|
1098
|
+
}] });
|
|
1099
|
+
|
|
1100
|
+
/*
|
|
1101
|
+
* Public API Surface of tenants
|
|
1102
|
+
*/
|
|
1103
|
+
|
|
1104
|
+
/**
|
|
1105
|
+
* Generated bundle index. Do not edit.
|
|
1106
|
+
*/
|
|
1107
|
+
|
|
1108
|
+
export { ConfirmDialogComponent, TenantAdminService, TenantCreateComponent, TenantDetailComponent, TenantSummaryComponent, TenantUpdateComponent, TenantsComponent, TenantsModule };
|
|
1109
|
+
//# sourceMappingURL=juice-js-tenants.mjs.map
|