@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
@@ -1,661 +0,0 @@
1
- import * as i1 from '@abp/ng.core';
2
- import { ListService, LocalizationService, escapeHtmlChars, ConfigStateService, RouterOutletComponent, AuthGuard, PermissionGuard, ReplaceableRouteContainerComponent, LazyModuleFactory, CoreModule } from '@abp/ng.core';
3
- import * as i2 from '@abp/ng.theme.shared';
4
- import { Confirmation, eFormComponets, getPasswordValidators, ThemeSharedModule } from '@abp/ng.theme.shared';
5
- import * as i6 from '@abp/ng.theme.shared/extensions';
6
- import { FormPropData, generateFormFromProps, EXTENSIONS_IDENTIFIER, EntityAction, EntityProp, FormProp, ToolbarAction, ExtensionsService, getObjectExtensionEntitiesFromStore, mapEntitiesToContributors, mergeWithDefaultActions, mergeWithDefaultProps, UiExtensionsModule } from '@abp/ng.theme.shared/extensions';
7
- import * as i0 from '@angular/core';
8
- import { Component, ViewChild, InjectionToken, Injectable, NgModule } from '@angular/core';
9
- import { finalize, tap, switchMap, map, mapTo } from 'rxjs/operators';
10
- import * as i3 from '@abp/ng.identity/proxy';
11
- import * as i4 from '@angular/forms';
12
- import { Validators } from '@angular/forms';
13
- import * as i7 from '@ngx-validate/core';
14
- import { NgxValidateCoreModule } from '@ngx-validate/core';
15
- import * as i7$1 from '@abp/ng.permission-management';
16
- import { PermissionManagementModule } from '@abp/ng.permission-management';
17
- import * as i8 from '@abp/ng.components/page';
18
- import { PageModule } from '@abp/ng.components/page';
19
- import * as i5 from '@angular/common';
20
- import * as i6$1 from '@ng-bootstrap/ng-bootstrap';
21
- import { NgbNavModule, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
22
- import { of } from 'rxjs';
23
- import * as i1$1 from '@angular/router';
24
- import { RouterModule } from '@angular/router';
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, Object.assign(Object.assign({}, 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
- RolesComponent.ɵfac = 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" }]
120
- }], ctorParameters: function () { return [{ type: i1.ListService }, { type: i2.ConfirmationService }, { type: i2.ToasterService }, { type: i0.Injector }, { type: i3.IdentityRoleService }]; } });
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
- var _a;
142
- return ((_a = this.form.get('roleNames')) === null || _a === void 0 ? void 0 : _a.controls) || [];
143
- }
144
- ngOnInit() {
145
- this.hookToQuery();
146
- }
147
- buildForm() {
148
- const data = new FormPropData(this.injector, this.selected);
149
- this.form = generateFormFromProps(data);
150
- this.service.getAssignableRoles().subscribe(({ items }) => {
151
- this.roles = items;
152
- if (this.roles) {
153
- this.form.addControl('roleNames', this.fb.array(this.roles.map(role => {
154
- var _a, _b;
155
- return this.fb.group({
156
- [role.name]: [
157
- ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id)
158
- ? !!((_b = this.selectedUserRoles) === null || _b === void 0 ? void 0 : _b.find(userRole => userRole.id === role.id))
159
- : role.isDefault,
160
- ],
161
- });
162
- })));
163
- }
164
- });
165
- }
166
- openModal() {
167
- this.buildForm();
168
- this.isModalVisible = true;
169
- }
170
- add() {
171
- this.selected = {};
172
- this.selectedUserRoles = [];
173
- this.openModal();
174
- }
175
- edit(id) {
176
- this.service
177
- .get(id)
178
- .pipe(tap(user => (this.selected = user)), switchMap(() => this.service.getRoles(id)))
179
- .subscribe(userRole => {
180
- this.selectedUserRoles = userRole.items || [];
181
- this.openModal();
182
- });
183
- }
184
- save() {
185
- if (!this.form.valid || this.modalBusy)
186
- return;
187
- this.modalBusy = true;
188
- const { roleNames = [] } = this.form.value;
189
- const mappedRoleNames = roleNames
190
- .filter((role) => !!role[Object.keys(role)[0]])
191
- .map((role) => Object.keys(role)[0]) || [];
192
- const { id } = this.selected || {};
193
- (id
194
- ? this.service.update(id, Object.assign(Object.assign(Object.assign({}, this.selected), this.form.value), { roleNames: mappedRoleNames }))
195
- : this.service.create(Object.assign(Object.assign({}, 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
- UsersComponent.ɵfac = 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 }]
252
- }] } });
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 === null || data === void 0 ? void 0 : data.record.isStatic),
279
- },
280
- ]);
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
- },
301
- ]);
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
- ]);
327
- const DEFAULT_ROLES_EDIT_FORM_PROPS = DEFAULT_ROLES_CREATE_FORM_PROPS;
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
- },
339
- ]);
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 === null || data === void 0 ? void 0 : data.record.userName;
366
- const configStateService = data === null || data === void 0 ? void 0 : data.getInjected(ConfigStateService);
367
- const currentUser = configStateService === null || configStateService === void 0 ? void 0 : configStateService.getOne('currentUser');
368
- return userName !== currentUser.userName;
369
- },
370
- permission: 'AbpIdentity.Users.Delete',
371
- },
372
- ]);
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>`;
385
- return of(`
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
- },
404
- ]);
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 Object.assign(Object.assign({}, prop), { validators: (data) => [...getPasswordValidators({ get: data.getInjected })] });
468
- }
469
- return prop;
470
- });
471
-
472
- const DEFAULT_USERS_TOOLBAR_ACTIONS = ToolbarAction.createMany([
473
- {
474
- text: 'AbpIdentity::NewUser',
475
- action: data => {
476
- const component = data.getInjected(UsersComponent);
477
- component.add();
478
- },
479
- permission: 'AbpIdentity.Users.Create',
480
- icon: 'fa fa-plus',
481
- },
482
- ]);
483
-
484
- const DEFAULT_IDENTITY_ENTITY_ACTIONS = {
485
- ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_ENTITY_ACTIONS,
486
- ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_ENTITY_ACTIONS,
487
- };
488
- const DEFAULT_IDENTITY_TOOLBAR_ACTIONS = {
489
- ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_TOOLBAR_ACTIONS,
490
- ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_TOOLBAR_ACTIONS,
491
- };
492
- const DEFAULT_IDENTITY_ENTITY_PROPS = {
493
- ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_ENTITY_PROPS,
494
- ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_ENTITY_PROPS,
495
- };
496
- const DEFAULT_IDENTITY_CREATE_FORM_PROPS = {
497
- ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_CREATE_FORM_PROPS,
498
- ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_CREATE_FORM_PROPS,
499
- };
500
- const DEFAULT_IDENTITY_EDIT_FORM_PROPS = {
501
- ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: DEFAULT_ROLES_EDIT_FORM_PROPS,
502
- ["Identity.UsersComponent" /* eIdentityComponents.Users */]: DEFAULT_USERS_EDIT_FORM_PROPS,
503
- };
504
- const IDENTITY_ENTITY_ACTION_CONTRIBUTORS = new InjectionToken('IDENTITY_ENTITY_ACTION_CONTRIBUTORS');
505
- const IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS = new InjectionToken('IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS');
506
- const IDENTITY_ENTITY_PROP_CONTRIBUTORS = new InjectionToken('IDENTITY_ENTITY_PROP_CONTRIBUTORS');
507
- const IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS = new InjectionToken('IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS');
508
- const IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS = new InjectionToken('IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS');
509
-
510
- class IdentityExtensionsGuard {
511
- constructor(injector) {
512
- this.injector = injector;
513
- }
514
- canActivate() {
515
- const extensions = this.injector.get(ExtensionsService);
516
- const actionContributors = this.injector.get(IDENTITY_ENTITY_ACTION_CONTRIBUTORS, null) || {};
517
- const toolbarContributors = this.injector.get(IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS, null) || {};
518
- const propContributors = this.injector.get(IDENTITY_ENTITY_PROP_CONTRIBUTORS, null) || {};
519
- const createFormContributors = this.injector.get(IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS, null) || {};
520
- const editFormContributors = this.injector.get(IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS, null) || {};
521
- const configState = this.injector.get(ConfigStateService);
522
- return getObjectExtensionEntitiesFromStore(configState, 'Identity').pipe(map(entities => ({
523
- ["Identity.RolesComponent" /* eIdentityComponents.Roles */]: entities.Role,
524
- ["Identity.UsersComponent" /* eIdentityComponents.Users */]: entities.User,
525
- })), mapEntitiesToContributors(configState, 'AbpIdentity'), tap(objectExtensionContributors => {
526
- mergeWithDefaultActions(extensions.entityActions, DEFAULT_IDENTITY_ENTITY_ACTIONS, actionContributors);
527
- mergeWithDefaultActions(extensions.toolbarActions, DEFAULT_IDENTITY_TOOLBAR_ACTIONS, toolbarContributors);
528
- mergeWithDefaultProps(extensions.entityProps, DEFAULT_IDENTITY_ENTITY_PROPS, objectExtensionContributors.prop, propContributors);
529
- mergeWithDefaultProps(extensions.createFormProps, DEFAULT_IDENTITY_CREATE_FORM_PROPS, objectExtensionContributors.createForm, createFormContributors);
530
- mergeWithDefaultProps(extensions.editFormProps, DEFAULT_IDENTITY_EDIT_FORM_PROPS, objectExtensionContributors.editForm, editFormContributors);
531
- }), mapTo(true));
532
- }
533
- }
534
- IdentityExtensionsGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityExtensionsGuard, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
535
- IdentityExtensionsGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityExtensionsGuard });
536
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityExtensionsGuard, decorators: [{
537
- type: Injectable
538
- }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
539
-
540
- const routes = [
541
- { path: '', redirectTo: 'roles', pathMatch: 'full' },
542
- {
543
- path: '',
544
- component: RouterOutletComponent,
545
- canActivate: [AuthGuard, PermissionGuard, IdentityExtensionsGuard],
546
- children: [
547
- {
548
- path: 'roles',
549
- component: ReplaceableRouteContainerComponent,
550
- data: {
551
- requiredPolicy: 'AbpIdentity.Roles',
552
- replaceableComponent: {
553
- key: "Identity.RolesComponent" /* eIdentityComponents.Roles */,
554
- defaultComponent: RolesComponent,
555
- },
556
- },
557
- },
558
- {
559
- path: 'users',
560
- component: ReplaceableRouteContainerComponent,
561
- data: {
562
- requiredPolicy: 'AbpIdentity.Users',
563
- replaceableComponent: {
564
- key: "Identity.UsersComponent" /* eIdentityComponents.Users */,
565
- defaultComponent: UsersComponent,
566
- },
567
- },
568
- },
569
- ],
570
- },
571
- ];
572
- class IdentityRoutingModule {
573
- }
574
- IdentityRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
575
- IdentityRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: IdentityRoutingModule, imports: [i1$1.RouterModule], exports: [RouterModule] });
576
- IdentityRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
577
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityRoutingModule, decorators: [{
578
- type: NgModule,
579
- args: [{
580
- imports: [RouterModule.forChild(routes)],
581
- exports: [RouterModule],
582
- }]
583
- }] });
584
-
585
- class IdentityModule {
586
- static forChild(options = {}) {
587
- return {
588
- ngModule: IdentityModule,
589
- providers: [
590
- {
591
- provide: IDENTITY_ENTITY_ACTION_CONTRIBUTORS,
592
- useValue: options.entityActionContributors,
593
- },
594
- {
595
- provide: IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS,
596
- useValue: options.toolbarActionContributors,
597
- },
598
- {
599
- provide: IDENTITY_ENTITY_PROP_CONTRIBUTORS,
600
- useValue: options.entityPropContributors,
601
- },
602
- {
603
- provide: IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS,
604
- useValue: options.createFormPropContributors,
605
- },
606
- {
607
- provide: IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS,
608
- useValue: options.editFormPropContributors,
609
- },
610
- IdentityExtensionsGuard,
611
- ],
612
- };
613
- }
614
- static forLazy(options = {}) {
615
- return new LazyModuleFactory(IdentityModule.forChild(options));
616
- }
617
- }
618
- IdentityModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
619
- IdentityModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: IdentityModule, declarations: [RolesComponent, UsersComponent], imports: [CoreModule,
620
- IdentityRoutingModule,
621
- NgbNavModule,
622
- ThemeSharedModule,
623
- UiExtensionsModule,
624
- NgbDropdownModule,
625
- PermissionManagementModule,
626
- NgxValidateCoreModule,
627
- PageModule], exports: [RolesComponent, UsersComponent] });
628
- IdentityModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityModule, imports: [CoreModule,
629
- IdentityRoutingModule,
630
- NgbNavModule,
631
- ThemeSharedModule,
632
- UiExtensionsModule,
633
- NgbDropdownModule,
634
- PermissionManagementModule,
635
- NgxValidateCoreModule,
636
- PageModule] });
637
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: IdentityModule, decorators: [{
638
- type: NgModule,
639
- args: [{
640
- declarations: [RolesComponent, UsersComponent],
641
- exports: [RolesComponent, UsersComponent],
642
- imports: [
643
- CoreModule,
644
- IdentityRoutingModule,
645
- NgbNavModule,
646
- ThemeSharedModule,
647
- UiExtensionsModule,
648
- NgbDropdownModule,
649
- PermissionManagementModule,
650
- NgxValidateCoreModule,
651
- PageModule,
652
- ],
653
- }]
654
- }] });
655
-
656
- /**
657
- * Generated bundle index. Do not edit.
658
- */
659
-
660
- 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 };
661
- //# sourceMappingURL=abp-ng.identity.mjs.map