tin-spa 2.9.0 → 2.9.2
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/components/table/detailsDialog.component.mjs +17 -3
- package/esm2020/lib/components/table-action/table-action.component.mjs +2 -2
- package/esm2020/lib/components/table-internal/detailsDialog-internal.component.mjs +17 -3
- package/esm2020/lib/components/table-lite/detailsDialog-lite.component.mjs +17 -3
- package/esm2020/lib/pages/roles/roles.component.mjs +19 -3
- package/esm2020/lib/services/button.service.mjs +20 -7
- package/esm2020/lib/services/datalib.service.mjs +3 -2
- package/fesm2015/tin-spa.mjs +71 -16
- package/fesm2015/tin-spa.mjs.map +1 -1
- package/fesm2020/tin-spa.mjs +88 -16
- package/fesm2020/tin-spa.mjs.map +1 -1
- package/lib/pages/roles/roles.component.d.ts +1 -0
- package/lib/services/button.service.d.ts +1 -2
- package/package.json +1 -1
package/fesm2015/tin-spa.mjs
CHANGED
|
@@ -1504,7 +1504,7 @@ class DataServiceLib {
|
|
|
1504
1504
|
columns: [
|
|
1505
1505
|
{ name: 'name', type: 'text' },
|
|
1506
1506
|
{ name: 'description', type: 'text' },
|
|
1507
|
-
{ name: 'departmentName', type: '
|
|
1507
|
+
{ name: 'departmentName', type: 'chip', detailsConfig: this.departmentDetailsConfig, alias: 'Department' },
|
|
1508
1508
|
],
|
|
1509
1509
|
buttons: [
|
|
1510
1510
|
{ name: 'create', display: 'Create', dialog: true, action: { url: 'positions?action=create', method: 'post' } },
|
|
@@ -1957,6 +1957,7 @@ class DataServiceLib {
|
|
|
1957
1957
|
this.capApprovals.display = "Approvals";
|
|
1958
1958
|
this.capApprovals.link = "home/admin/approvals";
|
|
1959
1959
|
this.capApprovals.icon = "rule";
|
|
1960
|
+
this.capApprovals.isBool = true;
|
|
1960
1961
|
this.capApprovalsConfig.name = "cap22";
|
|
1961
1962
|
this.capApprovalsConfig.display = "Approvals Config";
|
|
1962
1963
|
this.capApprovalsConfig.link = "home/admin/approvals-config";
|
|
@@ -2979,11 +2980,10 @@ class ButtonService {
|
|
|
2979
2980
|
};
|
|
2980
2981
|
return colorMap[button.name] || '#4050B5';
|
|
2981
2982
|
}
|
|
2982
|
-
isButtonVisible(button, row, isLoadComplete) {
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
}
|
|
2983
|
+
// isButtonVisible(button: Button, row: any, isLoadComplete: boolean): boolean {
|
|
2984
|
+
// if (!isLoadComplete) return false;
|
|
2985
|
+
// return this.testVisible(button,row);
|
|
2986
|
+
// }
|
|
2987
2987
|
getTitleAction(mode, buttons) {
|
|
2988
2988
|
var _a, _b;
|
|
2989
2989
|
const modeMap = {
|
|
@@ -3002,11 +3002,26 @@ class ButtonService {
|
|
|
3002
3002
|
}
|
|
3003
3003
|
return this.getDefaultIcon(button.name, config.flatButtons);
|
|
3004
3004
|
}
|
|
3005
|
-
testDisabled(button, row) {
|
|
3005
|
+
testDisabled(button, row, config) {
|
|
3006
|
+
var _a;
|
|
3007
|
+
// Check standard locking/approval rules
|
|
3006
3008
|
if ((button.name === 'edit' || button.name === 'delete') && (row === null || row === void 0 ? void 0 : row.locked))
|
|
3007
3009
|
return true;
|
|
3008
3010
|
if ((row === null || row === void 0 ? void 0 : row.pendingApproval) && !button.ignoreApproval && button.name != 'view')
|
|
3009
3011
|
return true;
|
|
3012
|
+
// Check form access if detailsConfig exists
|
|
3013
|
+
if ((_a = button.detailsConfig) === null || _a === void 0 ? void 0 : _a.formConfig) {
|
|
3014
|
+
const access = Core.getFormAccess(button.detailsConfig.formConfig, this.authService.currentRoleSource.value);
|
|
3015
|
+
if (!this.hasRequiredAccess(access, button.name))
|
|
3016
|
+
return true;
|
|
3017
|
+
}
|
|
3018
|
+
// Check form access levels from table config
|
|
3019
|
+
if (['create', 'edit', 'view', 'delete'].includes(button.name) && (config === null || config === void 0 ? void 0 : config.formConfig)) {
|
|
3020
|
+
const access = Core.getFormAccess(config.formConfig, this.authService.currentRoleSource.value);
|
|
3021
|
+
if (!this.hasRequiredAccess(access, button.name))
|
|
3022
|
+
return true;
|
|
3023
|
+
}
|
|
3024
|
+
// Check button-specific disabled rules
|
|
3010
3025
|
return button.disabled ? button.disabled(row) : false;
|
|
3011
3026
|
}
|
|
3012
3027
|
testVisible(button, row, config) {
|
|
@@ -4827,11 +4842,19 @@ class DetailsDialogLite {
|
|
|
4827
4842
|
}
|
|
4828
4843
|
testDisabled(row, buttonName) {
|
|
4829
4844
|
const button = this.getButton(buttonName);
|
|
4830
|
-
|
|
4845
|
+
if (!button)
|
|
4846
|
+
return false;
|
|
4847
|
+
// Create a copy of the button with component's detailsConfig
|
|
4848
|
+
const buttonWithConfig = Object.assign(Object.assign({}, button), { detailsConfig: button.detailsConfig ? Object.assign({}, button.detailsConfig) : this.detailsConfig });
|
|
4849
|
+
return this.buttonService.testDisabled(buttonWithConfig, row);
|
|
4831
4850
|
}
|
|
4832
4851
|
testVisible(row, buttonName) {
|
|
4833
4852
|
const button = this.getButton(buttonName);
|
|
4834
|
-
|
|
4853
|
+
if (!button)
|
|
4854
|
+
return false;
|
|
4855
|
+
// Create a copy of the button with component's detailsConfig
|
|
4856
|
+
const buttonWithConfig = Object.assign(Object.assign({}, button), { detailsConfig: button.detailsConfig ? Object.assign({}, button.detailsConfig) : this.detailsConfig });
|
|
4857
|
+
return this.buttonService.testVisible(buttonWithConfig, row);
|
|
4835
4858
|
}
|
|
4836
4859
|
testVisibleTab(tblConfig) {
|
|
4837
4860
|
if (!this.tableConfigService.hasTableAccess(tblConfig)) {
|
|
@@ -5588,7 +5611,7 @@ class TableActionComponent {
|
|
|
5588
5611
|
}
|
|
5589
5612
|
testDisabled(row, buttonName) {
|
|
5590
5613
|
const button = this.displayedButtons.find(b => b.name === buttonName);
|
|
5591
|
-
return button ? this.buttonService.testDisabled(button, row) : true;
|
|
5614
|
+
return button ? this.buttonService.testDisabled(button, row, this.config) : true;
|
|
5592
5615
|
}
|
|
5593
5616
|
getButtonColor(button, row) {
|
|
5594
5617
|
return this.buttonService.getButtonColor(button, row);
|
|
@@ -6117,11 +6140,19 @@ class DetailsDialogInternal {
|
|
|
6117
6140
|
}
|
|
6118
6141
|
testDisabled(row, buttonName) {
|
|
6119
6142
|
const button = this.getButton(buttonName);
|
|
6120
|
-
|
|
6143
|
+
if (!button)
|
|
6144
|
+
return false;
|
|
6145
|
+
// Create a copy of the button with component's detailsConfig
|
|
6146
|
+
const buttonWithConfig = Object.assign(Object.assign({}, button), { detailsConfig: button.detailsConfig ? Object.assign({}, button.detailsConfig) : this.detailsConfig });
|
|
6147
|
+
return this.buttonService.testDisabled(buttonWithConfig, row);
|
|
6121
6148
|
}
|
|
6122
6149
|
testVisible(row, buttonName) {
|
|
6123
6150
|
const button = this.getButton(buttonName);
|
|
6124
|
-
|
|
6151
|
+
if (!button)
|
|
6152
|
+
return false;
|
|
6153
|
+
// Create a copy of the button with component's detailsConfig
|
|
6154
|
+
const buttonWithConfig = Object.assign(Object.assign({}, button), { detailsConfig: button.detailsConfig ? Object.assign({}, button.detailsConfig) : this.detailsConfig });
|
|
6155
|
+
return this.buttonService.testVisible(buttonWithConfig, row);
|
|
6125
6156
|
}
|
|
6126
6157
|
testVisibleTab(tblConfig) {
|
|
6127
6158
|
if (!this.tableConfigService.hasTableAccess(tblConfig)) {
|
|
@@ -7030,11 +7061,19 @@ class DetailsDialog {
|
|
|
7030
7061
|
}
|
|
7031
7062
|
testDisabled(row, buttonName) {
|
|
7032
7063
|
const button = this.getButton(buttonName);
|
|
7033
|
-
|
|
7064
|
+
if (!button)
|
|
7065
|
+
return false;
|
|
7066
|
+
// Create a copy of the button with component's detailsConfig
|
|
7067
|
+
const buttonWithConfig = Object.assign(Object.assign({}, button), { detailsConfig: button.detailsConfig ? Object.assign({}, button.detailsConfig) : this.detailsConfig });
|
|
7068
|
+
return this.buttonService.testDisabled(buttonWithConfig, row);
|
|
7034
7069
|
}
|
|
7035
7070
|
testVisible(row, buttonName) {
|
|
7036
7071
|
const button = this.getButton(buttonName);
|
|
7037
|
-
|
|
7072
|
+
if (!button)
|
|
7073
|
+
return false;
|
|
7074
|
+
// Create a copy of the button with component's detailsConfig
|
|
7075
|
+
const buttonWithConfig = Object.assign(Object.assign({}, button), { detailsConfig: button.detailsConfig ? Object.assign({}, button.detailsConfig) : this.detailsConfig });
|
|
7076
|
+
return this.buttonService.testVisible(buttonWithConfig, row);
|
|
7038
7077
|
}
|
|
7039
7078
|
testVisibleTab(tblConfig) {
|
|
7040
7079
|
if (!this.tableConfigService.hasTableAccess(tblConfig)) {
|
|
@@ -9860,6 +9899,7 @@ class RolesComponent {
|
|
|
9860
9899
|
this.loadRoles();
|
|
9861
9900
|
}
|
|
9862
9901
|
onCapItemChange(capItem, checked, role) {
|
|
9902
|
+
return; //disabled to allow sub component access without granting whole menu access
|
|
9863
9903
|
if (!checked && capItem.capSubItems) {
|
|
9864
9904
|
// When parent is unchecked, set all subitems to Restricted
|
|
9865
9905
|
capItem.capSubItems.forEach(subItem => {
|
|
@@ -9867,6 +9907,21 @@ class RolesComponent {
|
|
|
9867
9907
|
});
|
|
9868
9908
|
}
|
|
9869
9909
|
}
|
|
9910
|
+
hasSubItemsAccess(capItem, role) {
|
|
9911
|
+
if (!capItem.capSubItems)
|
|
9912
|
+
return false;
|
|
9913
|
+
// Check if any sub-item has access
|
|
9914
|
+
return capItem.capSubItems.some(subItem => {
|
|
9915
|
+
// Check direct sub-items
|
|
9916
|
+
if (role[subItem.name] > 0)
|
|
9917
|
+
return true;
|
|
9918
|
+
// Check sub-sub-items recursively
|
|
9919
|
+
if (subItem.capSubItems) {
|
|
9920
|
+
return subItem.capSubItems.some(subSubItem => role[subSubItem.name] > 0);
|
|
9921
|
+
}
|
|
9922
|
+
return false;
|
|
9923
|
+
});
|
|
9924
|
+
}
|
|
9870
9925
|
addRole() {
|
|
9871
9926
|
const dialogRef = this.dialog.open(addRoleDialog, {
|
|
9872
9927
|
width: "1100px",
|
|
@@ -9921,10 +9976,10 @@ class RolesComponent {
|
|
|
9921
9976
|
}
|
|
9922
9977
|
}
|
|
9923
9978
|
RolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: RolesComponent, deps: [{ token: HttpService }, { token: i1$2.Router }, { token: AuthService }, { token: DataServiceLib }, { token: DialogService }, { token: i4.MatDialog }, { token: MessageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
9924
|
-
RolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: RolesComponent, selector: "spa-roles", ngImport: i0, template: "<h4> Roles </h4>\r\n<hr />\r\n\r\n<div class=\"container-fluid mb-5\">\r\n\r\n <div class=\"d-flex justify-content-between mb-2\">\r\n\r\n <div >\r\n <button id=\"btnNewRole\" mat-raised-button color=\"primary\" (click)=\"addRole()\">New Role</button>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end\">\r\n <button id=\"btnRefresh\" mat-mini-fab color=\"primary\" (click)=\"refresh()\" matTooltip=\"refresh data\" matTooltipPosition=\"right\"><mat-icon class=\"refreshIcon\">refresh</mat-icon></button>\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\" *ngFor=\"let role of roles\">\r\n\r\n <mat-card class=\"mat-elevation-z8\" style=\"width:100%\">\r\n\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n\r\n <label style=\"font-size: 16px;\">{{role.roleName}}</label>\r\n\r\n <button mat-icon-button color=\"primary\" matTooltip=\"Rename Role\" (click)=\"renameRole(role)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n </div>\r\n\r\n <hr style=\"margin-top: 0px;\">\r\n\r\n <div class=\"tin-row\" style=\" font-size:12px;\">\r\n\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capItem of appConfig.capItems\">\r\n\r\n <mat-checkbox *ngIf=\"capItem.isBool || capItem.capSubItems\"\r\n color=\"primary\" style=\"min-width: 100px;\" [(ngModel)]=\"role[capItem.name]\" (ngModelChange)=\"onCapItemChange(capItem, $event, role)\">\r\n {{capItem.display}}\r\n </mat-checkbox>\r\n\r\n <spa-select\r\n *ngIf=\"!capItem.isBool && !capItem.capSubItems\"\r\n [options]=\"roleAccessOptions\"\r\n optionDisplay=\"name\"\r\n optionValue=\"value\"\r\n [display]=\"capItem.display\"\r\n [(value)]=\"role[capItem.name]\"\r\n width=\"100px\" style=\"font-size: 12px;\">\r\n </spa-select>\r\n\r\n <ng-container *ngIf=\"capItem.capSubItems && role[capItem.name]\">\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox *ngIf=\"capSubItem.isBool\"\r\n color=\"primary\" style=\"min-width: 100px;\" [(ngModel)]=\"role[capSubItem.name]\">\r\n {{capSubItem.display}}\r\n </mat-checkbox>\r\n\r\n <spa-select\r\n *ngIf=\"!capSubItem.isBool\"\r\n [options]=\"roleAccessOptions\"\r\n optionDisplay=\"name\"\r\n optionValue=\"value\"\r\n [display]=\"capSubItem.display\"\r\n [(value)]=\"role[capSubItem.name]\"\r\n width=\"100px\" style=\"font-size: 12px;\">\r\n </spa-select>\r\n\r\n\r\n
|
|
9979
|
+
RolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: RolesComponent, selector: "spa-roles", ngImport: i0, template: "<h4> Roles </h4>\r\n<hr />\r\n\r\n<div class=\"container-fluid mb-5\">\r\n\r\n <div class=\"d-flex justify-content-between mb-2\">\r\n\r\n <div >\r\n <button id=\"btnNewRole\" mat-raised-button color=\"primary\" (click)=\"addRole()\">New Role</button>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end\">\r\n <button id=\"btnRefresh\" mat-mini-fab color=\"primary\" (click)=\"refresh()\" matTooltip=\"refresh data\" matTooltipPosition=\"right\"><mat-icon class=\"refreshIcon\">refresh</mat-icon></button>\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\" *ngFor=\"let role of roles\">\r\n\r\n <mat-card class=\"mat-elevation-z8\" style=\"width:100%\">\r\n\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n\r\n <label style=\"font-size: 16px;\">{{role.roleName}}</label>\r\n\r\n <button mat-icon-button color=\"primary\" matTooltip=\"Rename Role\" (click)=\"renameRole(role)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n </div>\r\n\r\n <hr style=\"margin-top: 0px;\">\r\n\r\n <div class=\"tin-row\" style=\" font-size:12px;\">\r\n\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capItem of appConfig.capItems\">\r\n\r\n <mat-checkbox *ngIf=\"capItem.isBool || capItem.capSubItems\"\r\n color=\"primary\" style=\"min-width: 100px;\" [(ngModel)]=\"role[capItem.name]\" (ngModelChange)=\"onCapItemChange(capItem, $event, role)\">\r\n {{capItem.display}}\r\n <span *ngIf=\"!role[capItem.name] && hasSubItemsAccess(capItem, role)\" class=\"asterisk\" style=\"color: red;\">*</span>\r\n </mat-checkbox>\r\n\r\n <spa-select\r\n *ngIf=\"!capItem.isBool && !capItem.capSubItems\"\r\n [options]=\"roleAccessOptions\"\r\n optionDisplay=\"name\"\r\n optionValue=\"value\"\r\n [display]=\"capItem.display\"\r\n [(value)]=\"role[capItem.name]\"\r\n width=\"100px\" style=\"font-size: 12px;\">\r\n </spa-select>\r\n\r\n <ng-container *ngIf=\"capItem.capSubItems && role[capItem.name]\">\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox *ngIf=\"capSubItem.isBool\"\r\n color=\"primary\" style=\"min-width: 100px;\" [(ngModel)]=\"role[capSubItem.name]\">\r\n {{capSubItem.display}}\r\n </mat-checkbox>\r\n\r\n <spa-select\r\n *ngIf=\"!capSubItem.isBool\"\r\n [options]=\"roleAccessOptions\"\r\n optionDisplay=\"name\"\r\n optionValue=\"value\"\r\n [display]=\"capSubItem.display\"\r\n [(value)]=\"role[capSubItem.name]\"\r\n width=\"100px\" style=\"font-size: 12px;\">\r\n </spa-select>\r\n\r\n <ng-container *ngIf=\"capSubItem.capSubItems\">\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capSubSubItem of capSubItem.capSubItems\">\r\n\r\n <mat-checkbox *ngIf=\"capSubSubItem.isBool\"\r\n color=\"primary\" style=\"min-width: 100px;\" [(ngModel)]=\"role[capSubSubItem.name]\">\r\n {{capSubSubItem.display}}\r\n </mat-checkbox>\r\n\r\n <spa-select\r\n *ngIf=\"!capSubSubItem.isBool\"\r\n [options]=\"roleAccessOptions\"\r\n optionDisplay=\"name\"\r\n optionValue=\"value\"\r\n [display]=\"capSubSubItem.display\"\r\n [(value)]=\"role[capSubSubItem.name]\"\r\n width=\"100px\" style=\"font-size: 12px;\">\r\n </spa-select>\r\n\r\n </div>\r\n\r\n </ng-container>\r\n\r\n\r\n\r\n </div>\r\n\r\n </ng-container>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"updateRole(role)\" style=\"margin-right:10px;\">\r\n <mat-icon>done_all</mat-icon>\r\n </button>\r\n\r\n <button mat-mini-fab color=\"warn\" (click)=\"deleteRole(role)\" style=\"margin-right:10px\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"], dependencies: [{ kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i16.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "directive", type: i16.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: SelectComponent, selector: "spa-select", inputs: ["detailsConfig"] }] });
|
|
9925
9980
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: RolesComponent, decorators: [{
|
|
9926
9981
|
type: Component,
|
|
9927
|
-
args: [{ selector: "spa-roles", template: "<h4> Roles </h4>\r\n<hr />\r\n\r\n<div class=\"container-fluid mb-5\">\r\n\r\n <div class=\"d-flex justify-content-between mb-2\">\r\n\r\n <div >\r\n <button id=\"btnNewRole\" mat-raised-button color=\"primary\" (click)=\"addRole()\">New Role</button>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end\">\r\n <button id=\"btnRefresh\" mat-mini-fab color=\"primary\" (click)=\"refresh()\" matTooltip=\"refresh data\" matTooltipPosition=\"right\"><mat-icon class=\"refreshIcon\">refresh</mat-icon></button>\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\" *ngFor=\"let role of roles\">\r\n\r\n <mat-card class=\"mat-elevation-z8\" style=\"width:100%\">\r\n\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n\r\n <label style=\"font-size: 16px;\">{{role.roleName}}</label>\r\n\r\n <button mat-icon-button color=\"primary\" matTooltip=\"Rename Role\" (click)=\"renameRole(role)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n </div>\r\n\r\n <hr style=\"margin-top: 0px;\">\r\n\r\n <div class=\"tin-row\" style=\" font-size:12px;\">\r\n\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capItem of appConfig.capItems\">\r\n\r\n <mat-checkbox *ngIf=\"capItem.isBool || capItem.capSubItems\"\r\n color=\"primary\" style=\"min-width: 100px;\" [(ngModel)]=\"role[capItem.name]\" (ngModelChange)=\"onCapItemChange(capItem, $event, role)\">\r\n {{capItem.display}}\r\n </mat-checkbox>\r\n\r\n <spa-select\r\n *ngIf=\"!capItem.isBool && !capItem.capSubItems\"\r\n [options]=\"roleAccessOptions\"\r\n optionDisplay=\"name\"\r\n optionValue=\"value\"\r\n [display]=\"capItem.display\"\r\n [(value)]=\"role[capItem.name]\"\r\n width=\"100px\" style=\"font-size: 12px;\">\r\n </spa-select>\r\n\r\n <ng-container *ngIf=\"capItem.capSubItems && role[capItem.name]\">\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox *ngIf=\"capSubItem.isBool\"\r\n color=\"primary\" style=\"min-width: 100px;\" [(ngModel)]=\"role[capSubItem.name]\">\r\n {{capSubItem.display}}\r\n </mat-checkbox>\r\n\r\n <spa-select\r\n *ngIf=\"!capSubItem.isBool\"\r\n [options]=\"roleAccessOptions\"\r\n optionDisplay=\"name\"\r\n optionValue=\"value\"\r\n [display]=\"capSubItem.display\"\r\n [(value)]=\"role[capSubItem.name]\"\r\n width=\"100px\" style=\"font-size: 12px;\">\r\n </spa-select>\r\n\r\n\r\n
|
|
9982
|
+
args: [{ selector: "spa-roles", template: "<h4> Roles </h4>\r\n<hr />\r\n\r\n<div class=\"container-fluid mb-5\">\r\n\r\n <div class=\"d-flex justify-content-between mb-2\">\r\n\r\n <div >\r\n <button id=\"btnNewRole\" mat-raised-button color=\"primary\" (click)=\"addRole()\">New Role</button>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end\">\r\n <button id=\"btnRefresh\" mat-mini-fab color=\"primary\" (click)=\"refresh()\" matTooltip=\"refresh data\" matTooltipPosition=\"right\"><mat-icon class=\"refreshIcon\">refresh</mat-icon></button>\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\" *ngFor=\"let role of roles\">\r\n\r\n <mat-card class=\"mat-elevation-z8\" style=\"width:100%\">\r\n\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n\r\n <label style=\"font-size: 16px;\">{{role.roleName}}</label>\r\n\r\n <button mat-icon-button color=\"primary\" matTooltip=\"Rename Role\" (click)=\"renameRole(role)\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n </div>\r\n\r\n <hr style=\"margin-top: 0px;\">\r\n\r\n <div class=\"tin-row\" style=\" font-size:12px;\">\r\n\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capItem of appConfig.capItems\">\r\n\r\n <mat-checkbox *ngIf=\"capItem.isBool || capItem.capSubItems\"\r\n color=\"primary\" style=\"min-width: 100px;\" [(ngModel)]=\"role[capItem.name]\" (ngModelChange)=\"onCapItemChange(capItem, $event, role)\">\r\n {{capItem.display}}\r\n <span *ngIf=\"!role[capItem.name] && hasSubItemsAccess(capItem, role)\" class=\"asterisk\" style=\"color: red;\">*</span>\r\n </mat-checkbox>\r\n\r\n <spa-select\r\n *ngIf=\"!capItem.isBool && !capItem.capSubItems\"\r\n [options]=\"roleAccessOptions\"\r\n optionDisplay=\"name\"\r\n optionValue=\"value\"\r\n [display]=\"capItem.display\"\r\n [(value)]=\"role[capItem.name]\"\r\n width=\"100px\" style=\"font-size: 12px;\">\r\n </spa-select>\r\n\r\n <ng-container *ngIf=\"capItem.capSubItems && role[capItem.name]\">\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox *ngIf=\"capSubItem.isBool\"\r\n color=\"primary\" style=\"min-width: 100px;\" [(ngModel)]=\"role[capSubItem.name]\">\r\n {{capSubItem.display}}\r\n </mat-checkbox>\r\n\r\n <spa-select\r\n *ngIf=\"!capSubItem.isBool\"\r\n [options]=\"roleAccessOptions\"\r\n optionDisplay=\"name\"\r\n optionValue=\"value\"\r\n [display]=\"capSubItem.display\"\r\n [(value)]=\"role[capSubItem.name]\"\r\n width=\"100px\" style=\"font-size: 12px;\">\r\n </spa-select>\r\n\r\n <ng-container *ngIf=\"capSubItem.capSubItems\">\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capSubSubItem of capSubItem.capSubItems\">\r\n\r\n <mat-checkbox *ngIf=\"capSubSubItem.isBool\"\r\n color=\"primary\" style=\"min-width: 100px;\" [(ngModel)]=\"role[capSubSubItem.name]\">\r\n {{capSubSubItem.display}}\r\n </mat-checkbox>\r\n\r\n <spa-select\r\n *ngIf=\"!capSubSubItem.isBool\"\r\n [options]=\"roleAccessOptions\"\r\n optionDisplay=\"name\"\r\n optionValue=\"value\"\r\n [display]=\"capSubSubItem.display\"\r\n [(value)]=\"role[capSubSubItem.name]\"\r\n width=\"100px\" style=\"font-size: 12px;\">\r\n </spa-select>\r\n\r\n </div>\r\n\r\n </ng-container>\r\n\r\n\r\n\r\n </div>\r\n\r\n </ng-container>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"updateRole(role)\" style=\"margin-right:10px;\">\r\n <mat-icon>done_all</mat-icon>\r\n </button>\r\n\r\n <button mat-mini-fab color=\"warn\" (click)=\"deleteRole(role)\" style=\"margin-right:10px\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"] }]
|
|
9928
9983
|
}], ctorParameters: function () { return [{ type: HttpService }, { type: i1$2.Router }, { type: AuthService }, { type: DataServiceLib }, { type: DialogService }, { type: i4.MatDialog }, { type: MessageService }]; } });
|
|
9929
9984
|
|
|
9930
9985
|
class CreateAccountComponent {
|