@abp/ng.identity 7.2.2 → 7.3.0-rc.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.
Files changed (107) hide show
  1. package/README.md +129 -2
  2. package/config/enums/index.d.ts +2 -2
  3. package/config/enums/policy-names.d.ts +5 -5
  4. package/config/enums/route-names.d.ts +5 -5
  5. package/config/identity-config.module.d.ts +8 -8
  6. package/config/index.d.ts +5 -5
  7. package/config/providers/index.d.ts +1 -1
  8. package/config/providers/route.provider.d.ts +8 -8
  9. package/config/public-api.d.ts +3 -3
  10. package/{esm2020 → esm2022}/abp-ng.identity.mjs +4 -4
  11. package/{esm2020 → esm2022}/config/abp-ng.identity-config.mjs +4 -4
  12. package/{esm2020 → esm2022}/config/enums/index.mjs +2 -2
  13. package/{esm2020 → esm2022}/config/enums/policy-names.mjs +1 -1
  14. package/{esm2020 → esm2022}/config/enums/route-names.mjs +1 -1
  15. package/esm2022/config/identity-config.module.mjs +19 -0
  16. package/{esm2020 → esm2022}/config/providers/index.mjs +1 -1
  17. package/{esm2020 → esm2022}/config/providers/route.provider.mjs +34 -34
  18. package/{esm2020 → esm2022}/config/public-api.mjs +3 -3
  19. package/{esm2020 → esm2022}/lib/components/index.mjs +2 -2
  20. package/esm2022/lib/components/roles/roles.component.mjs +112 -0
  21. package/esm2022/lib/components/users/users.component.mjs +151 -0
  22. package/{esm2020 → esm2022}/lib/defaults/default-roles-entity-actions.mjs +29 -29
  23. package/{esm2020 → esm2022}/lib/defaults/default-roles-entity-props.mjs +23 -23
  24. package/{esm2020 → esm2022}/lib/defaults/default-roles-form-props.mjs +27 -27
  25. package/{esm2020 → esm2022}/lib/defaults/default-roles-toolbar-actions.mjs +13 -13
  26. package/{esm2020 → esm2022}/lib/defaults/default-users-entity-actions.mjs +35 -35
  27. package/{esm2020 → esm2022}/lib/defaults/default-users-entity-props.mjs +33 -33
  28. package/{esm2020 → esm2022}/lib/defaults/default-users-form-props.mjs +71 -71
  29. package/{esm2020 → esm2022}/lib/defaults/default-users-toolbar-actions.mjs +13 -13
  30. package/{esm2020 → esm2022}/lib/enums/components.mjs +1 -1
  31. package/{esm2020 → esm2022}/lib/enums/index.mjs +1 -1
  32. package/esm2022/lib/guards/extensions.guard.mjs +37 -0
  33. package/{esm2020 → esm2022}/lib/guards/index.mjs +1 -1
  34. package/esm2022/lib/identity-routing.module.mjs +54 -0
  35. package/esm2022/lib/identity.module.mjs +86 -0
  36. package/{esm2020 → esm2022}/lib/models/config-options.mjs +1 -1
  37. package/{esm2020 → esm2022}/lib/models/index.mjs +1 -1
  38. package/{esm2020 → esm2022}/lib/tokens/extensions.token.mjs +34 -34
  39. package/{esm2020 → esm2022}/lib/tokens/index.mjs +1 -1
  40. package/{esm2020 → esm2022}/proxy/abp-ng.identity-proxy.mjs +4 -4
  41. package/{esm2020 → esm2022}/proxy/lib/index.mjs +2 -2
  42. package/esm2022/proxy/lib/proxy/identity/identity-role.service.mjs +47 -0
  43. package/esm2022/proxy/lib/proxy/identity/identity-user-lookup.service.mjs +38 -0
  44. package/esm2022/proxy/lib/proxy/identity/identity-user.service.mjs +64 -0
  45. package/{esm2020 → esm2022}/proxy/lib/proxy/identity/index.mjs +4 -4
  46. package/{esm2020 → esm2022}/proxy/lib/proxy/identity/models.mjs +1 -1
  47. package/{esm2020 → esm2022}/proxy/lib/proxy/users/index.mjs +1 -1
  48. package/{esm2020 → esm2022}/proxy/lib/proxy/users/models.mjs +1 -1
  49. package/{esm2020 → esm2022}/proxy/public-api.mjs +1 -1
  50. package/{esm2020 → esm2022}/public-api.mjs +6 -6
  51. package/{fesm2015 → fesm2022}/abp-ng.identity-config.mjs +46 -46
  52. package/{fesm2020 → fesm2022}/abp-ng.identity-config.mjs.map +1 -1
  53. package/{fesm2020 → fesm2022}/abp-ng.identity-proxy.mjs +130 -130
  54. package/{fesm2015 → fesm2022}/abp-ng.identity-proxy.mjs.map +1 -1
  55. package/{fesm2020 → fesm2022}/abp-ng.identity.mjs +609 -609
  56. package/fesm2022/abp-ng.identity.mjs.map +1 -0
  57. package/index.d.ts +5 -5
  58. package/lib/components/index.d.ts +2 -2
  59. package/lib/components/roles/roles.component.d.ts +36 -36
  60. package/lib/components/users/users.component.d.ts +44 -44
  61. package/lib/defaults/default-roles-entity-actions.d.ts +3 -3
  62. package/lib/defaults/default-roles-entity-props.d.ts +3 -3
  63. package/lib/defaults/default-roles-form-props.d.ts +4 -4
  64. package/lib/defaults/default-roles-toolbar-actions.d.ts +3 -3
  65. package/lib/defaults/default-users-entity-actions.d.ts +3 -3
  66. package/lib/defaults/default-users-entity-props.d.ts +3 -3
  67. package/lib/defaults/default-users-form-props.d.ts +4 -4
  68. package/lib/defaults/default-users-toolbar-actions.d.ts +3 -3
  69. package/lib/enums/components.d.ts +4 -4
  70. package/lib/enums/index.d.ts +1 -1
  71. package/lib/guards/extensions.guard.d.ts +11 -11
  72. package/lib/guards/index.d.ts +1 -1
  73. package/lib/identity-routing.module.d.ts +7 -7
  74. package/lib/identity.module.d.ts +20 -20
  75. package/lib/models/config-options.d.ts +30 -30
  76. package/lib/models/index.d.ts +1 -1
  77. package/lib/tokens/extensions.token.d.ts +43 -43
  78. package/lib/tokens/index.d.ts +1 -1
  79. package/package.json +15 -25
  80. package/proxy/index.d.ts +5 -5
  81. package/proxy/lib/index.d.ts +2 -2
  82. package/proxy/lib/proxy/identity/identity-role.service.d.ts +17 -17
  83. package/proxy/lib/proxy/identity/identity-user-lookup.service.d.ts +16 -16
  84. package/proxy/lib/proxy/identity/identity-user.service.d.ts +21 -21
  85. package/proxy/lib/proxy/identity/index.d.ts +4 -4
  86. package/proxy/lib/proxy/identity/models.d.ts +64 -64
  87. package/proxy/lib/proxy/users/index.d.ts +1 -1
  88. package/proxy/lib/proxy/users/models.d.ts +11 -11
  89. package/proxy/public-api.d.ts +1 -1
  90. package/public-api.d.ts +6 -6
  91. package/esm2020/config/identity-config.module.mjs +0 -18
  92. package/esm2020/lib/components/roles/roles.component.mjs +0 -111
  93. package/esm2020/lib/components/users/users.component.mjs +0 -150
  94. package/esm2020/lib/guards/extensions.guard.mjs +0 -36
  95. package/esm2020/lib/identity-routing.module.mjs +0 -53
  96. package/esm2020/lib/identity.module.mjs +0 -85
  97. package/esm2020/proxy/lib/proxy/identity/identity-role.service.mjs +0 -46
  98. package/esm2020/proxy/lib/proxy/identity/identity-user-lookup.service.mjs +0 -37
  99. package/esm2020/proxy/lib/proxy/identity/identity-user.service.mjs +0 -63
  100. package/fesm2015/abp-ng.identity-config.mjs.map +0 -1
  101. package/fesm2015/abp-ng.identity-proxy.mjs +0 -144
  102. package/fesm2015/abp-ng.identity.mjs +0 -661
  103. package/fesm2015/abp-ng.identity.mjs.map +0 -1
  104. package/fesm2020/abp-ng.identity-config.mjs +0 -58
  105. package/fesm2020/abp-ng.identity-proxy.mjs.map +0 -1
  106. package/fesm2020/abp-ng.identity.mjs.map +0 -1
  107. package/proxy/src/lib/proxy/README.md +0 -17
