@juice-js/tenants 1.1.1 → 1.1.2-alpha.3
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/lib/tenants.component.mjs +16 -16
- package/fesm2015/juice-js-tenants.mjs +15 -15
- package/fesm2015/juice-js-tenants.mjs.map +1 -1
- package/fesm2020/juice-js-tenants.mjs +15 -15
- package/fesm2020/juice-js-tenants.mjs.map +1 -1
- package/lib/tenants.component.d.ts +1 -0
- package/package.json +3 -3
|
@@ -238,28 +238,24 @@ class TenantsComponent {
|
|
|
238
238
|
this.table.dataSource = new MatMultiSortTableDataSource(new MatMultiSort(), false);
|
|
239
239
|
this.table.displayedColumns = this.displayedColumns;
|
|
240
240
|
}
|
|
241
|
-
|
|
242
|
-
this.form = this.fb.group({
|
|
243
|
-
filterText: [],
|
|
244
|
-
statuses: []
|
|
245
|
-
});
|
|
241
|
+
initRouteEvents() {
|
|
246
242
|
let firstLoad = true;
|
|
247
243
|
this.route.queryParams.subscribe(params => {
|
|
248
244
|
var _a, _b, _c;
|
|
249
|
-
console.debug("route.queryParams.subscribe", params);
|
|
245
|
+
console.debug("route.queryParams.subscribe", params, firstLoad);
|
|
250
246
|
if (firstLoad) {
|
|
251
247
|
firstLoad = false;
|
|
252
248
|
this.initFormAndTableEvents();
|
|
249
|
+
this.getData(true);
|
|
250
|
+
return;
|
|
253
251
|
}
|
|
254
252
|
var q = params['q'] || "";
|
|
255
253
|
(_a = this.filterText) === null || _a === void 0 ? void 0 : _a.setValue(q);
|
|
256
|
-
if (params['statuses']
|
|
254
|
+
if (!params['statuses']) {
|
|
257
255
|
(_b = this.statuses) === null || _b === void 0 ? void 0 : _b.setValue([]);
|
|
258
256
|
}
|
|
259
257
|
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]);
|
|
258
|
+
(_c = this.statuses) === null || _c === void 0 ? void 0 : _c.setValue(Array.isArray(params['statuses']) ? params['statuses'] : [params['statuses']]);
|
|
263
259
|
}
|
|
264
260
|
this.table.pageSize = params['pageSize'] ? Number.parseInt(params['pageSize']) : 10;
|
|
265
261
|
this.table.pageIndex = params['page'] ? Number.parseInt(params['page']) : 0;
|
|
@@ -278,6 +274,13 @@ class TenantsComponent {
|
|
|
278
274
|
}
|
|
279
275
|
});
|
|
280
276
|
}
|
|
277
|
+
ngOnInit() {
|
|
278
|
+
this.form = this.fb.group({
|
|
279
|
+
filterText: [],
|
|
280
|
+
statuses: []
|
|
281
|
+
});
|
|
282
|
+
this.initRouteEvents();
|
|
283
|
+
}
|
|
281
284
|
initFormAndTableEvents() {
|
|
282
285
|
this.table.nextObservable.subscribe(() => { this.getData(); });
|
|
283
286
|
this.table.sortObservable.subscribe((e) => { this.getData(); });
|
|
@@ -305,9 +308,6 @@ class TenantsComponent {
|
|
|
305
308
|
var q = (_b = (_a = this.filterText) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "";
|
|
306
309
|
if (!fromRoute) {
|
|
307
310
|
var statuses = (_c = this.statuses) === null || _c === void 0 ? void 0 : _c.value;
|
|
308
|
-
if (!statuses || statuses.length == 0) {
|
|
309
|
-
statuses = 'any';
|
|
310
|
-
}
|
|
311
311
|
const tree = this.router.createUrlTree([], { queryParams: {
|
|
312
312
|
q: q,
|
|
313
313
|
statuses: statuses,
|
|
@@ -670,10 +670,10 @@ class TenantsComponent {
|
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
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" }] });
|
|
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 <div class=\"controls\">\n <form [formGroup]=\"form\" class=\"table-form\">\n <mat-form-field [style.width.px]=\"300\">\n <input matInput type=\"text\" placeholder=\"{{ 'Search' | translate }}\" formControlName=\"filterText\" (keyup.enter)=\"getData()\">\n <button *ngIf=\"filterText?.value\" type=\"button\" matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"clearFilterText();\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <mat-form-field [style.width.px]=\"200\">\n <mat-label>{{ 'Statuses' | translate }}</mat-label>\n <mat-select formControlName=\"statuses\" multiple [compareWith]=\"statusCompareFn\" placeholder=\"{{ 'Any status' | translate }}\">\n <mat-select-trigger>\n {{statusOptions[statuses?.value?.[0]||-1] || ''}}\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 \n </form>\n <div class=\"control-buttons\">\n <div class=\"control-buttons-container\">\n <button mat-button (click)=\"rootSettings()\">\n <mat-icon>settings</mat-icon>{{'Settings' | translate}}\n </button>\n <button type=\"button\" mat-button (click)=\"add()\" color=\"primary\"><mat-icon>add</mat-icon> {{ 'New Organization'}}</button>\n </div>\n <div class=\"spacer\"></div>\n </div>\n </div>\n <table mat-table [dataSource]=\"table.dataSource\" matMultiSort (matSortChange)=\"table.onSortEvent()\">\n \n <!--- Note that these columns can be defined in any order.\n The actual rendered columns are set as a property on the row definition\" -->\n <ng-container matColumnDef=\"identifier\">\n <th mat-header-cell *matHeaderCellDef mat-multi-sort-header=\"identifier\" disableClear=\"true\"> {{ 'Identifier' | translate }} </th>\n <td class=\"button-cell\" mat-cell *matCellDef=\"let row\"> {{row.identifier}} \n <button mat-icon-button [cdkCopyToClipboard]=\"row.identifier\" \n [attr.aria-label]=\"'Copy' | translate\">\n <mat-icon>content_copy</mat-icon>\n </button>\n </td>\n </ng-container>\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef > {{'Name'|translate}} </th>\n <td mat-cell *matCellDef=\"let row\"> \n {{row.name}}\n </td>\n </ng-container>\n <ng-container matColumnDef=\"status\">\n <th mat-header-cell *matHeaderCellDef > {{'Status'|translate}} </th>\n <td mat-cell *matCellDef=\"let row\" [class]=\"statusHelper.getColor(row.status)\"> \n {{row.status}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef style=\"text-align: center;\"> {{'Actions'|translate}} </th>\n <td mat-cell *matCellDef=\"let row\" > \n <div class=\"actions-cell\">\n <button mat-button (click)=\"settings(row.id)\">\n <mat-icon>settings</mat-icon>{{'Settings' | translate}}\n </button>\n <button mat-button (click)=\"detail(row.id)\">\n <mat-icon>info</mat-icon>{{'Detail' | translate}}\n </button>\n <button mat-button (click)=\"edit(row.id)\">\n <mat-icon>edit</mat-icon>{{'Edit' | translate}}\n </button>\n \n <button mat-icon-button [matMenuTriggerFor]=\"appMenu\" [matMenuTriggerData]=\"{id: row.id, status: row.status}\">\n <mat-icon>more_vert</mat-icon>\n </button>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n </table>\n <mat-paginator [pageSize]=\"table.pageSize\" [pageIndex]=\"table.pageIndex\" \n [pageSizeOptions]=\"table.pageSizeOptions\"\n [length]=\"table.totalElements ? table.totalElements : 0\" \n (page)=\"table.onPaginationEvent($event)\"\n aria-label=\"Items per page\"\n showFirstLastButtons>\n </mat-paginator>\n\n</div>\n<mat-menu #appMenu=\"matMenu\" class=\"minimum-density\">\n <ng-template matMenuContent let-id=\"id\" let-status=\"status\">\n <button *ngIf=\"canApproval(status)\" class=\"color-success\" mat-menu-item (click)=\"approve(id)\">\n <mat-icon>check_circle_outline</mat-icon>{{'Approve' | translate}}\n </button>\n <button *ngIf=\"canApproval(status)\" class=\"color-warn\" mat-menu-item (click)=\"reject(id)\">\n <mat-icon>highlight_off</mat-icon>{{'Reject' | translate}}\n </button>\n <button *ngIf=\"canActivate(status)\" class=\"color-success\" mat-menu-item (click)=\"activate(id)\">\n <mat-icon>present_to_all</mat-icon>{{'Activate' | translate}}\n </button>\n <button *ngIf=\"canReactivate(status)\" class=\"color-success\" mat-menu-item (click)=\"reactivate(id)\">\n <mat-icon >present_to_all</mat-icon>{{'Activate' | translate}}\n </button>\n <button *ngIf=\"canDeactivate(status)\" class=\"color-warn\" mat-menu-item (click)=\"deactivate(id)\">\n <mat-icon >cancel_presentation</mat-icon>{{'Deactivate' | translate}}\n </button>\n <button *ngIf=\"canSuspend(status)\" class=\"color-warn\" mat-menu-item (click)=\"suspend(id)\">\n <mat-icon >cancel_presentation</mat-icon>{{'Suspend' | translate}}\n </button>\n <button [disabled]=\"!canAbandon(status)\" mat-menu-item (click)=\"abandon(id)\" class=\"color-warn\">\n <mat-icon >delete</mat-icon>{{'Abandon' | translate}}\n </button>\n <button *ngIf=\"canDelete(status)\" class=\"color-warn\" mat-menu-item (click)=\"delete(id)\">\n <mat-icon >delete</mat-icon>{{'Delete' | translate}}\n </button>\n </ng-template>\n</mat-menu>", styles: [":host{display:block}mat-form-field{width:100%}.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}.controls{display:flex}.controls .control-buttons{flex:1;display:flex;flex-direction:column}.controls .control-buttons .control-buttons-container{flex:1;display:flex;align-items:center;justify-content:flex-end}.controls .spacer{height:22px}\n"], dependencies: [{ kind: "directive", type: i4.ɵ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
674
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TenantsComponent, decorators: [{
|
|
675
675
|
type: Component,
|
|
676
|
-
args: [{ selector: 'juice-tenants', template: "<div class=\"mat-elevation-z2 minimum-density\">\n <form [formGroup]=\"form\" class=\"table-form\">\n
|
|
676
|
+
args: [{ selector: 'juice-tenants', template: "<div class=\"mat-elevation-z2 minimum-density\">\n <div class=\"controls\">\n <form [formGroup]=\"form\" class=\"table-form\">\n <mat-form-field [style.width.px]=\"300\">\n <input matInput type=\"text\" placeholder=\"{{ 'Search' | translate }}\" formControlName=\"filterText\" (keyup.enter)=\"getData()\">\n <button *ngIf=\"filterText?.value\" type=\"button\" matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"clearFilterText();\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <mat-form-field [style.width.px]=\"200\">\n <mat-label>{{ 'Statuses' | translate }}</mat-label>\n <mat-select formControlName=\"statuses\" multiple [compareWith]=\"statusCompareFn\" placeholder=\"{{ 'Any status' | translate }}\">\n <mat-select-trigger>\n {{statusOptions[statuses?.value?.[0]||-1] || ''}}\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 \n </form>\n <div class=\"control-buttons\">\n <div class=\"control-buttons-container\">\n <button mat-button (click)=\"rootSettings()\">\n <mat-icon>settings</mat-icon>{{'Settings' | translate}}\n </button>\n <button type=\"button\" mat-button (click)=\"add()\" color=\"primary\"><mat-icon>add</mat-icon> {{ 'New Organization'}}</button>\n </div>\n <div class=\"spacer\"></div>\n </div>\n </div>\n <table mat-table [dataSource]=\"table.dataSource\" matMultiSort (matSortChange)=\"table.onSortEvent()\">\n \n <!--- Note that these columns can be defined in any order.\n The actual rendered columns are set as a property on the row definition\" -->\n <ng-container matColumnDef=\"identifier\">\n <th mat-header-cell *matHeaderCellDef mat-multi-sort-header=\"identifier\" disableClear=\"true\"> {{ 'Identifier' | translate }} </th>\n <td class=\"button-cell\" mat-cell *matCellDef=\"let row\"> {{row.identifier}} \n <button mat-icon-button [cdkCopyToClipboard]=\"row.identifier\" \n [attr.aria-label]=\"'Copy' | translate\">\n <mat-icon>content_copy</mat-icon>\n </button>\n </td>\n </ng-container>\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef > {{'Name'|translate}} </th>\n <td mat-cell *matCellDef=\"let row\"> \n {{row.name}}\n </td>\n </ng-container>\n <ng-container matColumnDef=\"status\">\n <th mat-header-cell *matHeaderCellDef > {{'Status'|translate}} </th>\n <td mat-cell *matCellDef=\"let row\" [class]=\"statusHelper.getColor(row.status)\"> \n {{row.status}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef style=\"text-align: center;\"> {{'Actions'|translate}} </th>\n <td mat-cell *matCellDef=\"let row\" > \n <div class=\"actions-cell\">\n <button mat-button (click)=\"settings(row.id)\">\n <mat-icon>settings</mat-icon>{{'Settings' | translate}}\n </button>\n <button mat-button (click)=\"detail(row.id)\">\n <mat-icon>info</mat-icon>{{'Detail' | translate}}\n </button>\n <button mat-button (click)=\"edit(row.id)\">\n <mat-icon>edit</mat-icon>{{'Edit' | translate}}\n </button>\n \n <button mat-icon-button [matMenuTriggerFor]=\"appMenu\" [matMenuTriggerData]=\"{id: row.id, status: row.status}\">\n <mat-icon>more_vert</mat-icon>\n </button>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n </table>\n <mat-paginator [pageSize]=\"table.pageSize\" [pageIndex]=\"table.pageIndex\" \n [pageSizeOptions]=\"table.pageSizeOptions\"\n [length]=\"table.totalElements ? table.totalElements : 0\" \n (page)=\"table.onPaginationEvent($event)\"\n aria-label=\"Items per page\"\n showFirstLastButtons>\n </mat-paginator>\n\n</div>\n<mat-menu #appMenu=\"matMenu\" class=\"minimum-density\">\n <ng-template matMenuContent let-id=\"id\" let-status=\"status\">\n <button *ngIf=\"canApproval(status)\" class=\"color-success\" mat-menu-item (click)=\"approve(id)\">\n <mat-icon>check_circle_outline</mat-icon>{{'Approve' | translate}}\n </button>\n <button *ngIf=\"canApproval(status)\" class=\"color-warn\" mat-menu-item (click)=\"reject(id)\">\n <mat-icon>highlight_off</mat-icon>{{'Reject' | translate}}\n </button>\n <button *ngIf=\"canActivate(status)\" class=\"color-success\" mat-menu-item (click)=\"activate(id)\">\n <mat-icon>present_to_all</mat-icon>{{'Activate' | translate}}\n </button>\n <button *ngIf=\"canReactivate(status)\" class=\"color-success\" mat-menu-item (click)=\"reactivate(id)\">\n <mat-icon >present_to_all</mat-icon>{{'Activate' | translate}}\n </button>\n <button *ngIf=\"canDeactivate(status)\" class=\"color-warn\" mat-menu-item (click)=\"deactivate(id)\">\n <mat-icon >cancel_presentation</mat-icon>{{'Deactivate' | translate}}\n </button>\n <button *ngIf=\"canSuspend(status)\" class=\"color-warn\" mat-menu-item (click)=\"suspend(id)\">\n <mat-icon >cancel_presentation</mat-icon>{{'Suspend' | translate}}\n </button>\n <button [disabled]=\"!canAbandon(status)\" mat-menu-item (click)=\"abandon(id)\" class=\"color-warn\">\n <mat-icon >delete</mat-icon>{{'Abandon' | translate}}\n </button>\n <button *ngIf=\"canDelete(status)\" class=\"color-warn\" mat-menu-item (click)=\"delete(id)\">\n <mat-icon >delete</mat-icon>{{'Delete' | translate}}\n </button>\n </ng-template>\n</mat-menu>", styles: [":host{display:block}mat-form-field{width:100%}.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}.controls{display:flex}.controls .control-buttons{flex:1;display:flex;flex-direction:column}.controls .control-buttons .control-buttons-container{flex:1;display:flex;align-items:center;justify-content:flex-end}.controls .spacer{height:22px}\n"] }]
|
|
677
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
678
|
type: ViewChild,
|
|
679
679
|
args: [MatPaginator]
|