@@ -6,8 +6,8 @@ import { Confirmation, eFormComponets, getPasswordValidators, ThemeSharedModule
6
6
  import * as i6 from '@abp/ng.theme.shared/extensions';
7
7
  import { FormPropData, generateFormFromProps, EXTENSIONS_IDENTIFIER, EntityAction, EntityProp, FormProp, ToolbarAction, ExtensionsService, getObjectExtensionEntitiesFromStore, mapEntitiesToContributors, mergeWithDefaultActions, mergeWithDefaultProps, UiExtensionsModule } from '@abp/ng.theme.shared/extensions';
8
8
  import * as i0 from '@angular/core';
9
- import { Component, ViewChild, InjectionToken, Injectable, NgModule } from '@angular/core';
10
- import { finalize, tap, switchMap, map, mapTo } from 'rxjs/operators';
9
+ import { Component, ViewChild, InjectionToken, inject, Injectable, NgModule } from '@angular/core';
10
+ import { finalize, tap, switchMap, map } from 'rxjs/operators';
11
11
  import * as i4 from '@angular/forms';
12
12
  import { Validators } from '@angular/forms';
13
13
  import * as i7 from '@ngx-validate/core';
@@ -21,643 +21,643 @@ import * as i6$1 from '@ng-bootstrap/ng-bootstrap';
21
21
  import { NgbNavModule, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
22
22
  import { of } from 'rxjs';
23
23
  import * as i1$1 from '@angular/router';
24
- import { RouterModule } from '@angular/router';
24
+ import { mapToCanActivate, RouterModule } from '@angular/router';
25
25
 
26
- class RolesComponent {
27
- constructor(list, confirmationService, toasterService, injector, service) {
28
- this.list = list;
29
- this.confirmationService = confirmationService;
30
- this.toasterService = toasterService;
31
- this.injector = injector;
32
- this.service = service;
33
- this.data = { items: [], totalCount: 0 };
34
- this.visiblePermissions = false;
35
- this.modalBusy = false;
36
- this.permissionManagementKey = "PermissionManagement.PermissionManagementComponent" /* ePermissionManagementComponents.PermissionManagement */;
37
- this.onVisiblePermissionChange = (event) => {
38
- this.visiblePermissions = event;
39
- };
40
- }
41
- ngOnInit() {
42
- this.hookToQuery();
43
- }
44
- buildForm() {
45
- const data = new FormPropData(this.injector, this.selected);
46
- this.form = generateFormFromProps(data);
47
- }
48
- openModal() {
49
- this.buildForm();
50
- this.isModalVisible = true;
51
- }
52
- add() {
53
- this.selected = {};
54
- this.openModal();
55
- }
56
- edit(id) {
57
- this.service.get(id).subscribe(res => {
58
- this.selected = res;
59
- this.openModal();
60
- });
61
- }
62
- save() {
63
- if (!this.form.valid)
64
- return;
65
- this.modalBusy = true;
66
- const { id } = this.selected || {};
67
- (id
68
- ? this.service.update(id, { ...this.selected, ...this.form.value })
69
- : this.service.create(this.form.value))
70
- .pipe(finalize(() => (this.modalBusy = false)))
71
- .subscribe(() => {
72
- this.isModalVisible = false;
73
- this.list.get();
74
- });
75
- }
76
- delete(id, name) {
77
- this.confirmationService
78
- .warn('AbpIdentity::RoleDeletionConfirmationMessage', 'AbpIdentity::AreYouSure', {
79
- messageLocalizationParams: [name],
80
- })
81
- .subscribe((status) => {
82
- if (status === Confirmation.Status.confirm) {
83
- this.toasterService.success('AbpUi::SuccessfullyDeleted');
84
- this.service.delete(id).subscribe(() => this.list.get());
85
- }
86
- });
87
- }
88
- hookToQuery() {
89
- this.list.hookToQuery(query => this.service.getList(query)).subscribe(res => (this.data = res));
90
- }
91
- openPermissionsModal(providerKey) {
92
- this.providerKey = providerKey;
93
- setTimeout(() => {
94
- this.visiblePermissions = true;
95
- }, 0);
96
- }
97
- sort(data) {
98
- const { prop, dir } = data.sorts[0];
99
- this.list.sortKey = prop;
100
- this.list.sortOrder = dir;
101
- }
102
- }
103
- RolesComponentfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: RolesComponent, deps: [{ token: i1.ListService }, { token: i2.ConfirmationService }, { token: i2.ToasterService }, { token: i0.Injector }, { token: i3.IdentityRoleService }], target: i0.ɵɵFactoryTarget.Component });
104
- RolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: RolesComponent, selector: "abp-roles", providers: [
105
- ListService,
106
- {
107
- provide: EXTENSIONS_IDENTIFIER,
108
- useValue: "Identity.RolesComponent" /* eIdentityComponents.Roles */,
109
- },
110
- ], ngImport: i0, template: "<abp-page [title]=\"'AbpIdentity::Roles' | abpLocalization\" [toolbar]=\"data.items\">\r\n <div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-body\">\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n\r\n <abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewRole') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n </abp-modal>\r\n\r\n <abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'R' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true },\r\n hideBadges: { value: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n >\r\n </abp-permission-management>\r\n</abp-page>\r\n", dependencies: [{ kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i1.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }, { kind: "directive", type: i7.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: i6.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { kind: "component", type: i6.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], outputs: ["tableActivate"], exportAs: ["abpExtensibleTable"] }, { kind: "component", type: i7$1.PermissionManagementComponent, selector: "abp-permission-management", inputs: ["providerName", "providerKey", "hideBadges", "entityDisplayName", "visible"], outputs: ["visibleChange"], exportAs: ["abpPermissionManagement"] }, { kind: "component", type: i8.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
111
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: RolesComponent, decorators: [{
112
- type: Component,
113
- args: [{ selector: 'abp-roles', providers: [
114
- ListService,
115
- {
116
- provide: EXTENSIONS_IDENTIFIER,
117
- useValue: "Identity.RolesComponent" /* eIdentityComponents.Roles */,
118
- },
119
- ], template: "<abp-page [title]=\"'AbpIdentity::Roles' | abpLocalization\" [toolbar]=\"data.items\">\r\n <div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-body\">\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n\r\n <abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewRole') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n </abp-modal>\r\n\r\n <abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'R' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true },\r\n hideBadges: { value: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n >\r\n </abp-permission-management>\r\n</abp-page>\r\n" }]
26
+ class RolesComponent {
27
+ constructor(list, confirmationService, toasterService, injector, service) {
28
+ this.list = list;
29
+ this.confirmationService = confirmationService;
30
+ this.toasterService = toasterService;
31
+ this.injector = injector;
32
+ this.service = service;
33
+ this.data = { items: [], totalCount: 0 };
34
+ this.visiblePermissions = false;
35
+ this.modalBusy = false;
36
+ this.permissionManagementKey = "PermissionManagement.PermissionManagementComponent" /* ePermissionManagementComponents.PermissionManagement */;
37
+ this.onVisiblePermissionChange = (event) => {
38
+ this.visiblePermissions = event;
39
+ };
40
+ }
41
+ ngOnInit() {
42
+ this.hookToQuery();
43
+ }
44
+ buildForm() {
45
+ const data = new FormPropData(this.injector, this.selected);
46
+ this.form = generateFormFromProps(data);
47
+ }
48
+ openModal() {
49
+ this.buildForm();
50
+ this.isModalVisible = true;
51
+ }
52
+ add() {
53
+ this.selected = {};
54
+ this.openModal();
55
+ }
56
+ edit(id) {
57
+ this.service.get(id).subscribe(res => {
58
+ this.selected = res;
59
+ this.openModal();
60
+ });
61
+ }
62
+ save() {
63
+ if (!this.form.valid)
64
+ return;
65
+ this.modalBusy = true;
66
+ const { id } = this.selected || {};
67
+ (id
68
+ ? this.service.update(id, { ...this.selected, ...this.form.value })
69
+ : this.service.create(this.form.value))
70
+ .pipe(finalize(() => (this.modalBusy = false)))
71
+ .subscribe(() => {
72
+ this.isModalVisible = false;
73
+ this.list.get();
74
+ });
75
+ }
76
+ delete(id, name) {
77
+ this.confirmationService
78
+ .warn('AbpIdentity::RoleDeletionConfirmationMessage', 'AbpIdentity::AreYouSure', {
79
+ messageLocalizationParams: [name],
80
+ })
81
+ .subscribe((status) => {
82
+ if (status === Confirmation.Status.confirm) {
83
+ this.toasterService.success('AbpUi::SuccessfullyDeleted');
84
+ this.service.delete(id).subscribe(() => this.list.get());
85
+ }
86
+ });
87
+ }
88
+ hookToQuery() {
89
+ this.list.hookToQuery(query => this.service.getList(query)).subscribe(res => (this.data = res));
90
+ }
91
+ openPermissionsModal(providerKey) {
92
+ this.providerKey = providerKey;
93
+ setTimeout(() => {
94
+ this.visiblePermissions = true;
95
+ }, 0);
96
+ }
97
+ sort(data) {
98
+ const { prop, dir } = data.sorts[0];
99
+ this.list.sortKey = prop;
100
+ this.list.sortOrder = dir;
101
+ }
102
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: RolesComponent, deps: [{ token: i1.ListService }, { token: i2.ConfirmationService }, { token: i2.ToasterService }, { token: i0.Injector }, { token: i3.IdentityRoleService }], target: i0.ɵɵFactoryTarget.Component }); }
103
+ static { thiscmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.1", type: RolesComponent, selector: "abp-roles", providers: [
104
+ ListService,
105
+ {
106
+ provide: EXTENSIONS_IDENTIFIER,
107
+ useValue: "Identity.RolesComponent" /* eIdentityComponents.Roles */,
108
+ },
109
+ ], ngImport: i0, template: "<abp-page [title]=\"'AbpIdentity::Roles' | abpLocalization\" [toolbar]=\"data.items\">\r\n <div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-body\">\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n\r\n <abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewRole') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n </abp-modal>\r\n\r\n <abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'R' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true },\r\n hideBadges: { value: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n >\r\n </abp-permission-management>\r\n</abp-page>\r\n", dependencies: [{ kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i1.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }, { kind: "directive", type: i7.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: i6.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { kind: "component", type: i6.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], outputs: ["tableActivate"], exportAs: ["abpExtensibleTable"] }, { kind: "component", type: i7$1.PermissionManagementComponent, selector: "abp-permission-management", inputs: ["providerName", "providerKey", "hideBadges", "entityDisplayName", "visible"], outputs: ["visibleChange"], exportAs: ["abpPermissionManagement"] }, { kind: "component", type: i8.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
110
+ }
111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: RolesComponent, decorators: [{
112
+ type: Component,
113
+ args: [{ selector: 'abp-roles', providers: [
114
+ ListService,
115
+ {
116
+ provide: EXTENSIONS_IDENTIFIER,
117
+ useValue: "Identity.RolesComponent" /* eIdentityComponents.Roles */,
118
+ },
119
+ ], template: "<abp-page [title]=\"'AbpIdentity::Roles' | abpLocalization\" [toolbar]=\"data.items\">\r\n <div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-body\">\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n\r\n <abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewRole') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n </abp-modal>\r\n\r\n <abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'R' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true },\r\n hideBadges: { value: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n >\r\n </abp-permission-management>\r\n</abp-page>\r\n" }]
120
120
  }], ctorParameters: function () { return [{ type: i1.ListService }, { type: i2.ConfirmationService }, { type: i2.ToasterService }, { type: i0.Injector }, { type: i3.IdentityRoleService }]; } });
121
121
 
122
- class UsersComponent {
123
- constructor(list, confirmationService, service, toasterService, fb, injector) {
124
- this.list = list;
125
- this.confirmationService = confirmationService;
126
- this.service = service;
127
- this.toasterService = toasterService;
128
- this.fb = fb;
129
- this.injector = injector;
130
- this.data = { items: [], totalCount: 0 };
131
- this.visiblePermissions = false;
132
- this.modalBusy = false;
133
- this.permissionManagementKey = "PermissionManagement.PermissionManagementComponent" /* ePermissionManagementComponents.PermissionManagement */;
134
- this.inputKey = eFormComponets.FormCheckboxComponent;
135
- this.trackByFn = (index, item) => Object.keys(item)[0] || index;
136
- this.onVisiblePermissionChange = (event) => {
137
- this.visiblePermissions = event;
138
- };
139
- }
140
- get roleGroups() {
141
- return this.form.get('roleNames')?.controls || [];
142
- }
143
- ngOnInit() {
144
- this.hookToQuery();
145
- }
146
- buildForm() {
147
- const data = new FormPropData(this.injector, this.selected);
148
- this.form = generateFormFromProps(data);
149
- this.service.getAssignableRoles().subscribe(({ items }) => {
150
- this.roles = items;
151
- if (this.roles) {
152
- this.form.addControl('roleNames', this.fb.array(this.roles.map(role => this.fb.group({
153
- [role.name]: [
154
- this.selected?.id
155
- ? !!this.selectedUserRoles?.find(userRole => userRole.id === role.id)
156
- : role.isDefault,
157
- ],
158
- }))));
159
- }
160
- });
161
- }
162
- openModal() {
163
- this.buildForm();
164
- this.isModalVisible = true;
165
- }
166
- add() {
167
- this.selected = {};
168
- this.selectedUserRoles = [];
169
- this.openModal();
170
- }
171
- edit(id) {
172
- this.service
173
- .get(id)
174
- .pipe(tap(user => (this.selected = user)), switchMap(() => this.service.getRoles(id)))
175
- .subscribe(userRole => {
176
- this.selectedUserRoles = userRole.items || [];
177
- this.openModal();
178
- });
179
- }
180
- save() {
181
- if (!this.form.valid || this.modalBusy)
182
- return;
183
- this.modalBusy = true;
184
- const { roleNames = [] } = this.form.value;
185
- const mappedRoleNames = roleNames
186
- .filter((role) => !!role[Object.keys(role)[0]])
187
- .map((role) => Object.keys(role)[0]) || [];
188
- const { id } = this.selected || {};
189
- (id
190
- ? this.service.update(id, {
191
- ...this.selected,
192
- ...this.form.value,
193
- roleNames: mappedRoleNames,
194
- })
195
- : this.service.create({ ...this.form.value, roleNames: mappedRoleNames }))
196
- .pipe(finalize(() => (this.modalBusy = false)))
197
- .subscribe(() => {
198
- this.isModalVisible = false;
199
- this.list.get();
200
- });
201
- }
202
- delete(id, userName) {
203
- this.confirmationService
204
- .warn('AbpIdentity::UserDeletionConfirmationMessage', 'AbpIdentity::AreYouSure', {
205
- messageLocalizationParams: [userName],
206
- })
207
- .subscribe((status) => {
208
- if (status === Confirmation.Status.confirm) {
209
- this.service.delete(id).subscribe(() => {
210
- this.toasterService.success('AbpUi::SuccessfullyDeleted');
211
- this.list.get();
212
- });
213
- }
214
- });
215
- }
216
- sort(data) {
217
- const { prop, dir } = data.sorts[0];
218
- this.list.sortKey = prop;
219
- this.list.sortOrder = dir;
220
- }
221
- hookToQuery() {
222
- this.list.hookToQuery(query => this.service.getList(query)).subscribe(res => (this.data = res));
223
- }
224
- openPermissionsModal(providerKey, entityDisplayName) {
225
- this.providerKey = providerKey;
226
- this.entityDisplayName = entityDisplayName;
227
- setTimeout(() => {
228
- this.visiblePermissions = true;
229
- }, 0);
230
- }
231
- }
232
- UsersComponentfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UsersComponent, deps: [{ token: i1.ListService }, { token: i2.ConfirmationService }, { token: i3.IdentityUserService }, { token: i2.ToasterService }, { token: i4.UntypedFormBuilder }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
233
- UsersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: UsersComponent, selector: "abp-users", providers: [
234
- ListService,
235
- {
236
- provide: EXTENSIONS_IDENTIFIER,
237
- useValue: "Identity.UsersComponent" /* eIdentityComponents.Users */,
238
- },
239
- ], viewQueries: [{ propertyName: "modalContent", first: true, predicate: ["modalContent"], descendants: true }], ngImport: i0, template: "<abp-page [title]=\"'AbpIdentity::Users' | abpLocalization\" [toolbar]=\"data.items\">\r\n\r\n <div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-body\">\r\n <div id=\"data-tables-table-filter\" class=\"data-tables-filter mb-3\">\r\n <div class=\"input-group\">\r\n <input\r\n type=\"search\"\r\n class=\"form-control\"\r\n [placeholder]=\"'AbpUi::PagerSearch' | abpLocalization\"\r\n [(ngModel)]=\"list.filter\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n\r\n <abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewUser') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <ng-template #loaderRef\r\n >\r\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\"></i></div\r\n >\r\n </ng-template>\r\n\r\n <form *ngIf=\"form; else loaderRef\" [formGroup]=\"form\" (ngSubmit)=\"save()\">\r\n <ul ngbNav #nav=\"ngbNav\" class=\"nav-tabs\">\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::UserInformations' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </ng-template>\r\n </li>\r\n\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::Roles' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <div\r\n *ngFor=\"let roleGroup of roleGroups; let i = index; trackBy: trackByFn\"\r\n class=\"form-check mb-2\"\r\n >\r\n <abp-checkbox \r\n *abpReplaceableTemplate=\"{\r\n inputs:{\r\n checkboxId:'roles-' + i,\r\n label:roles[i].name,\r\n formControl:roleGroup.controls[roles[i].name]\r\n },\r\n componentKey: inputKey\r\n }\" \r\n [checkboxId]=\"'roles-' + i\"\r\n [formControl]=\"roleGroup.controls[roles[i].name]\"\r\n [label]=\"roles[i].name\"\r\n >\r\n </abp-checkbox>\r\n </div>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n <div class=\"mt-2 fade-in-top\" [ngbNavOutlet]=\"nav\"></div>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n </abp-modal>\r\n\r\n <abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'U' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n [entityDisplayName]=\"entityDisplayName\"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n >\r\n </abp-permission-management>\r\n</abp-page>\r\n", dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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.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: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i1.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }, { kind: "directive", type: i6$1.NgbNavContent, selector: "ng-template[ngbNavContent]" }, { kind: "directive", type: i6$1.NgbNav, selector: "[ngbNav]", inputs: ["activeId", "animation", "destroyOnHide", "orientation", "roles", "keyboard"], outputs: ["activeIdChange", "shown", "hidden", "navChange"], exportAs: ["ngbNav"] }, { kind: "directive", type: i6$1.NgbNavItem, selector: "[ngbNavItem]", inputs: ["destroyOnHide", "disabled", "domId", "ngbNavItem"], outputs: ["shown", "hidden"], exportAs: ["ngbNavItem"] }, { kind: "directive", type: i6$1.NgbNavItemRole, selector: "[ngbNavItem]:not(ng-container)" }, { kind: "directive", type: i6$1.NgbNavLink, selector: "a[ngbNavLink]" }, { kind: "directive", type: i6$1.NgbNavLinkBase, selector: "[ngbNavLink]" }, { kind: "component", type: i6$1.NgbNavOutlet, selector: "[ngbNavOutlet]", inputs: ["paneRole", "ngbNavOutlet"] }, { kind: "directive", type: i7.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i7.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: i2.FormCheckboxComponent, selector: "abp-checkbox", inputs: ["label", "labelClass", "checkboxId", "checkboxStyle", "checkboxClass", "checkboxReadonly"], outputs: ["checkboxBlur", "checkboxFocus"] }, { kind: "component", type: i6.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { kind: "component", type: i6.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], outputs: ["tableActivate"], exportAs: ["abpExtensibleTable"] }, { kind: "component", type: i7$1.PermissionManagementComponent, selector: "abp-permission-management", inputs: ["providerName", "providerKey", "hideBadges", "entityDisplayName", "visible"], outputs: ["visibleChange"], exportAs: ["abpPermissionManagement"] }, { kind: "component", type: i8.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
240
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UsersComponent, decorators: [{
241
- type: Component,
242
- args: [{ selector: 'abp-users', providers: [
243
- ListService,
244
- {
245
- provide: EXTENSIONS_IDENTIFIER,
246
- useValue: "Identity.UsersComponent" /* eIdentityComponents.Users */,
247
- },
248
- ], template: "<abp-page [title]=\"'AbpIdentity::Users' | abpLocalization\" [toolbar]=\"data.items\">\r\n\r\n <div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-body\">\r\n <div id=\"data-tables-table-filter\" class=\"data-tables-filter mb-3\">\r\n <div class=\"input-group\">\r\n <input\r\n type=\"search\"\r\n class=\"form-control\"\r\n [placeholder]=\"'AbpUi::PagerSearch' | abpLocalization\"\r\n [(ngModel)]=\"list.filter\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n\r\n <abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewUser') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <ng-template #loaderRef\r\n >\r\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\"></i></div\r\n >\r\n </ng-template>\r\n\r\n <form *ngIf=\"form; else loaderRef\" [formGroup]=\"form\" (ngSubmit)=\"save()\">\r\n <ul ngbNav #nav=\"ngbNav\" class=\"nav-tabs\">\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::UserInformations' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </ng-template>\r\n </li>\r\n\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::Roles' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <div\r\n *ngFor=\"let roleGroup of roleGroups; let i = index; trackBy: trackByFn\"\r\n class=\"form-check mb-2\"\r\n >\r\n <abp-checkbox \r\n *abpReplaceableTemplate=\"{\r\n inputs:{\r\n checkboxId:'roles-' + i,\r\n label:roles[i].name,\r\n formControl:roleGroup.controls[roles[i].name]\r\n },\r\n componentKey: inputKey\r\n }\" \r\n [checkboxId]=\"'roles-' + i\"\r\n [formControl]=\"roleGroup.controls[roles[i].name]\"\r\n [label]=\"roles[i].name\"\r\n >\r\n </abp-checkbox>\r\n </div>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n <div class=\"mt-2 fade-in-top\" [ngbNavOutlet]=\"nav\"></div>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n </abp-modal>\r\n\r\n <abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'U' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n [entityDisplayName]=\"entityDisplayName\"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n >\r\n </abp-permission-management>\r\n</abp-page>\r\n" }]
249
- }], ctorParameters: function () { return [{ type: i1.ListService }, { type: i2.ConfirmationService }, { type: i3.IdentityUserService }, { type: i2.ToasterService }, { type: i4.UntypedFormBuilder }, { type: i0.Injector }]; }, propDecorators: { modalContent: [{
250
- type: ViewChild,
251
- args: ['modalContent', { static: false }]
122
+ class UsersComponent {
123
+ get roleGroups() {
124
+ return this.form.get('roleNames')?.controls || [];
125
+ }
126
+ constructor(list, confirmationService, service, toasterService, fb, injector) {
127
+ this.list = list;
128
+ this.confirmationService = confirmationService;
129
+ this.service = service;
130
+ this.toasterService = toasterService;
131
+ this.fb = fb;
132
+ this.injector = injector;
133
+ this.data = { items: [], totalCount: 0 };
134
+ this.visiblePermissions = false;
135
+ this.modalBusy = false;
136
+ this.permissionManagementKey = "PermissionManagement.PermissionManagementComponent" /* ePermissionManagementComponents.PermissionManagement */;
137
+ this.inputKey = eFormComponets.FormCheckboxComponent;
138
+ this.trackByFn = (index, item) => Object.keys(item)[0] || index;
139
+ this.onVisiblePermissionChange = (event) => {
140
+ this.visiblePermissions = event;
141
+ };
142
+ }
143
+ ngOnInit() {
144
+ this.hookToQuery();
145
+ }
146
+ buildForm() {
147
+ const data = new FormPropData(this.injector, this.selected);
148
+ this.form = generateFormFromProps(data);
149
+ this.service.getAssignableRoles().subscribe(({ items }) => {
150
+ this.roles = items;
151
+ if (this.roles) {
152
+ this.form.addControl('roleNames', this.fb.array(this.roles.map(role => this.fb.group({
153
+ [role.name]: [
154
+ this.selected?.id
155
+ ? !!this.selectedUserRoles?.find(userRole => userRole.id === role.id)
156
+ : role.isDefault,
157
+ ],
158
+ }))));
159
+ }
160
+ });
161
+ }
162
+ openModal() {
163
+ this.buildForm();
164
+ this.isModalVisible = true;
165
+ }
166
+ add() {
167
+ this.selected = {};
168
+ this.selectedUserRoles = [];
169
+ this.openModal();
170
+ }
171
+ edit(id) {
172
+ this.service
173
+ .get(id)
174
+ .pipe(tap(user => (this.selected = user)), switchMap(() => this.service.getRoles(id)))
175
+ .subscribe(userRole => {
176
+ this.selectedUserRoles = userRole.items || [];
177
+ this.openModal();
178
+ });
179
+ }
180
+ save() {
181
+ if (!this.form.valid || this.modalBusy)
182
+ return;
183
+ this.modalBusy = true;
184
+ const { roleNames = [] } = this.form.value;
185
+ const mappedRoleNames = roleNames
186
+ .filter((role) => !!role[Object.keys(role)[0]])
187
+ .map((role) => Object.keys(role)[0]) || [];
188
+ const { id } = this.selected || {};
189
+ (id
190
+ ? this.service.update(id, {
191
+ ...this.selected,
192
+ ...this.form.value,
193
+ roleNames: mappedRoleNames,
194
+ })
195
+ : this.service.create({ ...this.form.value, roleNames: mappedRoleNames }))
196
+ .pipe(finalize(() => (this.modalBusy = false)))
197
+ .subscribe(() => {
198
+ this.isModalVisible = false;
199
+ this.list.get();
200
+ });
201
+ }
202
+ delete(id, userName) {
203
+ this.confirmationService
204
+ .warn('AbpIdentity::UserDeletionConfirmationMessage', 'AbpIdentity::AreYouSure', {
205
+ messageLocalizationParams: [userName],
206
+ })
207
+ .subscribe((status) => {
208
+ if (status === Confirmation.Status.confirm) {
209
+ this.service.delete(id).subscribe(() => {
210
+ this.toasterService.success('AbpUi::SuccessfullyDeleted');
211
+ this.list.get();
212
+ });
213
+ }
214
+ });
215
+ }
216
+ sort(data) {
217
+ const { prop, dir } = data.sorts[0];
218
+ this.list.sortKey = prop;
219
+ this.list.sortOrder = dir;
220
+ }
221
+ hookToQuery() {
222
+ this.list.hookToQuery(query => this.service.getList(query)).subscribe(res => (this.data = res));
223
+ }
224
+ openPermissionsModal(providerKey, entityDisplayName) {
225
+ this.providerKey = providerKey;
226
+ this.entityDisplayName = entityDisplayName;
227
+ setTimeout(() => {
228
+ this.visiblePermissions = true;
229
+ }, 0);
230
+ }
231
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: UsersComponent, deps: [{ token: i1.ListService }, { token: i2.ConfirmationService }, { token: i3.IdentityUserService }, { token: i2.ToasterService }, { token: i4.UntypedFormBuilder }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
232
+ static { thiscmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.1", type: UsersComponent, selector: "abp-users", providers: [
233
+ ListService,
234
+ {
235
+ provide: EXTENSIONS_IDENTIFIER,
236
+ useValue: "Identity.UsersComponent" /* eIdentityComponents.Users */,
237
+ },
238
+ ], viewQueries: [{ propertyName: "modalContent", first: true, predicate: ["modalContent"], descendants: true }], ngImport: i0, template: "<abp-page [title]=\"'AbpIdentity::Users' | abpLocalization\" [toolbar]=\"data.items\">\r\n <div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-body\">\r\n <div id=\"data-tables-table-filter\" class=\"data-tables-filter mb-3\">\r\n <div class=\"input-group\">\r\n <input\r\n type=\"search\"\r\n class=\"form-control\"\r\n [placeholder]=\"'AbpUi::PagerSearch' | abpLocalization\"\r\n [(ngModel)]=\"list.filter\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n\r\n <abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewUser') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <ng-template #loaderRef>\r\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\r\n </ng-template>\r\n\r\n <form *ngIf=\"form; else loaderRef\" [formGroup]=\"form\" (ngSubmit)=\"save()\">\r\n <ul ngbNav #nav=\"ngbNav\" class=\"nav-tabs\">\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::UserInformations' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </ng-template>\r\n </li>\r\n\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::Roles' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <div\r\n *ngFor=\"let roleGroup of roleGroups; let i = index; trackBy: trackByFn\"\r\n class=\"form-check mb-2\"\r\n >\r\n <abp-checkbox\r\n *abpReplaceableTemplate=\"{\r\n inputs: {\r\n checkboxId: 'roles-' + i,\r\n label: roles[i].name,\r\n formControl: roleGroup.controls[roles[i].name]\r\n },\r\n componentKey: inputKey\r\n }\"\r\n [checkboxId]=\"'roles-' + i\"\r\n [formControl]=\"roleGroup.controls[roles[i].name]\"\r\n [label]=\"roles[i].name\"\r\n >\r\n </abp-checkbox>\r\n </div>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n <div class=\"mt-2 fade-in-top\" [ngbNavOutlet]=\"nav\"></div>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n </abp-modal>\r\n\r\n <abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'U' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n [entityDisplayName]=\"entityDisplayName\"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n >\r\n </abp-permission-management>\r\n</abp-page>\r\n", dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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.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: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i1.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }, { kind: "directive", type: i6$1.NgbNavContent, selector: "ng-template[ngbNavContent]" }, { kind: "directive", type: i6$1.NgbNav, selector: "[ngbNav]", inputs: ["activeId", "animation", "destroyOnHide", "orientation", "roles", "keyboard"], outputs: ["activeIdChange", "shown", "hidden", "navChange"], exportAs: ["ngbNav"] }, { kind: "directive", type: i6$1.NgbNavItem, selector: "[ngbNavItem]", inputs: ["destroyOnHide", "disabled", "domId", "ngbNavItem"], outputs: ["shown", "hidden"], exportAs: ["ngbNavItem"] }, { kind: "directive", type: i6$1.NgbNavItemRole, selector: "[ngbNavItem]:not(ng-container)" }, { kind: "directive", type: i6$1.NgbNavLink, selector: "a[ngbNavLink]" }, { kind: "directive", type: i6$1.NgbNavLinkBase, selector: "[ngbNavLink]" }, { kind: "component", type: i6$1.NgbNavOutlet, selector: "[ngbNavOutlet]", inputs: ["paneRole", "ngbNavOutlet"] }, { kind: "directive", type: i7.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i7.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: i2.FormCheckboxComponent, selector: "abp-checkbox", inputs: ["label", "labelClass", "checkboxId", "checkboxStyle", "checkboxClass", "checkboxReadonly"], outputs: ["checkboxBlur", "checkboxFocus"] }, { kind: "component", type: i6.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { kind: "component", type: i6.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], outputs: ["tableActivate"], exportAs: ["abpExtensibleTable"] }, { kind: "component", type: i7$1.PermissionManagementComponent, selector: "abp-permission-management", inputs: ["providerName", "providerKey", "hideBadges", "entityDisplayName", "visible"], outputs: ["visibleChange"], exportAs: ["abpPermissionManagement"] }, { kind: "component", type: i8.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
239
+ }
240
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: UsersComponent, decorators: [{
241
+ type: Component,
242
+ args: [{ selector: 'abp-users', providers: [
243
+ ListService,
244
+ {
245
+ provide: EXTENSIONS_IDENTIFIER,
246
+ useValue: "Identity.UsersComponent" /* eIdentityComponents.Users */,
247
+ },
248
+ ], template: "<abp-page [title]=\"'AbpIdentity::Users' | abpLocalization\" [toolbar]=\"data.items\">\r\n <div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-body\">\r\n <div id=\"data-tables-table-filter\" class=\"data-tables-filter mb-3\">\r\n <div class=\"input-group\">\r\n <input\r\n type=\"search\"\r\n class=\"form-control\"\r\n [placeholder]=\"'AbpUi::PagerSearch' | abpLocalization\"\r\n [(ngModel)]=\"list.filter\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n\r\n <abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewUser') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <ng-template #loaderRef>\r\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\r\n </ng-template>\r\n\r\n <form *ngIf=\"form; else loaderRef\" [formGroup]=\"form\" (ngSubmit)=\"save()\">\r\n <ul ngbNav #nav=\"ngbNav\" class=\"nav-tabs\">\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::UserInformations' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </ng-template>\r\n </li>\r\n\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::Roles' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <div\r\n *ngFor=\"let roleGroup of roleGroups; let i = index; trackBy: trackByFn\"\r\n class=\"form-check mb-2\"\r\n >\r\n <abp-checkbox\r\n *abpReplaceableTemplate=\"{\r\n inputs: {\r\n checkboxId: 'roles-' + i,\r\n label: roles[i].name,\r\n formControl: roleGroup.controls[roles[i].name]\r\n },\r\n componentKey: inputKey\r\n }\"\r\n [checkboxId]=\"'roles-' + i\"\r\n [formControl]=\"roleGroup.controls[roles[i].name]\"\r\n [label]=\"roles[i].name\"\r\n >\r\n </abp-checkbox>\r\n </div>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n <div class=\"mt-2 fade-in-top\" [ngbNavOutlet]=\"nav\"></div>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n </abp-modal>\r\n\r\n <abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'U' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n [entityDisplayName]=\"entityDisplayName\"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n >\r\n </abp-permission-management>\r\n</abp-page>\r\n" }]
249
+ }], ctorParameters: function () { return [{ type: i1.ListService }, { type: i2.ConfirmationService }, { type: i3.IdentityUserService }, { type: i2.ToasterService }, { type: i4.UntypedFormBuilder }, { type: i0.Injector }]; }, propDecorators: { modalContent: [{
250
+ type: ViewChild,
251
+ args: ['modalContent', { static: false }]
252
252
  }] } });
253
253
 
254
- const DEFAULT_ROLES_ENTITY_ACTIONS = EntityAction.createMany([
255
- {
256
- text: 'AbpIdentity::Edit',
257
- action: data => {
258
- const component = data.getInjected(RolesComponent);
259
- component.edit(data.record.id || '');
260
- },
261
- permission: 'AbpIdentity.Roles.Update',
262
- },
263
- {
264
- text: 'AbpIdentity::Permissions',
265
- action: data => {
266
- const component = data.getInjected(RolesComponent);
267
- component.openPermissionsModal(data.record.name || '');
268
- },
269
- permission: 'AbpIdentity.Roles.ManagePermissions',
270
- },
271
- {
272
- text: 'AbpIdentity::Delete',
273
- action: data => {
274
- const component = data.getInjected(RolesComponent);
275
- component.delete(data.record.id || '', data.record.name || '');
276
- },
277
- permission: 'AbpIdentity.Roles.Delete',
278
- visible: data => !data?.record.isStatic,
279
- },
254
+ const DEFAULT_ROLES_ENTITY_ACTIONS = EntityAction.createMany([
255
+ {
256
+ text: 'AbpIdentity::Edit',
257
+ action: data => {
258
+ const component = data.getInjected(RolesComponent);
259
+ component.edit(data.record.id || '');
260
+ },
261
+ permission: 'AbpIdentity.Roles.Update',
262
+ },
263
+ {
264
+ text: 'AbpIdentity::Permissions',
265
+ action: data => {
266
+ const component = data.getInjected(RolesComponent);
267
+ component.openPermissionsModal(data.record.name || '');
268
+ },
269
+ permission: 'AbpIdentity.Roles.ManagePermissions',
270
+ },
271
+ {
272
+ text: 'AbpIdentity::Delete',
273
+ action: data => {
274
+ const component = data.getInjected(RolesComponent);
275
+ component.delete(data.record.id || '', data.record.name || '');
276
+ },
277
+ permission: 'AbpIdentity.Roles.Delete',
278
+ visible: data => !data?.record.isStatic,
279
+ },
280
280
  ]);
281
281
 
282
- const DEFAULT_ROLES_ENTITY_PROPS = EntityProp.createMany([
283
- {
284
- type: "string" /* ePropType.String */,
285
- name: 'name',
286
- displayName: 'AbpIdentity::RoleName',
287
- sortable: true,
288
- valueResolver: data => {
289
- const l10n = data.getInjected(LocalizationService);
290
- const t = l10n.instant.bind(l10n);
291
- const { isDefault, isPublic, name } = data.record;
292
- return of(escapeHtmlChars(name) +
293
- (isDefault
294
- ? `<span class="badge rounded-pill bg-success ms-1">${t('AbpIdentity::DisplayName:IsDefault')}</span>`
295
- : '') +
296
- (isPublic
297
- ? `<span class="badge rounded-pill bg-info ms-1">${t('AbpIdentity::DisplayName:IsPublic')}</span>`
298
- : ''));
299
- },
300
- },
282
+ const DEFAULT_ROLES_ENTITY_PROPS = EntityProp.createMany([
283
+ {
284
+ type: "string" /* ePropType.String */,
285
+ name: 'name',
286
+ displayName: 'AbpIdentity::RoleName',
287
+ sortable: true,
288
+ valueResolver: data => {
289
+ const l10n = data.getInjected(LocalizationService);
290
+ const t = l10n.instant.bind(l10n);
291
+ const { isDefault, isPublic, name } = data.record;
292
+ return of(escapeHtmlChars(name) +
293
+ (isDefault
294
+ ? `<span class="badge rounded-pill bg-success ms-1">${t('AbpIdentity::DisplayName:IsDefault')}</span>`
295
+ : '') +
296
+ (isPublic
297
+ ? `<span class="badge rounded-pill bg-info ms-1">${t('AbpIdentity::DisplayName:IsPublic')}</span>`
298
+ : ''));
299
+ },
300
+ },
301
301
  ]);
302
302
 
303
- const DEFAULT_ROLES_CREATE_FORM_PROPS = FormProp.createMany([
304
- {
305
- type: "string" /* ePropType.String */,
306
- name: 'name',
307
- displayName: 'AbpIdentity::RoleName',
308
- id: 'role-name',
309
- disabled: ((data) => data.record && data.record.isStatic),
310
- validators: () => [Validators.required],
311
- },
312
- {
313
- type: "boolean" /* ePropType.Boolean */,
314
- name: 'isDefault',
315
- displayName: 'AbpIdentity::DisplayName:IsDefault',
316
- id: 'role-is-default',
317
- defaultValue: false,
318
- },
319
- {
320
- type: "boolean" /* ePropType.Boolean */,
321
- name: 'isPublic',
322
- displayName: 'AbpIdentity::DisplayName:IsPublic',
323
- id: 'role-is-public',
324
- defaultValue: false,
325
- },
326
- ]);
303
+ const DEFAULT_ROLES_CREATE_FORM_PROPS = FormProp.createMany([
304
+ {
305
+ type: "string" /* ePropType.String */,
306
+ name: 'name',
307
+ displayName: 'AbpIdentity::RoleName',
308
+ id: 'role-name',
309
+ disabled: ((data) => data.record && data.record.isStatic),
310
+ validators: () => [Validators.required],
311
+ },
312
+ {
313
+ type: "boolean" /* ePropType.Boolean */,
314
+ name: 'isDefault',
315
+ displayName: 'AbpIdentity::DisplayName:IsDefault',
316
+ id: 'role-is-default',
317
+ defaultValue: false,
318
+ },
319
+ {
320
+ type: "boolean" /* ePropType.Boolean */,
321
+ name: 'isPublic',
322
+ displayName: 'AbpIdentity::DisplayName:IsPublic',
323
+ id: 'role-is-public',
324
+ defaultValue: false,
325
+ },
326
+ ]);
327
327
  const DEFAULT_ROLES_EDIT_FORM_PROPS = DEFAULT_ROLES_CREATE_FORM_PROPS;
328
328
 
329
- const DEFAULT_ROLES_TOOLBAR_ACTIONS = ToolbarAction.createMany([
330
- {
331
- text: 'AbpIdentity::NewRole',
332
- action: data => {
333
- const component = data.getInjected(RolesComponent);
334
- component.add();
335
- },
336
- permission: 'AbpIdentity.Roles.Create',
337
- icon: 'fa fa-plus',
338
- },
329
+ const DEFAULT_ROLES_TOOLBAR_ACTIONS = ToolbarAction.createMany([
330
+ {
331
+ text: 'AbpIdentity::NewRole',
332
+ action: data => {
333
+ const component = data.getInjected(RolesComponent);
334
+ component.add();
335
+ },
336
+ permission: 'AbpIdentity.Roles.Create',
337
+ icon: 'fa fa-plus',
338
+ },
339
339
  ]);
340
340
 
341
- const DEFAULT_USERS_ENTITY_ACTIONS = EntityAction.createMany([
342
- {
343
- text: 'AbpIdentity::Edit',
344
- action: data => {
345
- const component = data.getInjected(UsersComponent);
346
- component.edit(data.record.id || '');
347
- },
348
- permission: 'AbpIdentity.Users.Update',
349
- },
350
- {
351
- text: 'AbpIdentity::Permissions',
352
- action: data => {
353
- const component = data.getInjected(UsersComponent);
354
- component.openPermissionsModal(data.record.id || '', data.record.userName);
355
- },
356
- permission: 'AbpIdentity.Users.ManagePermissions',
357
- },
358
- {
359
- text: 'AbpIdentity::Delete',
360
- action: data => {
361
- const component = data.getInjected(UsersComponent);
362
- component.delete(data.record.id || '', data.record.name || data.record.userName || '');
363
- },
364
- visible: data => {
365
- const userName = data?.record.userName;
366
- const configStateService = data?.getInjected(ConfigStateService);
367
- const currentUser = configStateService?.getOne('currentUser');
368
- return userName !== currentUser.userName;
369
- },
370
- permission: 'AbpIdentity.Users.Delete',
371
- },
341
+ const DEFAULT_USERS_ENTITY_ACTIONS = EntityAction.createMany([
342
+ {
343
+ text: 'AbpIdentity::Edit',
344
+ action: data => {
345
+ const component = data.getInjected(UsersComponent);
346
+ component.edit(data.record.id || '');
347
+ },
348
+ permission: 'AbpIdentity.Users.Update',
349
+ },
350
+ {
351
+ text: 'AbpIdentity::Permissions',
352
+ action: data => {
353
+ const component = data.getInjected(UsersComponent);
354
+ component.openPermissionsModal(data.record.id || '', data.record.userName);
355
+ },
356
+ permission: 'AbpIdentity.Users.ManagePermissions',
357
+ },
358
+ {
359
+ text: 'AbpIdentity::Delete',
360
+ action: data => {
361
+ const component = data.getInjected(UsersComponent);
362
+ component.delete(data.record.id || '', data.record.name || data.record.userName || '');
363
+ },
364
+ visible: data => {
365
+ const userName = data?.record.userName;
366
+ const configStateService = data?.getInjected(ConfigStateService);
367
+ const currentUser = configStateService?.getOne('currentUser');
368
+ return userName !== currentUser.userName;
369
+ },
370
+ permission: 'AbpIdentity.Users.Delete',
371
+ },
372
372
  ]);
373
373
 
374
- const DEFAULT_USERS_ENTITY_PROPS = EntityProp.createMany([
375
- {
376
- type: "string" /* ePropType.String */,
377
- name: 'userName',
378
- displayName: 'AbpIdentity::UserName',
379
- sortable: true,
380
- columnWidth: 250,
381
- valueResolver: data => {
382
- const l10n = data.getInjected(LocalizationService);
383
- const t = l10n.instant.bind(l10n);
384
- const inactiveIcon = `<i title="${t('AbpIdentity::ThisUserIsNotActiveMessage')}" class="fas fa-ban text-danger me-1"></i>`;
374
+ const DEFAULT_USERS_ENTITY_PROPS = EntityProp.createMany([
375
+ {
376
+ type: "string" /* ePropType.String */,
377
+ name: 'userName',
378
+ displayName: 'AbpIdentity::UserName',
379
+ sortable: true,
380
+ columnWidth: 250,
381
+ valueResolver: data => {
382
+ const l10n = data.getInjected(LocalizationService);
383
+ const t = l10n.instant.bind(l10n);
384
+ const inactiveIcon = `<i title="${t('AbpIdentity::ThisUserIsNotActiveMessage')}" class="fas fa-ban text-danger me-1" aria-hidden="true"></i>`;
385
385
  return of(`
386
386
  ${!data.record.isActive ? inactiveIcon : ''}
387
- <span class="${!data.record.isActive ? 'text-muted' : ''}">${escapeHtmlChars(data.record.userName)}</span>`);
388
- },
389
- },
390
- {
391
- type: "string" /* ePropType.String */,
392
- name: 'email',
393
- displayName: 'AbpIdentity::EmailAddress',
394
- sortable: true,
395
- columnWidth: 250,
396
- },
397
- {
398
- type: "string" /* ePropType.String */,
399
- name: 'phoneNumber',
400
- displayName: 'AbpIdentity::PhoneNumber',
401
- sortable: true,
402
- columnWidth: 250,
403
- },
387
+ <span class="${!data.record.isActive ? 'text-muted' : ''}">${escapeHtmlChars(data.record.userName)}</span>`);
388
+ },
389
+ },
390
+ {
391
+ type: "string" /* ePropType.String */,
392
+ name: 'email',
393
+ displayName: 'AbpIdentity::EmailAddress',
394
+ sortable: true,
395
+ columnWidth: 250,
396
+ },
397
+ {
398
+ type: "string" /* ePropType.String */,
399
+ name: 'phoneNumber',
400
+ displayName: 'AbpIdentity::PhoneNumber',
401
+ sortable: true,
402
+ columnWidth: 250,
403
+ },
404
404
  ]);
405
405
 
406
- const DEFAULT_USERS_CREATE_FORM_PROPS = FormProp.createMany([
407
- {
408
- type: "string" /* ePropType.String */,
409
- name: 'userName',
410
- displayName: 'AbpIdentity::UserName',
411
- id: 'user-name',
412
- validators: () => [Validators.required, Validators.maxLength(256)],
413
- },
414
- {
415
- type: "passwordinputgroup" /* ePropType.PasswordInputGroup */,
416
- name: 'password',
417
- displayName: 'AbpIdentity::Password',
418
- id: 'password',
419
- autocomplete: 'new-password',
420
- validators: data => [Validators.required, ...getPasswordValidators({ get: data.getInjected })],
421
- },
422
- {
423
- type: "string" /* ePropType.String */,
424
- name: 'name',
425
- displayName: 'AbpIdentity::DisplayName:Name',
426
- id: 'name',
427
- validators: () => [Validators.maxLength(64)],
428
- },
429
- {
430
- type: "string" /* ePropType.String */,
431
- name: 'surname',
432
- displayName: 'AbpIdentity::DisplayName:Surname',
433
- id: 'surname',
434
- validators: () => [Validators.maxLength(64)],
435
- },
436
- {
437
- type: "email" /* ePropType.Email */,
438
- name: 'email',
439
- displayName: 'AbpIdentity::EmailAddress',
440
- id: 'email',
441
- validators: () => [Validators.required, Validators.maxLength(256), Validators.email],
442
- },
443
- {
444
- type: "string" /* ePropType.String */,
445
- name: 'phoneNumber',
446
- displayName: 'AbpIdentity::PhoneNumber',
447
- id: 'phone-number',
448
- validators: () => [Validators.maxLength(16)],
449
- },
450
- {
451
- type: "boolean" /* ePropType.Boolean */,
452
- name: 'isActive',
453
- displayName: 'AbpIdentity::DisplayName:IsActive',
454
- id: 'active-checkbox',
455
- defaultValue: true,
456
- },
457
- {
458
- type: "boolean" /* ePropType.Boolean */,
459
- name: 'lockoutEnabled',
460
- displayName: 'AbpIdentity::DisplayName:LockoutEnabled',
461
- id: 'lockout-checkbox',
462
- defaultValue: true,
463
- },
464
- ]);
465
- const DEFAULT_USERS_EDIT_FORM_PROPS = DEFAULT_USERS_CREATE_FORM_PROPS.map(prop => {
466
- if (prop.name === 'password') {
467
- return {
468
- ...prop,
469
- validators: (data) => [...getPasswordValidators({ get: data.getInjected })],
470
- };
471
- }
472
- return prop;
406
+ const DEFAULT_USERS_CREATE_FORM_PROPS = FormProp.createMany([
407
+ {
408
+ type: "string" /* ePropType.String */,
409
+ name: 'userName',
410
+ displayName: 'AbpIdentity::UserName',
411
+ id: 'user-name',
412
+ validators: () => [Validators.required, Validators.maxLength(256)],
413
+ },
414
+ {
415
+ type: "passwordinputgroup" /* ePropType.PasswordInputGroup */,
416
+ name: 'password',
417
+ displayName: 'AbpIdentity::Password',
418
+ id: 'password',
419
+ autocomplete: 'new-password',
420
+ validators: data => [Validators.required, ...getPasswordValidators({ get: data.getInjected })],
421
+ },
422
+ {
423
+ type: "string" /* ePropType.String */,
424
+ name: 'name',
425
+ displayName: 'AbpIdentity::DisplayName:Name',
426
+ id: 'name',
427
+ validators: () => [Validators.maxLength(64)],
428
+ },
429
+ {
430
+ type: "string" /* ePropType.String */,
431
+ name: 'surname',
432
+ displayName: 'AbpIdentity::DisplayName:Surname',
433
+ id: 'surname',
434
+ validators: () => [Validators.maxLength(64)],
435
+ },
436
+ {
437
+ type: "email" /* ePropType.Email */,
438
+ name: 'email',
439
+ displayName: 'AbpIdentity::EmailAddress',
440
+ id: 'email',
441
+ validators: () => [Validators.required, Validators.maxLength(256), Validators.email],
442
+ },
443
+ {
444
+ type: "string" /* ePropType.String */,
445
+ name: 'phoneNumber',
446
+ displayName: 'AbpIdentity::PhoneNumber',
447
+ id: 'phone-number',
448
+ validators: () => [Validators.maxLength(16)],
449
+ },
450
+ {
451
+ type: "boolean" /* ePropType.Boolean */,
452
+ name: 'isActive',
453
+ displayName: 'AbpIdentity::DisplayName:IsActive',
454
+ id: 'active-checkbox',
455
+ defaultValue: true,
456
+ },
457
+ {
458
+ type: "boolean" /* ePropType.Boolean */,
459
+ name: 'lockoutEnabled',
460
+ displayName: 'AbpIdentity::DisplayName:LockoutEnabled',
461
+ id: 'lockout-checkbox',
462
+ defaultValue: true,
463
+ },
464
+ ]);
465
+ const DEFAULT_USERS_EDIT_FORM_PROPS = DEFAULT_USERS_CREATE_FORM_PROPS.map(prop => {
466
+ if (prop.name === 'password') {
467
+ return {
468
+ ...prop,
469
+ validators: (data) => [...getPasswordValidators({ get: data.getInjected })],
470
+ };
471
+ }
472
+ return prop;
473
473
  });
474
474
 
475
- const DEFAULT_USERS_TOOLBAR_ACTIONS = ToolbarAction.createMany([
476
- {
477
- text: 'AbpIdentity::NewUser',
478
- action: data => {
479
- const component = data.getInjected(UsersComponent);
480
- component.add();
481
- },
482
- permission: 'AbpIdentity.Users.Create',
483
- icon: 'fa fa-plus',
484
- },
475
+ const DEFAULT_USERS_TOOLBAR_ACTIONS = ToolbarAction.createMany([
476
+ {
477
+ text: 'AbpIdentity::NewUser',
478
+ action: data => {
479
+ const component = data.getInjected(UsersComponent);
480
+ component.add();
481
+ },
482
+ permission: 'AbpIdentity.Users.Create',
483
+ icon: 'fa fa-plus',
484
+ },
485
485
  ]);
486
486
 
487
- const DEFAULT_IDENTITY_ENTITY_ACTIONS = {
488
- ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_ENTITY_ACTIONS,
489
- ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_ENTITY_ACTIONS,
490
- };
491
- const DEFAULT_IDENTITY_TOOLBAR_ACTIONS = {
492
- ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_TOOLBAR_ACTIONS,
493
- ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_TOOLBAR_ACTIONS,
494
- };
495
- const DEFAULT_IDENTITY_ENTITY_PROPS = {
496
- ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_ENTITY_PROPS,
497
- ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_ENTITY_PROPS,
498
- };
499
- const DEFAULT_IDENTITY_CREATE_FORM_PROPS = {
500
- ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_CREATE_FORM_PROPS,
501
- ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_CREATE_FORM_PROPS,
502
- };
503
- const DEFAULT_IDENTITY_EDIT_FORM_PROPS = {
504
- ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_EDIT_FORM_PROPS,
505
- ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_EDIT_FORM_PROPS,
506
- };
507
- const IDENTITY_ENTITY_ACTION_CONTRIBUTORS = new InjectionToken('IDENTITY_ENTITY_ACTION_CONTRIBUTORS');
508
- const IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS = new InjectionToken('IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS');
509
- const IDENTITY_ENTITY_PROP_CONTRIBUTORS = new InjectionToken('IDENTITY_ENTITY_PROP_CONTRIBUTORS');
510
- const IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS = new InjectionToken('IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS');
487
+ const DEFAULT_IDENTITY_ENTITY_ACTIONS = {
488
+ ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_ENTITY_ACTIONS,
489
+ ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_ENTITY_ACTIONS,
490
+ };
491
+ const DEFAULT_IDENTITY_TOOLBAR_ACTIONS = {
492
+ ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_TOOLBAR_ACTIONS,
493
+ ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_TOOLBAR_ACTIONS,
494
+ };
495
+ const DEFAULT_IDENTITY_ENTITY_PROPS = {
496
+ ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_ENTITY_PROPS,
497
+ ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_ENTITY_PROPS,
498
+ };
499
+ const DEFAULT_IDENTITY_CREATE_FORM_PROPS = {
500
+ ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_CREATE_FORM_PROPS,
501
+ ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_CREATE_FORM_PROPS,
502
+ };
503
+ const DEFAULT_IDENTITY_EDIT_FORM_PROPS = {
504
+ ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_EDIT_FORM_PROPS,
505
+ ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_EDIT_FORM_PROPS,
506
+ };
507
+ const IDENTITY_ENTITY_ACTION_CONTRIBUTORS = new InjectionToken('IDENTITY_ENTITY_ACTION_CONTRIBUTORS');
508
+ const IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS = new InjectionToken('IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS');
509
+ const IDENTITY_ENTITY_PROP_CONTRIBUTORS = new InjectionToken('IDENTITY_ENTITY_PROP_CONTRIBUTORS');
510
+ const IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS = new InjectionToken('IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS');
511
511
  const IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS = new InjectionToken('IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS');
512
512
 
513
- class IdentityExtensionsGuard {
514
- constructor(injector) {
515
- this.injector = injector;
516
- }
517
- canActivate() {
518
- const extensions = this.injector.get(ExtensionsService);
519
- const actionContributors = this.injector.get(IDENTITY_ENTITY_ACTION_CONTRIBUTORS, null) || {};
520
- const toolbarContributors = this.injector.get(IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS, null) || {};
521
- const propContributors = this.injector.get(IDENTITY_ENTITY_PROP_CONTRIBUTORS, null) || {};
522
- const createFormContributors = this.injector.get(IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS, null) || {};
523
- const editFormContributors = this.injector.get(IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS, null) || {};
524
- const configState = this.injector.get(ConfigStateService);
525
- return getObjectExtensionEntitiesFromStore(configState, 'Identity').pipe(map(entities => ({
526
- ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: entities.Role,
527
- ["Identity.UsersComponent" /* eIdentityComponents.Users */]: entities.User,
528
- })), mapEntitiesToContributors(configState, 'AbpIdentity'), tap(objectExtensionContributors => {
529
- mergeWithDefaultActions(extensions.entityActions, DEFAULT_IDENTITY_ENTITY_ACTIONS, actionContributors);
530
- mergeWithDefaultActions(extensions.toolbarActions, DEFAULT_IDENTITY_TOOLBAR_ACTIONS, toolbarContributors);
531
- mergeWithDefaultProps(extensions.entityProps, DEFAULT_IDENTITY_ENTITY_PROPS, objectExtensionContributors.prop, propContributors);
532
- mergeWithDefaultProps(extensions.createFormProps, DEFAULT_IDENTITY_CREATE_FORM_PROPS, objectExtensionContributors.createForm, createFormContributors);
533
- mergeWithDefaultProps(extensions.editFormProps, DEFAULT_IDENTITY_EDIT_FORM_PROPS, objectExtensionContributors.editForm, editFormContributors);
534
- }), mapTo(true));
535
- }
536
- }
537
- IdentityExtensionsGuardfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityExtensionsGuard, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
538
- IdentityExtensionsGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityExtensionsGuard });
539
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityExtensionsGuard, decorators: [{
540
- type: Injectable
541
- }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
513
+ class IdentityExtensionsGuard {
514
+ constructor() {
515
+ this.configState = inject(ConfigStateService);
516
+ this.extensions = inject(ExtensionsService);
517
+ }
518
+ canActivate() {
519
+ const config = { optional: true };
520
+ const actionContributors = inject(IDENTITY_ENTITY_ACTION_CONTRIBUTORS, config) || {};
521
+ const toolbarContributors = inject(IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS, config) || {};
522
+ const propContributors = inject(IDENTITY_ENTITY_PROP_CONTRIBUTORS, config) || {};
523
+ const createFormContributors = inject(IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS, config) || {};
524
+ const editFormContributors = inject(IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS, config) || {};
525
+ return getObjectExtensionEntitiesFromStore(this.configState, 'Identity').pipe(map(entities => ({
526
+ ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: entities.Role,
527
+ ["Identity.UsersComponent" /* eIdentityComponents.Users */]: entities.User,
528
+ })), mapEntitiesToContributors(this.configState, 'AbpIdentity'), tap(objectExtensionContributors => {
529
+ mergeWithDefaultActions(this.extensions.entityActions, DEFAULT_IDENTITY_ENTITY_ACTIONS, actionContributors);
530
+ mergeWithDefaultActions(this.extensions.toolbarActions, DEFAULT_IDENTITY_TOOLBAR_ACTIONS, toolbarContributors);
531
+ mergeWithDefaultProps(this.extensions.entityProps, DEFAULT_IDENTITY_ENTITY_PROPS, objectExtensionContributors.prop, propContributors);
532
+ mergeWithDefaultProps(this.extensions.createFormProps, DEFAULT_IDENTITY_CREATE_FORM_PROPS, objectExtensionContributors.createForm, createFormContributors);
533
+ mergeWithDefaultProps(this.extensions.editFormProps, DEFAULT_IDENTITY_EDIT_FORM_PROPS, objectExtensionContributors.editForm, editFormContributors);
534
+ }), map(() => true));
535
+ }
536
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: IdentityExtensionsGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
537
+ static { thisprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: IdentityExtensionsGuard }); }
538
+ }
539
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: IdentityExtensionsGuard, decorators: [{
540
+ type: Injectable
541
+ }] });
542
542
 
543
- const routes = [
544
- { path: '', redirectTo: 'roles', pathMatch: 'full' },
545
- {
546
- path: '',
547
- component: RouterOutletComponent,
548
- canActivate: [AuthGuard, PermissionGuard, IdentityExtensionsGuard],
549
- children: [
550
- {
551
- path: 'roles',
552
- component: ReplaceableRouteContainerComponent,
553
- data: {
554
- requiredPolicy: 'AbpIdentity.Roles',
555
- replaceableComponent: {
556
- key: "Identity.RolesComponent" /* eIdentityComponents.Roles */,
557
- defaultComponent: RolesComponent,
558
- },
559
- },
560
- },
561
- {
562
- path: 'users',
563
- component: ReplaceableRouteContainerComponent,
564
- data: {
565
- requiredPolicy: 'AbpIdentity.Users',
566
- replaceableComponent: {
567
- key: "Identity.UsersComponent" /* eIdentityComponents.Users */,
568
- defaultComponent: UsersComponent,
569
- },
570
- },
571
- },
572
- ],
573
- },
574
- ];
575
- class IdentityRoutingModule {
576
- }
577
- IdentityRoutingModulefac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
578
- IdentityRoutingModulemod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: IdentityRoutingModule, imports: [i1$1.RouterModule], exports: [RouterModule] });
579
- IdentityRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
580
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityRoutingModule, decorators: [{
581
- type: NgModule,
582
- args: [{
583
- imports: [RouterModule.forChild(routes)],
584
- exports: [RouterModule],
585
- }]
543
+ const routes = [
544
+ { path: '', redirectTo: 'roles', pathMatch: 'full' },
545
+ {
546
+ path: '',
547
+ component: RouterOutletComponent,
548
+ canActivate: mapToCanActivate([AuthGuard, PermissionGuard, IdentityExtensionsGuard]),
549
+ children: [
550
+ {
551
+ path: 'roles',
552
+ component: ReplaceableRouteContainerComponent,
553
+ data: {
554
+ requiredPolicy: 'AbpIdentity.Roles',
555
+ replaceableComponent: {
556
+ key: "Identity.RolesComponent" /* eIdentityComponents.Roles */,
557
+ defaultComponent: RolesComponent,
558
+ },
559
+ },
560
+ },
561
+ {
562
+ path: 'users',
563
+ component: ReplaceableRouteContainerComponent,
564
+ data: {
565
+ requiredPolicy: 'AbpIdentity.Users',
566
+ replaceableComponent: {
567
+ key: "Identity.UsersComponent" /* eIdentityComponents.Users */,
568
+ defaultComponent: UsersComponent,
569
+ },
570
+ },
571
+ },
572
+ ],
573
+ },
574
+ ];
575
+ class IdentityRoutingModule {
576
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: IdentityRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
577
+ static { thismod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.1", ngImport: i0, type: IdentityRoutingModule, imports: [i1$1.RouterModule], exports: [RouterModule] }); }
578
+ static { thisinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: IdentityRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
579
+ }
580
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: IdentityRoutingModule, decorators: [{
581
+ type: NgModule,
582
+ args: [{
583
+ imports: [RouterModule.forChild(routes)],
584
+ exports: [RouterModule],
585
+ }]
586
586
  }] });
587
587
 
588
- class IdentityModule {
589
- static forChild(options = {}) {
590
- return {
591
- ngModule: IdentityModule,
592
- providers: [
593
- {
594
- provide: IDENTITY_ENTITY_ACTION_CONTRIBUTORS,
595
- useValue: options.entityActionContributors,
596
- },
597
- {
598
- provide: IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS,
599
- useValue: options.toolbarActionContributors,
600
- },
601
- {
602
- provide: IDENTITY_ENTITY_PROP_CONTRIBUTORS,
603
- useValue: options.entityPropContributors,
604
- },
605
- {
606
- provide: IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS,
607
- useValue: options.createFormPropContributors,
608
- },
609
- {
610
- provide: IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS,
611
- useValue: options.editFormPropContributors,
612
- },
613
- IdentityExtensionsGuard,
614
- ],
615
- };
616
- }
617
- static forLazy(options = {}) {
618
- return new LazyModuleFactory(IdentityModule.forChild(options));
619
- }
620
- }
621
- IdentityModulefac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
622
- IdentityModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: IdentityModule, declarations: [RolesComponent, UsersComponent], imports: [CoreModule,
623
- IdentityRoutingModule,
624
- NgbNavModule,
625
- ThemeSharedModule,
626
- UiExtensionsModule,
627
- NgbDropdownModule,
628
- PermissionManagementModule,
629
- NgxValidateCoreModule,
630
- PageModule], exports: [RolesComponent, UsersComponent] });
631
- IdentityModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityModule, imports: [CoreModule,
632
- IdentityRoutingModule,
633
- NgbNavModule,
634
- ThemeSharedModule,
635
- UiExtensionsModule,
636
- NgbDropdownModule,
637
- PermissionManagementModule,
638
- NgxValidateCoreModule,
639
- PageModule] });
640
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityModule, decorators: [{
641
- type: NgModule,
642
- args: [{
643
- declarations: [RolesComponent, UsersComponent],
644
- exports: [RolesComponent, UsersComponent],
645
- imports: [
646
- CoreModule,
647
- IdentityRoutingModule,
648
- NgbNavModule,
649
- ThemeSharedModule,
650
- UiExtensionsModule,
651
- NgbDropdownModule,
652
- PermissionManagementModule,
653
- NgxValidateCoreModule,
654
- PageModule,
655
- ],
656
- }]
588
+ class IdentityModule {
589
+ static forChild(options = {}) {
590
+ return {
591
+ ngModule: IdentityModule,
592
+ providers: [
593
+ {
594
+ provide: IDENTITY_ENTITY_ACTION_CONTRIBUTORS,
595
+ useValue: options.entityActionContributors,
596
+ },
597
+ {
598
+ provide: IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS,
599
+ useValue: options.toolbarActionContributors,
600
+ },
601
+ {
602
+ provide: IDENTITY_ENTITY_PROP_CONTRIBUTORS,
603
+ useValue: options.entityPropContributors,
604
+ },
605
+ {
606
+ provide: IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS,
607
+ useValue: options.createFormPropContributors,
608
+ },
609
+ {
610
+ provide: IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS,
611
+ useValue: options.editFormPropContributors,
612
+ },
613
+ IdentityExtensionsGuard,
614
+ ],
615
+ };
616
+ }
617
+ static forLazy(options = {}) {
618
+ return new LazyModuleFactory(IdentityModule.forChild(options));
619
+ }
620
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: IdentityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
621
+ static { thismod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.1", ngImport: i0, type: IdentityModule, declarations: [RolesComponent, UsersComponent], imports: [CoreModule,
622
+ IdentityRoutingModule,
623
+ NgbNavModule,
624
+ ThemeSharedModule,
625
+ UiExtensionsModule,
626
+ NgbDropdownModule,
627
+ PermissionManagementModule,
628
+ NgxValidateCoreModule,
629
+ PageModule], exports: [RolesComponent, UsersComponent] }); }
630
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: IdentityModule, imports: [CoreModule,
631
+ IdentityRoutingModule,
632
+ NgbNavModule,
633
+ ThemeSharedModule,
634
+ UiExtensionsModule,
635
+ NgbDropdownModule,
636
+ PermissionManagementModule,
637
+ NgxValidateCoreModule,
638
+ PageModule] }); }
639
+ }
640
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: IdentityModule, decorators: [{
641
+ type: NgModule,
642
+ args: [{
643
+ declarations: [RolesComponent, UsersComponent],
644
+ exports: [RolesComponent, UsersComponent],
645
+ imports: [
646
+ CoreModule,
647
+ IdentityRoutingModule,
648
+ NgbNavModule,
649
+ ThemeSharedModule,
650
+ UiExtensionsModule,
651
+ NgbDropdownModule,
652
+ PermissionManagementModule,
653
+ NgxValidateCoreModule,
654
+ PageModule,
655
+ ],
656
+ }]
657
657
  }] });
658
658
 
659
- /**
660
- * Generated bundle index. Do not edit.
659
+ /**
660
+ * Generated bundle index. Do not edit.
661
661
  */
662
662
 
663
663
  export { DEFAULT_IDENTITY_CREATE_FORM_PROPS, DEFAULT_IDENTITY_EDIT_FORM_PROPS, DEFAULT_IDENTITY_ENTITY_ACTIONS, DEFAULT_IDENTITY_ENTITY_PROPS, DEFAULT_IDENTITY_TOOLBAR_ACTIONS, IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS, IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS, IDENTITY_ENTITY_ACTION_CONTRIBUTORS, IDENTITY_ENTITY_PROP_CONTRIBUTORS, IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS, IdentityExtensionsGuard, IdentityModule, RolesComponent, UsersComponent };