@volo/abp.ng.identity 5.0.0-rc.1 → 5.1.1

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 (187) hide show
  1. package/README.md +2 -2
  2. package/config/handlers/link-login.handler.d.ts +3 -2
  3. package/config/package.json +5 -5
  4. package/esm2020/config/components/identity-settings.component.mjs +94 -0
  5. package/esm2020/config/components/index.mjs +3 -0
  6. package/esm2020/config/components/my-link-users-modal.component.mjs +136 -0
  7. package/esm2020/config/enums/index.mjs +4 -0
  8. package/esm2020/config/enums/policy-names.mjs +2 -0
  9. package/esm2020/config/enums/route-names.mjs +2 -0
  10. package/esm2020/config/enums/setting-tab-names.mjs +2 -0
  11. package/esm2020/config/handlers/link-login.handler.mjs +70 -0
  12. package/esm2020/config/identity-config.module.mjs +37 -0
  13. package/esm2020/config/models/identity-settings.mjs +2 -0
  14. package/esm2020/config/models/index.mjs +2 -0
  15. package/esm2020/config/providers/index.mjs +3 -0
  16. package/esm2020/config/providers/route.provider.mjs +56 -0
  17. package/esm2020/config/providers/setting-tab.provider.mjs +24 -0
  18. package/esm2020/config/public-api.mjs +8 -0
  19. package/esm2020/config/services/identity-config.service.mjs +32 -0
  20. package/esm2020/config/services/identity-link-login.service.mjs +40 -0
  21. package/esm2020/config/services/index.mjs +3 -0
  22. package/esm2020/config/utils/factories.mjs +14 -0
  23. package/esm2020/config/volo-abp.ng.identity-config.mjs +5 -0
  24. package/esm2020/lib/components/claim-modal/claim-modal.component.mjs +92 -0
  25. package/esm2020/lib/components/claims/claims.component.mjs +114 -0
  26. package/esm2020/lib/components/index.mjs +12 -0
  27. package/esm2020/lib/components/organization-units/abstract-organization-unit/abstract-organization-unit.component.mjs +77 -0
  28. package/esm2020/lib/components/organization-units/organization-members/organization-members-modal-body.component.mjs +110 -0
  29. package/esm2020/lib/components/organization-units/organization-members/organization-members.component.mjs +50 -0
  30. package/esm2020/lib/components/organization-units/organization-roles/organization-roles-modal-body.component.mjs +78 -0
  31. package/esm2020/lib/components/organization-units/organization-roles/organization-roles.component.mjs +50 -0
  32. package/esm2020/lib/components/organization-units/organization-units.component.mjs +147 -0
  33. package/esm2020/lib/components/roles/roles.component.mjs +125 -0
  34. package/esm2020/lib/components/security-logs/security-logs.component.mjs +52 -0
  35. package/esm2020/lib/components/users/users.component.mjs +247 -0
  36. package/esm2020/lib/defaults/default-claims-entity-actions.mjs +22 -0
  37. package/esm2020/lib/defaults/default-claims-entity-props.mjs +49 -0
  38. package/esm2020/lib/defaults/default-claims-form-props.mjs +52 -0
  39. package/esm2020/lib/defaults/default-claims-toolbar-actions.mjs +14 -0
  40. package/esm2020/lib/defaults/default-organization-members-entity-actions.mjs +14 -0
  41. package/esm2020/lib/defaults/default-organization-members-entity-props.mjs +23 -0
  42. package/esm2020/lib/defaults/default-organization-roles-entity-actions.mjs +14 -0
  43. package/esm2020/lib/defaults/default-organization-roles-entity-props.mjs +10 -0
  44. package/esm2020/lib/defaults/default-organization-units-form-props.mjs +13 -0
  45. package/esm2020/lib/defaults/default-organization-units-toolbar-actions.mjs +3 -0
  46. package/esm2020/lib/defaults/default-roles-entity-actions.mjs +48 -0
  47. package/esm2020/lib/defaults/default-roles-entity-props.mjs +24 -0
  48. package/esm2020/lib/defaults/default-roles-form-props.mjs +28 -0
  49. package/esm2020/lib/defaults/default-roles-toolbar-actions.mjs +14 -0
  50. package/esm2020/lib/defaults/default-security-logs-entity-actions.mjs +3 -0
  51. package/esm2020/lib/defaults/default-security-logs-entity-props.mjs +131 -0
  52. package/esm2020/lib/defaults/default-security-logs-toolbar-actions.mjs +3 -0
  53. package/esm2020/lib/defaults/default-users-entity-actions.mjs +104 -0
  54. package/esm2020/lib/defaults/default-users-entity-props.mjs +116 -0
  55. package/esm2020/lib/defaults/default-users-form-props.mjs +64 -0
  56. package/esm2020/lib/defaults/default-users-toolbar-actions.mjs +14 -0
  57. package/esm2020/lib/enums/components.mjs +2 -0
  58. package/esm2020/lib/enums/index.mjs +3 -0
  59. package/esm2020/lib/enums/two-factor-behaviour.mjs +9 -0
  60. package/esm2020/lib/guards/extensions.guard.mjs +38 -0
  61. package/esm2020/lib/guards/index.mjs +2 -0
  62. package/esm2020/lib/identity-routing.module.mjs +89 -0
  63. package/esm2020/lib/identity.module.mjs +155 -0
  64. package/esm2020/lib/models/config-options.mjs +2 -0
  65. package/esm2020/lib/models/identity.mjs +2 -0
  66. package/esm2020/lib/models/index.mjs +3 -0
  67. package/esm2020/lib/tokens/extensions.token.mjs +63 -0
  68. package/esm2020/lib/tokens/index.mjs +2 -0
  69. package/esm2020/proxy/lib/index.mjs +3 -0
  70. package/esm2020/proxy/lib/proxy/identity/identity-claim-type.service.mjs +42 -0
  71. package/esm2020/proxy/lib/proxy/identity/identity-claim-value-type.enum.mjs +10 -0
  72. package/esm2020/proxy/lib/proxy/identity/identity-role.service.mjs +59 -0
  73. package/esm2020/proxy/lib/proxy/identity/identity-security-log.service.mjs +37 -0
  74. package/esm2020/proxy/lib/proxy/identity/identity-settings.service.mjs +28 -0
  75. package/esm2020/proxy/lib/proxy/identity/identity-user-lookup.service.mjs +37 -0
  76. package/esm2020/proxy/lib/proxy/identity/identity-user.service.mjs +113 -0
  77. package/esm2020/proxy/lib/proxy/identity/index.mjs +10 -0
  78. package/esm2020/proxy/lib/proxy/identity/models.mjs +2 -0
  79. package/esm2020/proxy/lib/proxy/identity/organization-unit.service.mjs +90 -0
  80. package/esm2020/proxy/lib/proxy/users/index.mjs +2 -0
  81. package/esm2020/proxy/lib/proxy/users/models.mjs +2 -0
  82. package/esm2020/proxy/public-api.mjs +2 -0
  83. package/esm2020/proxy/volo-abp.ng.identity-proxy.mjs +5 -0
  84. package/esm2020/public-api.mjs +7 -0
  85. package/esm2020/volo-abp.ng.identity.mjs +5 -0
  86. package/fesm2015/volo-abp.ng.identity-config.mjs +464 -0
  87. package/fesm2015/volo-abp.ng.identity-config.mjs.map +1 -0
  88. package/fesm2015/{volo-abp.ng.identity-proxy.js → volo-abp.ng.identity-proxy.mjs} +24 -24
  89. package/fesm2015/volo-abp.ng.identity-proxy.mjs.map +1 -0
  90. package/fesm2015/volo-abp.ng.identity.mjs +2032 -0
  91. package/fesm2015/volo-abp.ng.identity.mjs.map +1 -0
  92. package/fesm2020/volo-abp.ng.identity-config.mjs +466 -0
  93. package/fesm2020/volo-abp.ng.identity-config.mjs.map +1 -0
  94. package/fesm2020/volo-abp.ng.identity-proxy.mjs +398 -0
  95. package/fesm2020/volo-abp.ng.identity-proxy.mjs.map +1 -0
  96. package/fesm2020/volo-abp.ng.identity.mjs +2045 -0
  97. package/fesm2020/volo-abp.ng.identity.mjs.map +1 -0
  98. package/package.json +42 -13
  99. package/proxy/package.json +5 -5
  100. package/proxy/src/lib/proxy/README.md +17 -0
  101. package/bundles/volo-abp.ng.identity-config.umd.js +0 -1
  102. package/bundles/volo-abp.ng.identity-proxy.umd.js +0 -1
  103. package/bundles/volo-abp.ng.identity.umd.js +0 -16
  104. package/esm2015/config/components/identity-settings.component.js +0 -1
  105. package/esm2015/config/components/index.js +0 -1
  106. package/esm2015/config/components/my-link-users-modal.component.js +0 -1
  107. package/esm2015/config/enums/index.js +0 -1
  108. package/esm2015/config/enums/policy-names.js +0 -1
  109. package/esm2015/config/enums/route-names.js +0 -1
  110. package/esm2015/config/enums/setting-tab-names.js +0 -1
  111. package/esm2015/config/handlers/link-login.handler.js +0 -1
  112. package/esm2015/config/identity-config.module.js +0 -1
  113. package/esm2015/config/models/identity-settings.js +0 -1
  114. package/esm2015/config/models/index.js +0 -1
  115. package/esm2015/config/providers/index.js +0 -1
  116. package/esm2015/config/providers/route.provider.js +0 -1
  117. package/esm2015/config/providers/setting-tab.provider.js +0 -1
  118. package/esm2015/config/public-api.js +0 -1
  119. package/esm2015/config/services/identity-config.service.js +0 -1
  120. package/esm2015/config/services/identity-link-login.service.js +0 -1
  121. package/esm2015/config/services/index.js +0 -1
  122. package/esm2015/config/utils/factories.js +0 -1
  123. package/esm2015/config/volo-abp.ng.identity-config.js +0 -1
  124. package/esm2015/lib/components/claim-modal/claim-modal.component.js +0 -1
  125. package/esm2015/lib/components/claims/claims.component.js +0 -1
  126. package/esm2015/lib/components/index.js +0 -1
  127. package/esm2015/lib/components/organization-units/abstract-organization-unit/abstract-organization-unit.component.js +0 -1
  128. package/esm2015/lib/components/organization-units/organization-members/organization-members-modal-body.component.js +0 -1
  129. package/esm2015/lib/components/organization-units/organization-members/organization-members.component.js +0 -1
  130. package/esm2015/lib/components/organization-units/organization-roles/organization-roles-modal-body.component.js +0 -1
  131. package/esm2015/lib/components/organization-units/organization-roles/organization-roles.component.js +0 -1
  132. package/esm2015/lib/components/organization-units/organization-units.component.js +0 -1
  133. package/esm2015/lib/components/roles/roles.component.js +0 -1
  134. package/esm2015/lib/components/security-logs/security-logs.component.js +0 -1
  135. package/esm2015/lib/components/users/users.component.js +0 -1
  136. package/esm2015/lib/defaults/default-claims-entity-actions.js +0 -1
  137. package/esm2015/lib/defaults/default-claims-entity-props.js +0 -1
  138. package/esm2015/lib/defaults/default-claims-form-props.js +0 -1
  139. package/esm2015/lib/defaults/default-claims-toolbar-actions.js +0 -1
  140. package/esm2015/lib/defaults/default-organization-members-entity-actions.js +0 -1
  141. package/esm2015/lib/defaults/default-organization-members-entity-props.js +0 -1
  142. package/esm2015/lib/defaults/default-organization-roles-entity-actions.js +0 -1
  143. package/esm2015/lib/defaults/default-organization-roles-entity-props.js +0 -1
  144. package/esm2015/lib/defaults/default-organization-units-form-props.js +0 -1
  145. package/esm2015/lib/defaults/default-organization-units-toolbar-actions.js +0 -1
  146. package/esm2015/lib/defaults/default-roles-entity-actions.js +0 -1
  147. package/esm2015/lib/defaults/default-roles-entity-props.js +0 -1
  148. package/esm2015/lib/defaults/default-roles-form-props.js +0 -1
  149. package/esm2015/lib/defaults/default-roles-toolbar-actions.js +0 -1
  150. package/esm2015/lib/defaults/default-security-logs-entity-actions.js +0 -1
  151. package/esm2015/lib/defaults/default-security-logs-entity-props.js +0 -1
  152. package/esm2015/lib/defaults/default-security-logs-toolbar-actions.js +0 -1
  153. package/esm2015/lib/defaults/default-users-entity-actions.js +0 -1
  154. package/esm2015/lib/defaults/default-users-entity-props.js +0 -1
  155. package/esm2015/lib/defaults/default-users-form-props.js +0 -1
  156. package/esm2015/lib/defaults/default-users-toolbar-actions.js +0 -1
  157. package/esm2015/lib/enums/components.js +0 -1
  158. package/esm2015/lib/enums/index.js +0 -1
  159. package/esm2015/lib/enums/two-factor-behaviour.js +0 -1
  160. package/esm2015/lib/guards/extensions.guard.js +0 -1
  161. package/esm2015/lib/guards/index.js +0 -1
  162. package/esm2015/lib/identity-routing.module.js +0 -1
  163. package/esm2015/lib/identity.module.js +0 -1
  164. package/esm2015/lib/models/config-options.js +0 -1
  165. package/esm2015/lib/models/identity.js +0 -1
  166. package/esm2015/lib/models/index.js +0 -1
  167. package/esm2015/lib/tokens/extensions.token.js +0 -1
  168. package/esm2015/lib/tokens/index.js +0 -1
  169. package/esm2015/proxy/lib/index.js +0 -1
  170. package/esm2015/proxy/lib/proxy/identity/identity-claim-type.service.js +0 -1
  171. package/esm2015/proxy/lib/proxy/identity/identity-claim-value-type.enum.js +0 -1
  172. package/esm2015/proxy/lib/proxy/identity/identity-role.service.js +0 -1
  173. package/esm2015/proxy/lib/proxy/identity/identity-security-log.service.js +0 -1
  174. package/esm2015/proxy/lib/proxy/identity/identity-settings.service.js +0 -1
  175. package/esm2015/proxy/lib/proxy/identity/identity-user-lookup.service.js +0 -1
  176. package/esm2015/proxy/lib/proxy/identity/identity-user.service.js +0 -1
  177. package/esm2015/proxy/lib/proxy/identity/index.js +0 -1
  178. package/esm2015/proxy/lib/proxy/identity/models.js +0 -1
  179. package/esm2015/proxy/lib/proxy/identity/organization-unit.service.js +0 -1
  180. package/esm2015/proxy/lib/proxy/users/index.js +0 -1
  181. package/esm2015/proxy/lib/proxy/users/models.js +0 -1
  182. package/esm2015/proxy/public-api.js +0 -1
  183. package/esm2015/proxy/volo-abp.ng.identity-proxy.js +0 -1
  184. package/esm2015/public-api.js +0 -1
  185. package/esm2015/volo-abp.ng.identity.js +0 -1
  186. package/fesm2015/volo-abp.ng.identity-config.js +0 -448
  187. package/fesm2015/volo-abp.ng.identity.js +0 -1995
@@ -1,1995 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { EventEmitter, Component, Input, Output, ViewChild, InjectionToken, LOCALE_ID, Injectable, NgModule } from '@angular/core';
3
- import * as i3 from '@volo/abp.ng.identity/proxy';
4
- import { OrganizationUnitService } from '@volo/abp.ng.identity/proxy';
5
- import { take, finalize, tap, switchMap, map, mapTo } from 'rxjs/operators';
6
- import * as i2 from '@abp/ng.theme.shared';
7
- import { Confirmation, ConfirmationService, getPasswordValidators, ThemeSharedModule } from '@abp/ng.theme.shared';
8
- import * as i4 from '@angular/forms';
9
- import { FormControl, Validators } from '@angular/forms';
10
- import * as i1 from '@abp/ng.core';
11
- import { ListService, mapEnumToOptions, generatePassword, LocalizationService, ConfigStateService, getShortDateShortTimeFormat, DynamicLayoutComponent, AuthGuard, PermissionGuard, ReplaceableRouteContainerComponent, LazyModuleFactory, CoreModule } from '@abp/ng.core';
12
- import * as i5 from '@angular/common';
13
- import { formatDate } from '@angular/common';
14
- import * as i6$1 from '@abp/ng.theme.shared/extensions';
15
- import { FormPropData, generateFormFromProps, EXTENSIONS_IDENTIFIER, DateAdapter, EntityAction, EntityProp, FormProp, ToolbarAction, ExtensionsService, getObjectExtensionEntitiesFromStore, mapEntitiesToContributors, mergeWithDefaultActions, mergeWithDefaultProps, UiExtensionsModule } from '@abp/ng.theme.shared/extensions';
16
- import * as i4$1 from '@abp/ng.components/page';
17
- import { PageModule } from '@abp/ng.components/page';
18
- import * as i6 from '@volo/abp.commercial.ng.ui';
19
- import { SHOW_ENTITY_HISTORY, CommercialUiModule, AdvancedEntityFiltersModule } from '@volo/abp.commercial.ng.ui';
20
- import * as i13 from '@ngx-validate/core';
21
- import { NgxValidateCoreModule } from '@ngx-validate/core';
22
- import { __rest } from 'tslib';
23
- import * as i5$1 from '@abp/ng.components/tree';
24
- import { TreeAdapter, TreeModule } from '@abp/ng.components/tree';
25
- import * as i8 from '@ng-bootstrap/ng-bootstrap';
26
- import { NgbDateAdapter, NgbNavModule, NgbDropdownModule, NgbDatepickerModule } from '@ng-bootstrap/ng-bootstrap';
27
- import * as i7 from '@abp/ng.permission-management';
28
- import { PermissionManagementModule } from '@abp/ng.permission-management';
29
- import { of } from 'rxjs';
30
- import { ImpersonationService } from '@volo/abp.commercial.ng.ui/config';
31
- import * as i1$1 from '@angular/router';
32
- import { RouterModule } from '@angular/router';
33
-
34
- class ClaimModalComponent {
35
- constructor(roleService, userService) {
36
- this.roleService = roleService;
37
- this.userService = userService;
38
- this.visibleChange = new EventEmitter();
39
- this.modalBusy = false;
40
- }
41
- get visible() {
42
- return this._visible;
43
- }
44
- set visible(value) {
45
- if (this._visible === value)
46
- return;
47
- this._visible = value;
48
- this.visibleChange.emit(value);
49
- }
50
- ngOnChanges({ visible, subject }) {
51
- if (subject && subject.currentValue) {
52
- this.service = subject.currentValue.type === 'roles' ? this.roleService : this.userService;
53
- }
54
- if (!visible)
55
- return;
56
- if (visible.currentValue)
57
- this.initModal();
58
- else {
59
- this.newClaimType = null;
60
- this.newClaimValue = null;
61
- this.subjectClaims = null;
62
- }
63
- }
64
- initModal() {
65
- this.getClaimTypeNames();
66
- this.getSubjectClaims(this.subject);
67
- }
68
- getClaimTypeNames() {
69
- this.service.getAllClaimTypes().subscribe(claimTypes => (this.claimTypes = claimTypes));
70
- }
71
- getSubjectClaims(subject) {
72
- this.service.getClaims(subject.id)
73
- .pipe(take(1))
74
- .subscribe(claims => (this.subjectClaims = claims));
75
- }
76
- addClaim() {
77
- if (!this.newClaimType || !this.newClaimValue)
78
- return;
79
- let claim = {
80
- claimType: this.newClaimType,
81
- claimValue: this.newClaimValue,
82
- };
83
- const key = this.subject.type === 'roles' ? 'roleId' : 'userId';
84
- claim = Object.assign({ [key]: this.subject.id }, claim);
85
- this.subjectClaims.push(claim);
86
- this.newClaimType = '';
87
- this.newClaimValue = '';
88
- }
89
- removeClaim(index) {
90
- if (!this.subjectClaims[index])
91
- return;
92
- this.subjectClaims = this.subjectClaims.filter((_, i) => i !== index);
93
- }
94
- save() {
95
- if (this.modalBusy)
96
- return;
97
- this.modalBusy = true;
98
- this.service
99
- .updateClaims(this.subject.id, this.subjectClaims)
100
- .pipe(take(1), finalize(() => (this.modalBusy = false)))
101
- .subscribe(() => (this.visible = false));
102
- }
103
- }
104
- ClaimModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: ClaimModalComponent, deps: [{ token: i3.IdentityRoleService }, { token: i3.IdentityUserService }], target: i0.ɵɵFactoryTarget.Component });
105
- ClaimModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: ClaimModalComponent, selector: "abp-claim-modal", inputs: { subject: "subject", visible: "visible" }, outputs: { visibleChange: "visibleChange" }, usesOnChanges: true, ngImport: i0, template: "<abp-modal [(visible)]=\"visible\" [busy]=\"modalBusy\">\n <ng-template #abpHeader>\n <h5 class=\"modal-title\">{{ 'AbpIdentity::Claims' | abpLocalization }}</h5>\n </ng-template>\n <ng-template #abpBody>\n <form (ngSubmit)=\"addClaim()\">\n <div class=\"row\">\n <div class=\"col col-sm-6\">\n <div class=\"mb-3\">\n <label class=\"form-label\" for=\"claimTypeSelect\">{{\n 'AbpIdentity::Type' | abpLocalization\n }}</label\n ><select\n autofocus\n id=\"claimTypeSelect\"\n class=\"form-select form-control\"\n [(ngModel)]=\"newClaimType\"\n [ngModelOptions]=\"{ standalone: true }\"\n >\n <option *ngFor=\"let type of claimTypes\" [ngValue]=\"type.name\">{{ type.name }}</option>\n </select>\n </div>\n </div>\n <div class=\"col col-sm-6\">\n <div class=\"mb-3\">\n <label class=\"form-label\" for=\"newClaimValue\">Value</label>\n <input\n required\n id=\"newClaimValue\"\n type=\"text\"\n class=\"form-control\"\n [(ngModel)]=\"newClaimValue\"\n [ngModelOptions]=\"{ standalone: true }\"\n />\n </div>\n </div>\n <div class=\"col col-sm-12 align-self-center d-grid\">\n <button class=\"btn btn-success\" type=\"button\" (click)=\"addClaim()\">\n <i class=\"fa fa-plus\"></i>\n {{ 'AbpIdentity::AddClaim' | abpLocalization }}\n </button>\n </div>\n </div>\n </form>\n\n <div class=\"willBeHidden\" *ngIf=\"subjectClaims && subjectClaims.length\">\n <div class=\"input-group mb-3\" *ngFor=\"let claim of subjectClaims; let i = index\">\n <div class=\"input-group-prepend\">\n <label class=\"input-group-text mw-100 fs-9\">{{ claim.claimType }}</label>\n </div>\n <input\n type=\"text\"\n class=\"form-control\"\n [(ngModel)]=\"subjectClaims[i].claimValue\"\n required\n />\n <div class=\"input-group-append\">\n <button class=\"btn btn-danger deleteClaim\" (click)=\"removeClaim(i)\">\n <i class=\"fa fa-trash\"></i>\n </button>\n </div>\n </div>\n </div>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\n </button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"save()\">{{\n 'AbpIdentity::Save' | abpLocalization\n }}</abp-button>\n </ng-template>\n</abp-modal>\n", components: [{ type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1.AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { 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]" }, { type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.ModalCloseDirective, selector: "[abpClose]" }], pipes: { "abpLocalization": i1.LocalizationPipe } });
106
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: ClaimModalComponent, decorators: [{
107
- type: Component,
108
- args: [{
109
- selector: 'abp-claim-modal',
110
- templateUrl: './claim-modal.component.html',
111
- }]
112
- }], ctorParameters: function () { return [{ type: i3.IdentityRoleService }, { type: i3.IdentityUserService }]; }, propDecorators: { subject: [{
113
- type: Input
114
- }], visible: [{
115
- type: Input
116
- }], visibleChange: [{
117
- type: Output
118
- }] } });
119
-
120
- class ClaimsComponent {
121
- constructor(list, confirmationService, injector, service) {
122
- this.list = list;
123
- this.confirmationService = confirmationService;
124
- this.injector = injector;
125
- this.service = service;
126
- this.data = { items: [], totalCount: 0 };
127
- this.modalBusy = false;
128
- this.trackByFn = (index, item) => Object.keys(item)[0] || index;
129
- }
130
- ngOnInit() {
131
- this.hookToQuery();
132
- }
133
- hookToQuery() {
134
- this.list.hookToQuery(query => this.service.getList(query)).subscribe(res => (this.data = res));
135
- }
136
- buildForm() {
137
- const data = new FormPropData(this.injector, this.selected);
138
- this.form = generateFormFromProps(data);
139
- }
140
- getTypeName(valueType) {
141
- switch (valueType) {
142
- case 0:
143
- return 'String';
144
- case 1:
145
- return 'Int';
146
- case 2:
147
- return 'Boolean';
148
- case 3:
149
- return 'DateTime';
150
- default:
151
- return valueType;
152
- }
153
- }
154
- openModal() {
155
- this.buildForm();
156
- this.isModalVisible = true;
157
- }
158
- onAdd() {
159
- this.selected = {};
160
- this.openModal();
161
- }
162
- onEdit(id) {
163
- this.service.get(id).subscribe(res => {
164
- this.selected = res;
165
- this.openModal();
166
- });
167
- }
168
- save() {
169
- if (!this.form.valid || this.modalBusy)
170
- return;
171
- this.modalBusy = true;
172
- const { id } = this.selected;
173
- (id
174
- ? this.service.update(id, Object.assign(Object.assign({}, this.selected), this.form.value))
175
- : this.service.create(this.form.value))
176
- .pipe(finalize(() => (this.modalBusy = false)))
177
- .subscribe(() => {
178
- this.list.get();
179
- this.isModalVisible = false;
180
- });
181
- }
182
- delete(id, name) {
183
- this.confirmationService
184
- .warn('AbpIdentity::ClaimTypeDeletionConfirmationMessage', 'AbpIdentity::AreYouSure', {
185
- messageLocalizationParams: [name],
186
- })
187
- .subscribe((status) => {
188
- if (status === Confirmation.Status.confirm) {
189
- this.service.delete(id).subscribe(() => this.list.get());
190
- }
191
- });
192
- }
193
- }
194
- ClaimsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: ClaimsComponent, deps: [{ token: i1.ListService }, { token: i2.ConfirmationService }, { token: i0.Injector }, { token: i3.IdentityClaimTypeService }], target: i0.ɵɵFactoryTarget.Component });
195
- ClaimsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: ClaimsComponent, selector: "abp-claims", providers: [
196
- ListService,
197
- {
198
- provide: EXTENSIONS_IDENTIFIER,
199
- useValue: "Identity.ClaimsComponent" /* Claims */,
200
- },
201
- ], viewQueries: [{ propertyName: "modalContent", first: true, predicate: ["modalContent"], descendants: true }], ngImport: i0, template: "<abp-page [title]=\"'AbpIdentity::ClaimTypes' | abpLocalization\" [toolbar]=\"data.items\">\n <div id=\"identity-claim-types-wrapper\">\n <abp-advanced-entity-filters\n localizationSourceName=\"AbpIdentity\"\n [list]=\"list\"\n ></abp-advanced-entity-filters>\n\n <div class=\"card\">\n <abp-extensible-table\n [data]=\"data.items\"\n [recordsTotal]=\"data.totalCount\"\n [list]=\"list\"\n ></abp-extensible-table>\n </div>\n </div>\n</abp-page>\n\n<abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\n <ng-template #abpHeader>\n <h3>\n {{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewClaimType') | abpLocalization }}\n </h3>\n </ng-template>\n\n <ng-template #abpBody>\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\n <div class=\"mt-2 fade-in-top\">\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\n </button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"save()\" [disabled]=\"form?.invalid\">{{\n 'AbpIdentity::Save' | abpLocalization\n }}</abp-button>\n </ng-template>\n</abp-modal>\n", components: [{ type: i4$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { type: i6.AdvancedEntityFiltersComponent, selector: "abp-advanced-entity-filters", inputs: ["list", "localizationSourceName", "entityFilterPlaceholder"] }, { type: i6$1.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], exportAs: ["abpExtensibleTable"] }, { type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { type: i6$1.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i13.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", inputs: ["blueprints", "errorTemplate", "invalidClasses", "mapErrorsFn", "skipValidation", "targetSelector", "validateOnSubmit"] }, { type: i2.ModalCloseDirective, selector: "[abpClose]" }], pipes: { "abpLocalization": i1.LocalizationPipe } });
202
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: ClaimsComponent, decorators: [{
203
- type: Component,
204
- args: [{
205
- selector: 'abp-claims',
206
- templateUrl: './claims.component.html',
207
- providers: [
208
- ListService,
209
- {
210
- provide: EXTENSIONS_IDENTIFIER,
211
- useValue: "Identity.ClaimsComponent" /* Claims */,
212
- },
213
- ],
214
- }]
215
- }], ctorParameters: function () { return [{ type: i1.ListService }, { type: i2.ConfirmationService }, { type: i0.Injector }, { type: i3.IdentityClaimTypeService }]; }, propDecorators: { modalContent: [{
216
- type: ViewChild,
217
- args: ['modalContent']
218
- }] } });
219
-
220
- const ORGANIZATION_UNIT_CONFIG = new InjectionToken('ORGANIZATION_UNIT_CONFIG');
221
- class AbstractOrganizationUnitComponent {
222
- constructor(injector) {
223
- this.injector = injector;
224
- this.currentOrganizationUnits = { items: [] };
225
- this.checkedUnits = {};
226
- this.isCheckboxDisabled = (id) => {
227
- return this.currentOrganizationUnits.items.findIndex((item) => item.id === id) > -1;
228
- };
229
- this.list = injector.get(ListService);
230
- this.list.maxResultCount = 1000;
231
- this.organizationUnitService = injector.get(OrganizationUnitService);
232
- this.confirmation = injector.get(ConfirmationService);
233
- this.config = injector.get(ORGANIZATION_UNIT_CONFIG, {});
234
- }
235
- ngOnChanges({ selectedOrganizationUnit }) {
236
- if (selectedOrganizationUnit === null || selectedOrganizationUnit === void 0 ? void 0 : selectedOrganizationUnit.firstChange) {
237
- this.hookToQuery();
238
- }
239
- else if (selectedOrganizationUnit === null || selectedOrganizationUnit === void 0 ? void 0 : selectedOrganizationUnit.currentValue) {
240
- this.list.get();
241
- }
242
- }
243
- hookToQuery() {
244
- this.list
245
- .hookToQuery(query => this.organizationUnitService[this.config.getCurrentUnitsMethodName](this.selectedOrganizationUnit.id, query))
246
- .subscribe((response) => {
247
- this.currentOrganizationUnits = response;
248
- this.checkedUnits = {};
249
- response.items.forEach((item) => {
250
- this.checkedUnits[item.id] = true;
251
- });
252
- });
253
- }
254
- addUnits() {
255
- this.isModalBusy = true;
256
- this.organizationUnitService[this.config.addUnitsMethodName](this.selectedOrganizationUnit.id, {
257
- [this.config.addUnitsBodyPropName]: Object.keys(this.checkedUnits),
258
- })
259
- .pipe(finalize(() => (this.isModalBusy = false)))
260
- .subscribe(() => {
261
- this.isModalVisible = false;
262
- this.list.get();
263
- });
264
- }
265
- delete(unitId, unitName) {
266
- this.confirmation
267
- .warn(this.config.deletionLocalizationKey, 'AbpIdentity::AreYouSure', {
268
- messageLocalizationParams: [unitName, this.selectedOrganizationUnit.displayName],
269
- })
270
- .subscribe((status) => {
271
- if (status === Confirmation.Status.confirm) {
272
- this.organizationUnitService[this.config.deleteMethodName](this.selectedOrganizationUnit.id, unitId).subscribe(() => this.list.get());
273
- }
274
- });
275
- }
276
- openModal() {
277
- this.isModalVisible = true;
278
- }
279
- }
280
- AbstractOrganizationUnitComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: AbstractOrganizationUnitComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
281
- AbstractOrganizationUnitComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: AbstractOrganizationUnitComponent, selector: "ng-component", inputs: { selectedOrganizationUnit: "selectedOrganizationUnit" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true });
282
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: AbstractOrganizationUnitComponent, decorators: [{
283
- type: Component,
284
- args: [{
285
- template: '',
286
- }]
287
- }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { selectedOrganizationUnit: [{
288
- type: Input
289
- }] } });
290
-
291
- class OrganizationMembersModalBodyComponent {
292
- constructor(list, userService) {
293
- this.list = list;
294
- this.userService = userService;
295
- this.allUnits = { items: [] };
296
- }
297
- ngOnInit() {
298
- this.hookToQuery();
299
- }
300
- hookToQuery() {
301
- this.list
302
- .hookToQuery(query => this.userService.getList(query))
303
- .subscribe(response => {
304
- this.allUnits = response;
305
- });
306
- }
307
- }
308
- OrganizationMembersModalBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: OrganizationMembersModalBodyComponent, deps: [{ token: i1.ListService }, { token: i3.IdentityUserService }], target: i0.ɵɵFactoryTarget.Component });
309
- OrganizationMembersModalBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: OrganizationMembersModalBodyComponent, selector: "abp-organization-members-modal-body", inputs: { checkedUnits: "checkedUnits", isCheckboxDisabled: "isCheckboxDisabled" }, providers: [ListService], ngImport: i0, template: `
310
- <div id="data-tables-table-filter" class="data-tables-filter">
311
- <div class="input-group">
312
- <input
313
- type="search"
314
- class="form-control"
315
- [placeholder]="'AbpUi::PagerSearch' | abpLocalization"
316
- [(ngModel)]="list.filter"
317
- />
318
- <div class="input-group-append">
319
- <button class="btn btn-sm btn-primary" (click)="list.get()">
320
- <i class="fas fa-search"></i>
321
- </button>
322
- </div>
323
- </div>
324
- </div>
325
-
326
- <div class="card">
327
- <abp-extensible-table
328
- actionsText=""
329
- [data]="allUnits.items"
330
- [recordsTotal]="allUnits.totalCount"
331
- [actionsColumnWidth]="38"
332
- [actionsTemplate]="customAction"
333
- [list]="list"
334
- ></abp-extensible-table>
335
- </div>
336
-
337
- <ng-template #customAction let-row>
338
- <input
339
- type="checkbox"
340
- [(ngModel)]="checkedUnits[row.id]"
341
- [disabled]="isCheckboxDisabled(row.id)"
342
- />
343
- </ng-template>
344
- `, isInline: true, components: [{ type: i6$1.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], exportAs: ["abpExtensibleTable"] }], directives: [{ 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]" }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }], pipes: { "abpLocalization": i1.LocalizationPipe } });
345
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: OrganizationMembersModalBodyComponent, decorators: [{
346
- type: Component,
347
- args: [{
348
- selector: 'abp-organization-members-modal-body',
349
- template: `
350
- <div id="data-tables-table-filter" class="data-tables-filter">
351
- <div class="input-group">
352
- <input
353
- type="search"
354
- class="form-control"
355
- [placeholder]="'AbpUi::PagerSearch' | abpLocalization"
356
- [(ngModel)]="list.filter"
357
- />
358
- <div class="input-group-append">
359
- <button class="btn btn-sm btn-primary" (click)="list.get()">
360
- <i class="fas fa-search"></i>
361
- </button>
362
- </div>
363
- </div>
364
- </div>
365
-
366
- <div class="card">
367
- <abp-extensible-table
368
- actionsText=""
369
- [data]="allUnits.items"
370
- [recordsTotal]="allUnits.totalCount"
371
- [actionsColumnWidth]="38"
372
- [actionsTemplate]="customAction"
373
- [list]="list"
374
- ></abp-extensible-table>
375
- </div>
376
-
377
- <ng-template #customAction let-row>
378
- <input
379
- type="checkbox"
380
- [(ngModel)]="checkedUnits[row.id]"
381
- [disabled]="isCheckboxDisabled(row.id)"
382
- />
383
- </ng-template>
384
- `,
385
- providers: [ListService],
386
- }]
387
- }], ctorParameters: function () { return [{ type: i1.ListService }, { type: i3.IdentityUserService }]; }, propDecorators: { checkedUnits: [{
388
- type: Input
389
- }], isCheckboxDisabled: [{
390
- type: Input
391
- }] } });
392
-
393
- class OrganizationMembersComponent extends AbstractOrganizationUnitComponent {
394
- }
395
- OrganizationMembersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: OrganizationMembersComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
396
- OrganizationMembersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: OrganizationMembersComponent, selector: "abp-organization-members", providers: [
397
- ListService,
398
- {
399
- provide: EXTENSIONS_IDENTIFIER,
400
- useValue: "Identity.OrganizationMembersComponent" /* OrganizationMembers */,
401
- },
402
- {
403
- provide: ORGANIZATION_UNIT_CONFIG,
404
- useValue: {
405
- getCurrentUnitsMethodName: 'getMembers',
406
- addUnitsMethodName: 'addMembers',
407
- addUnitsBodyPropName: 'userIds',
408
- deleteMethodName: 'removeMember',
409
- deletionLocalizationKey: 'AbpIdentity::RemoveUserFromOuWarningMessage',
410
- },
411
- },
412
- ], usesInheritance: true, ngImport: i0, template: "<div class=\"text-end\">\n <button class=\"btn btn-sm btn-primary mb-2\" (click)=\"openModal()\">\n <i class=\"fas fa-plus me-1\"></i> {{ 'AbpIdentity::AddMember' | abpLocalization }}\n </button>\n</div>\n\n<abp-extensible-table\n [data]=\"currentOrganizationUnits.items\"\n [recordsTotal]=\"currentOrganizationUnits.totalCount\"\n [list]=\"list\"\n></abp-extensible-table>\n\n<abp-modal [(visible)]=\"isModalVisible\" [busy]=\"isModalBusy\">\n <ng-template #abpHeader>\n <h3>{{ 'AbpIdentity::SelectUsers' | abpLocalization }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <abp-organization-members-modal-body\n [checkedUnits]=\"checkedUnits\"\n [isCheckboxDisabled]=\"isCheckboxDisabled\"\n ></abp-organization-members-modal-body>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\n </button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"addUnits()\">{{\n 'AbpIdentity::Save' | abpLocalization\n }}</abp-button>\n </ng-template>\n</abp-modal>\n", components: [{ type: i6$1.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], exportAs: ["abpExtensibleTable"] }, { type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { type: OrganizationMembersModalBodyComponent, selector: "abp-organization-members-modal-body", inputs: ["checkedUnits", "isCheckboxDisabled"] }, { type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i2.ModalCloseDirective, selector: "[abpClose]" }], pipes: { "abpLocalization": i1.LocalizationPipe } });
413
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: OrganizationMembersComponent, decorators: [{
414
- type: Component,
415
- args: [{
416
- selector: 'abp-organization-members',
417
- templateUrl: './organization-members.component.html',
418
- providers: [
419
- ListService,
420
- {
421
- provide: EXTENSIONS_IDENTIFIER,
422
- useValue: "Identity.OrganizationMembersComponent" /* OrganizationMembers */,
423
- },
424
- {
425
- provide: ORGANIZATION_UNIT_CONFIG,
426
- useValue: {
427
- getCurrentUnitsMethodName: 'getMembers',
428
- addUnitsMethodName: 'addMembers',
429
- addUnitsBodyPropName: 'userIds',
430
- deleteMethodName: 'removeMember',
431
- deletionLocalizationKey: 'AbpIdentity::RemoveUserFromOuWarningMessage',
432
- },
433
- },
434
- ],
435
- }]
436
- }] });
437
-
438
- class OrganizationRolesModalBodyComponent {
439
- constructor(list, roleService) {
440
- this.list = list;
441
- this.roleService = roleService;
442
- this.allUnits = { items: [] };
443
- }
444
- ngOnInit() {
445
- this.hookToQuery();
446
- }
447
- hookToQuery() {
448
- this.list
449
- .hookToQuery(query => this.roleService.getList(query))
450
- .subscribe(response => {
451
- this.allUnits = response;
452
- });
453
- }
454
- }
455
- OrganizationRolesModalBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: OrganizationRolesModalBodyComponent, deps: [{ token: i1.ListService }, { token: i3.IdentityRoleService }], target: i0.ɵɵFactoryTarget.Component });
456
- OrganizationRolesModalBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: OrganizationRolesModalBodyComponent, selector: "abp-organization-roles-modal-body", inputs: { checkedUnits: "checkedUnits", isCheckboxDisabled: "isCheckboxDisabled" }, providers: [ListService], ngImport: i0, template: `
457
- <div class="card">
458
- <abp-extensible-table
459
- actionsText=""
460
- [data]="allUnits.items"
461
- [recordsTotal]="allUnits.totalCount"
462
- [actionsColumnWidth]="38"
463
- [actionsTemplate]="customAction"
464
- [list]="list"
465
- ></abp-extensible-table>
466
- </div>
467
-
468
- <ng-template #customAction let-row>
469
- <input
470
- type="checkbox"
471
- [(ngModel)]="checkedUnits[row.id]"
472
- [disabled]="isCheckboxDisabled(row.id)"
473
- />
474
- </ng-template>
475
- `, isInline: true, components: [{ type: i6$1.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], exportAs: ["abpExtensibleTable"] }], directives: [{ type: i4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
476
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: OrganizationRolesModalBodyComponent, decorators: [{
477
- type: Component,
478
- args: [{
479
- selector: 'abp-organization-roles-modal-body',
480
- template: `
481
- <div class="card">
482
- <abp-extensible-table
483
- actionsText=""
484
- [data]="allUnits.items"
485
- [recordsTotal]="allUnits.totalCount"
486
- [actionsColumnWidth]="38"
487
- [actionsTemplate]="customAction"
488
- [list]="list"
489
- ></abp-extensible-table>
490
- </div>
491
-
492
- <ng-template #customAction let-row>
493
- <input
494
- type="checkbox"
495
- [(ngModel)]="checkedUnits[row.id]"
496
- [disabled]="isCheckboxDisabled(row.id)"
497
- />
498
- </ng-template>
499
- `,
500
- providers: [ListService],
501
- }]
502
- }], ctorParameters: function () { return [{ type: i1.ListService }, { type: i3.IdentityRoleService }]; }, propDecorators: { checkedUnits: [{
503
- type: Input
504
- }], isCheckboxDisabled: [{
505
- type: Input
506
- }] } });
507
-
508
- class OrganizationRolesComponent extends AbstractOrganizationUnitComponent {
509
- }
510
- OrganizationRolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: OrganizationRolesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
511
- OrganizationRolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: OrganizationRolesComponent, selector: "abp-organization-roles", providers: [
512
- ListService,
513
- {
514
- provide: EXTENSIONS_IDENTIFIER,
515
- useValue: "Identity.OrganizationRolesComponent" /* OrganizationRoles */,
516
- },
517
- {
518
- provide: ORGANIZATION_UNIT_CONFIG,
519
- useValue: {
520
- getCurrentUnitsMethodName: 'getRoles',
521
- addUnitsMethodName: 'addRoles',
522
- addUnitsBodyPropName: 'roleIds',
523
- deleteMethodName: 'removeRole',
524
- deletionLocalizationKey: 'AbpIdentity::RemoveRoleFromOuWarningMessage',
525
- },
526
- },
527
- ], usesInheritance: true, ngImport: i0, template: "<div class=\"text-end\">\n <button class=\"btn btn-sm btn-primary mb-2\" (click)=\"openModal()\">\n <i class=\"fas fa-plus me-1\"></i> {{ 'AbpIdentity::AddRole' | abpLocalization }}\n </button>\n</div>\n\n<abp-extensible-table\n [data]=\"currentOrganizationUnits.items\"\n [recordsTotal]=\"currentOrganizationUnits.totalCount\"\n [list]=\"list\"\n></abp-extensible-table>\n\n<abp-modal [(visible)]=\"isModalVisible\" [busy]=\"isModalBusy\">\n <ng-template #abpHeader>\n <h3>{{ 'AbpIdentity::SelectRoles' | abpLocalization }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <abp-organization-roles-modal-body\n [checkedUnits]=\"checkedUnits\"\n [isCheckboxDisabled]=\"isCheckboxDisabled\"\n ></abp-organization-roles-modal-body>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\n </button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"addUnits()\">{{\n 'AbpIdentity::Save' | abpLocalization\n }}</abp-button>\n </ng-template>\n</abp-modal>\n", components: [{ type: i6$1.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], exportAs: ["abpExtensibleTable"] }, { type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { type: OrganizationRolesModalBodyComponent, selector: "abp-organization-roles-modal-body", inputs: ["checkedUnits", "isCheckboxDisabled"] }, { type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i2.ModalCloseDirective, selector: "[abpClose]" }], pipes: { "abpLocalization": i1.LocalizationPipe } });
528
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: OrganizationRolesComponent, decorators: [{
529
- type: Component,
530
- args: [{
531
- selector: 'abp-organization-roles',
532
- templateUrl: './organization-roles.component.html',
533
- providers: [
534
- ListService,
535
- {
536
- provide: EXTENSIONS_IDENTIFIER,
537
- useValue: "Identity.OrganizationRolesComponent" /* OrganizationRoles */,
538
- },
539
- {
540
- provide: ORGANIZATION_UNIT_CONFIG,
541
- useValue: {
542
- getCurrentUnitsMethodName: 'getRoles',
543
- addUnitsMethodName: 'addRoles',
544
- addUnitsBodyPropName: 'roleIds',
545
- deleteMethodName: 'removeRole',
546
- deletionLocalizationKey: 'AbpIdentity::RemoveRoleFromOuWarningMessage',
547
- },
548
- },
549
- ],
550
- }]
551
- }] });
552
-
553
- class OrganizationUnitsComponent {
554
- constructor(injector, service, fb, confirmation) {
555
- this.injector = injector;
556
- this.service = service;
557
- this.fb = fb;
558
- this.confirmation = confirmation;
559
- this.organizationUnits = [];
560
- this.nodes = [];
561
- this.expandedKeys = [];
562
- this.organizationMembersKey = "Identity.OrganizationMembersComponent" /* OrganizationMembers */;
563
- this.organizationRolesKey = "Identity.OrganizationRolesComponent" /* OrganizationRoles */;
564
- this.get = () => {
565
- this.loading = true;
566
- this.service
567
- .getListAll()
568
- .pipe(finalize(() => (this.loading = false)))
569
- .subscribe((res) => {
570
- this.organizationUnits = res.items;
571
- this.treeAdapter = new TreeAdapter(res.items);
572
- this.nodes = this.treeAdapter.getTree();
573
- this.expandedKeys = [...this.expandedKeys];
574
- });
575
- };
576
- }
577
- ngOnInit() {
578
- this.get();
579
- }
580
- buildForm(selected = {}) {
581
- const data = new FormPropData(this.injector, selected);
582
- this.nodeForm = generateFormFromProps(data);
583
- this.nodeForm.addControl('parentId', new FormControl(undefined));
584
- this.nodeForm.addControl('id', new FormControl(undefined));
585
- }
586
- add() {
587
- this.buildForm();
588
- this.isNodeModalVisible = true;
589
- }
590
- edit(selected) {
591
- this.buildForm(selected);
592
- this.nodeForm.patchValue({
593
- parentId: '',
594
- displayName: selected.displayName,
595
- id: selected.id,
596
- });
597
- this.isNodeModalVisible = true;
598
- }
599
- addSubUnit({ id }) {
600
- this.buildForm();
601
- this.nodeForm.patchValue({ parentId: id, displayName: '', id: undefined });
602
- this.isNodeModalVisible = true;
603
- this.expandedKeys = this.expandedKeys.concat(id);
604
- }
605
- save() {
606
- if (this.nodeForm.invalid)
607
- return;
608
- const _a = this.nodeForm.value, { id } = _a, form = __rest(_a, ["id"]);
609
- const request = id
610
- ? this.service.update(id, {
611
- displayName: form.displayName,
612
- })
613
- : this.service.create(form);
614
- this.isModalBusy = true;
615
- request.pipe(finalize(() => (this.isModalBusy = false))).subscribe(() => {
616
- this.get();
617
- this.isNodeModalVisible = false;
618
- });
619
- }
620
- delete({ id, displayName }) {
621
- this.confirmation
622
- .warn('AbpIdentity::OrganizationUnitDeletionConfirmationMessage', 'AbpIdentity::AreYouSure', {
623
- messageLocalizationParams: [displayName],
624
- })
625
- .subscribe((status) => {
626
- if (status === Confirmation.Status.confirm) {
627
- this.service.delete(id).subscribe(() => this.get());
628
- }
629
- });
630
- }
631
- getParentName(parentId) {
632
- const parent = this.organizationUnits.find(unit => unit.id === parentId);
633
- if (!parent)
634
- return '';
635
- return parent.displayName;
636
- }
637
- onDrop(event) {
638
- if (!event.node)
639
- return;
640
- let parentId = event.node.key;
641
- if (!event.node.origin.parentId && event.pos === -1) {
642
- parentId = null;
643
- }
644
- this.move(event.dragNode.key, parentId);
645
- }
646
- move(id, newParentId) {
647
- this.service.move(id, { newParentId }).subscribe(this.get);
648
- }
649
- }
650
- OrganizationUnitsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: OrganizationUnitsComponent, deps: [{ token: i0.Injector }, { token: i3.OrganizationUnitService }, { token: i4.FormBuilder }, { token: i2.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
651
- OrganizationUnitsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: OrganizationUnitsComponent, selector: "abp-organization-units", providers: [
652
- {
653
- provide: EXTENSIONS_IDENTIFIER,
654
- useValue: "Identity.OrganizationUnitsComponent" /* OrganizationUnits */,
655
- },
656
- ], ngImport: i0, template: "<abp-page\n [title]=\"'AbpIdentity::OrganizationUnits' | abpLocalization\"\n [toolbar]=\"organizationUnits\"\n>\n <div class=\"row\">\n <div *abpPermission=\"'AbpIdentity.OrganizationUnits.ManageOU'\" class=\"col-12 col-lg-6 col-xl-5\">\n <div class=\"card\">\n <div class=\"card-header d-flex justify-content-between\">\n <h5>\n {{ 'AbpIdentity::OrganizationTree' | abpLocalization }}\n </h5>\n <button class=\"btn btn-sm btn-primary\" (click)=\"add()\">\n <i class=\"fas fa-plus me-1\"></i> {{ 'AbpIdentity::AddRootUnit' | abpLocalization }}\n </button>\n </div>\n <div class=\"card-body\" [abpLoading]=\"loading\">\n <abp-tree\n [nodes]=\"nodes\"\n [(expandedKeys)]=\"expandedKeys\"\n [(selectedNode)]=\"selectedUnit\"\n [draggable]=\"true\"\n (dropOver)=\"onDrop($event)\"\n >\n <ng-template abpTreeNodeTemplate let-node>\n <i class=\"fas fa-folder fs-15px text-primary me-1\"></i>\n {{ node.title }}\n </ng-template>\n\n <ng-template #menu let-node>\n <li class=\"pointer\" ngbDropdownItem (click)=\"edit(node.origin.entity)\">\n {{ 'AbpIdentity::Edit' | abpLocalization }}\n </li>\n <li class=\"pointer\" ngbDropdownItem (click)=\"addSubUnit(node.origin.entity)\">\n {{ 'AbpIdentity::AddSubUnit' | abpLocalization }}\n </li>\n <li class=\"pointer\" ngbDropdownItem (click)=\"delete(node.origin.entity)\">\n {{ 'AbpIdentity::Delete' | abpLocalization }}\n </li>\n </ng-template>\n </abp-tree>\n <p *ngIf=\"!loading && !nodes?.length\" class=\"text-muted\">\n {{ 'AbpIdentity::NoOrganizationUnits' | abpLocalization }}\n </p>\n </div>\n </div>\n </div>\n\n <div\n *abpPermission=\"\n 'AbpIdentity.OrganizationUnits.ManageMembers || AbpIdentity.OrganizationUnits.ManageRoles'\n \"\n class=\"col-12 col-lg-6 col-xl-7\"\n >\n <div class=\"card\">\n <ul ngbNav #nav=\"ngbNav\" class=\"nav-tabs\">\n <li ngbNavItem *abpPermission=\"'AbpIdentity.OrganizationUnits.ManageMembers'\">\n <a ngbNavLink>{{ 'AbpIdentity::Members' | abpLocalization }}</a>\n <ng-template ngbNavContent>\n <ng-container *ngIf=\"selectedUnit; else selectUnitMsg\">\n <abp-organization-members\n *abpReplaceableTemplate=\"{\n inputs: {\n selectedOrganizationUnit: { value: selectedUnit }\n },\n componentKey: organizationMembersKey\n }\"\n [selectedOrganizationUnit]=\"selectedUnit\"\n ></abp-organization-members>\n </ng-container>\n <ng-template #selectUnitMsg>\n <p class=\"text-muted\">\n {{ 'AbpIdentity::SelectAnOrganizationUnitToSeeMembers' | abpLocalization }}\n </p>\n </ng-template>\n </ng-template>\n </li>\n <li ngbNavItem *abpPermission=\"'AbpIdentity.OrganizationUnits.ManageRoles'\">\n <a ngbNavLink>{{ 'AbpIdentity::Roles' | abpLocalization }}</a>\n <ng-template ngbNavContent>\n <ng-container *ngIf=\"selectedUnit; else selectUnitMsg\">\n <abp-organization-roles\n *abpReplaceableTemplate=\"{\n inputs: {\n selectedOrganizationUnit: { value: selectedUnit }\n },\n componentKey: organizationRolesKey\n }\"\n [selectedOrganizationUnit]=\"selectedUnit\"\n ></abp-organization-roles>\n </ng-container>\n <ng-template #selectUnitMsg>\n <p class=\"text-muted\">\n {{ 'AbpIdentity::SelectAnOrganizationUnitToSeeRoles' | abpLocalization }}\n </p>\n </ng-template>\n </ng-template>\n </li>\n </ul>\n <div [ngbNavOutlet]=\"nav\"></div>\n </div>\n </div>\n </div>\n</abp-page>\n<abp-modal [(visible)]=\"isNodeModalVisible\" [busy]=\"isModalBusy\">\n <ng-template #abpHeader>\n <h3>\n {{\n (nodeForm.get('id').value\n ? 'AbpIdentity::EditOrganizationUnit'\n : 'AbpIdentity::NewOrganizationUnit'\n ) | abpLocalization\n }}\n </h3>\n </ng-template>\n\n <ng-template #abpBody>\n <div class=\"mb-3\" *ngIf=\"nodeForm.get('parentId').value as parentId\">\n <strong>{{\n 'AbpIdentity::OrganizationUnit:Parent{0}' | abpLocalization: getParentName(parentId)\n }}</strong>\n </div>\n <form [formGroup]=\"nodeForm\" (ngSubmit)=\"save()\" validateOnSubmit>\n <abp-extensible-form [selectedRecord]=\"selectedUnit\"></abp-extensible-form>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\n </button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"save()\" [disabled]=\"nodeForm?.invalid\">{{\n 'AbpIdentity::Save' | abpLocalization\n }}</abp-button>\n </ng-template>\n</abp-modal>\n", styles: ["\n .fs-15px {\n font-size: 15px;\n }\n "], components: [{ type: i4$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { type: i5$1.TreeComponent, selector: "abp-tree", inputs: ["noAnimation", "draggable", "checkable", "checkStrictly", "checkedKeys", "nodes", "expandedKeys", "selectedNode", "isNodeSelected", "beforeDrop"], outputs: ["checkedKeysChange", "expandedKeysChange", "selectedNodeChange", "dropOver"] }, { type: OrganizationMembersComponent, selector: "abp-organization-members" }, { type: OrganizationRolesComponent, selector: "abp-organization-roles" }, { type: i8.NgbNavOutlet, selector: "[ngbNavOutlet]", inputs: ["paneRole", "ngbNavOutlet"] }, { type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { type: i6$1.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission"] }, { type: i2.LoadingDirective, selector: "[abpLoading]", inputs: ["abpLoading", "abpLoadingTargetElement", "abpLoadingDelay"] }, { type: i5$1.TreeNodeTemplateDirective, selector: "[abpTreeNodeTemplate],[abp-tree-node-template]" }, { type: i8.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["disabled"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.NgbNav, selector: "[ngbNav]", inputs: ["destroyOnHide", "orientation", "roles", "keyboard", "activeId"], outputs: ["activeIdChange", "navChange"], exportAs: ["ngbNav"] }, { type: i8.NgbNavItem, selector: "[ngbNavItem]", inputs: ["disabled", "domId", "destroyOnHide", "ngbNavItem"], exportAs: ["ngbNavItem"] }, { type: i8.NgbNavLink, selector: "a[ngbNavLink]" }, { type: i8.NgbNavContent, selector: "ng-template[ngbNavContent]" }, { type: i1.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }, { type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i13.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", inputs: ["blueprints", "errorTemplate", "invalidClasses", "mapErrorsFn", "skipValidation", "targetSelector", "validateOnSubmit"] }, { type: i2.ModalCloseDirective, selector: "[abpClose]" }], pipes: { "abpLocalization": i1.LocalizationPipe } });
657
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: OrganizationUnitsComponent, decorators: [{
658
- type: Component,
659
- args: [{
660
- selector: 'abp-organization-units',
661
- templateUrl: './organization-units.component.html',
662
- providers: [
663
- {
664
- provide: EXTENSIONS_IDENTIFIER,
665
- useValue: "Identity.OrganizationUnitsComponent" /* OrganizationUnits */,
666
- },
667
- ],
668
- styles: [
669
- `
670
- .fs-15px {
671
- font-size: 15px;
672
- }
673
- `,
674
- ],
675
- }]
676
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i3.OrganizationUnitService }, { type: i4.FormBuilder }, { type: i2.ConfirmationService }]; } });
677
-
678
- class RolesComponent {
679
- constructor(list, confirmationService, service, injector) {
680
- this.list = list;
681
- this.confirmationService = confirmationService;
682
- this.service = service;
683
- this.injector = injector;
684
- this.data = { items: [], totalCount: 0 };
685
- this.visiblePermissions = false;
686
- this.modalBusy = false;
687
- this.visibleClaims = false;
688
- this.claimSubject = {};
689
- this.onVisiblePermissionChange = (value) => {
690
- this.visiblePermissions = value;
691
- };
692
- }
693
- createForm() {
694
- const data = new FormPropData(this.injector, this.selected);
695
- this.form = generateFormFromProps(data);
696
- }
697
- hookToQuery() {
698
- this.list.hookToQuery(query => this.service.getList(query)).subscribe(res => (this.data = res));
699
- }
700
- ngOnInit() {
701
- this.hookToQuery();
702
- }
703
- openModal() {
704
- this.createForm();
705
- this.isModalVisible = true;
706
- }
707
- onAdd() {
708
- this.selected = {};
709
- this.openModal();
710
- }
711
- onEdit(id) {
712
- this.service
713
- .get(id)
714
- .pipe(take(1))
715
- .subscribe(selectedRole => {
716
- this.selected = selectedRole;
717
- this.openModal();
718
- });
719
- }
720
- save() {
721
- if (!this.form.valid)
722
- return;
723
- this.modalBusy = true;
724
- const { id } = this.selected;
725
- (id
726
- ? this.service.update(id, Object.assign(Object.assign(Object.assign({}, this.selected), this.form.value), { id: this.selected.id, concurrencyStamp: this.selected.concurrencyStamp }))
727
- : this.service.create(this.form.value))
728
- .pipe(finalize(() => (this.modalBusy = false)))
729
- .subscribe(() => {
730
- this.list.get();
731
- this.isModalVisible = false;
732
- });
733
- }
734
- delete(id, name) {
735
- this.confirmationService
736
- .warn('AbpIdentity::RoleDeletionConfirmationMessage', 'AbpIdentity::AreYouSure', {
737
- messageLocalizationParams: [name],
738
- })
739
- .subscribe((status) => {
740
- if (status === Confirmation.Status.confirm) {
741
- this.service.delete(id).subscribe(() => this.list.get());
742
- }
743
- });
744
- }
745
- onManageClaims(id) {
746
- this.claimSubject = {
747
- id,
748
- type: 'roles',
749
- };
750
- this.visibleClaims = true;
751
- }
752
- openPermissionsModal(providerKey) {
753
- this.providerKey = providerKey;
754
- setTimeout(() => {
755
- this.visiblePermissions = true;
756
- }, 0);
757
- }
758
- }
759
- RolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: RolesComponent, deps: [{ token: i1.ListService }, { token: i2.ConfirmationService }, { token: i3.IdentityRoleService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
760
- RolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: RolesComponent, selector: "abp-roles", providers: [
761
- ListService,
762
- {
763
- provide: EXTENSIONS_IDENTIFIER,
764
- useValue: "Identity.RolesComponent" /* Roles */,
765
- },
766
- ], viewQueries: [{ propertyName: "modalContent", first: true, predicate: ["modalContent"], descendants: true }], ngImport: i0, template: "<abp-page [title]=\"'AbpIdentity::Roles' | abpLocalization\" [toolbar]=\"data.items\">\n <div id=\"identity-roles-wrapper\">\n <abp-advanced-entity-filters\n localizationSourceName=\"AbpIdentity\"\n [list]=\"list\"\n ></abp-advanced-entity-filters>\n\n <div class=\"card\">\n <abp-extensible-table\n [data]=\"data.items\"\n [recordsTotal]=\"data.totalCount\"\n [list]=\"list\"\n ></abp-extensible-table>\n </div>\n </div>\n</abp-page>\n\n<abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\n <ng-template #abpHeader>\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewRole') | abpLocalization }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\n </button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\n 'AbpIdentity::Save' | abpLocalization\n }}</abp-button>\n </ng-template>\n</abp-modal>\n\n<abp-permission-management\n *abpReplaceableTemplate=\"{\n inputs: {\n providerName: { value: 'R' },\n providerKey: { value: providerKey },\n hideBadges: { value: true },\n visible: { value: visiblePermissions, twoWay: true }\n },\n outputs: { visibleChange: onVisiblePermissionChange },\n componentKey: 'PermissionManagement.PermissionManagementComponent'\n }\"\n [(visible)]=\"visiblePermissions\"\n [providerKey]=\"providerKey\"\n providerName=\"R\"\n [hideBadges]=\"true\"\n>\n</abp-permission-management>\n\n<abp-claim-modal [(visible)]=\"visibleClaims\" [subject]=\"claimSubject\"></abp-claim-modal>\n", components: [{ type: i4$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { type: i6.AdvancedEntityFiltersComponent, selector: "abp-advanced-entity-filters", inputs: ["list", "localizationSourceName", "entityFilterPlaceholder"] }, { type: i6$1.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], exportAs: ["abpExtensibleTable"] }, { type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { type: i6$1.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { type: i7.PermissionManagementComponent, selector: "abp-permission-management", inputs: ["providerName", "providerKey", "hideBadges", "visible"], outputs: ["visibleChange"], exportAs: ["abpPermissionManagement"] }, { type: ClaimModalComponent, selector: "abp-claim-modal", inputs: ["subject", "visible"], outputs: ["visibleChange"] }], directives: [{ type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i13.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", inputs: ["blueprints", "errorTemplate", "invalidClasses", "mapErrorsFn", "skipValidation", "targetSelector", "validateOnSubmit"] }, { type: i2.ModalCloseDirective, selector: "[abpClose]" }, { type: i1.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }], pipes: { "abpLocalization": i1.LocalizationPipe } });
767
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: RolesComponent, decorators: [{
768
- type: Component,
769
- args: [{
770
- selector: 'abp-roles',
771
- templateUrl: './roles.component.html',
772
- providers: [
773
- ListService,
774
- {
775
- provide: EXTENSIONS_IDENTIFIER,
776
- useValue: "Identity.RolesComponent" /* Roles */,
777
- },
778
- ],
779
- }]
780
- }], ctorParameters: function () { return [{ type: i1.ListService }, { type: i2.ConfirmationService }, { type: i3.IdentityRoleService }, { type: i0.Injector }]; }, propDecorators: { modalContent: [{
781
- type: ViewChild,
782
- args: ['modalContent']
783
- }] } });
784
-
785
- class SecurityLogsComponent {
786
- constructor(list, service) {
787
- this.list = list;
788
- this.service = service;
789
- this.data = { items: [], totalCount: 0 };
790
- this.filter = {};
791
- }
792
- ngOnInit() {
793
- this.hookToQuery();
794
- }
795
- hookToQuery() {
796
- this.list
797
- .hookToQuery(query => this.service.getList(Object.assign(Object.assign({}, query), this.filter)))
798
- .subscribe(res => (this.data = res));
799
- }
800
- }
801
- SecurityLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: SecurityLogsComponent, deps: [{ token: i1.ListService }, { token: i3.IdentitySecurityLogService }], target: i0.ɵɵFactoryTarget.Component });
802
- SecurityLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: SecurityLogsComponent, selector: "abp-security-logs", providers: [
803
- ListService,
804
- {
805
- provide: EXTENSIONS_IDENTIFIER,
806
- useValue: "Identity.SecurityLogs" /* SecurityLogs */,
807
- },
808
- { provide: NgbDateAdapter, useClass: DateAdapter },
809
- ], ngImport: i0, template: "<div id=\"wrapper\">\n <abp-page [title]=\"'AbpIdentity::SecurityLogs' | abpLocalization\" [toolbar]=\"data.items\">\n <div class=\"card\">\n <div class=\"card-body pb-lg-3\">\n <div class=\"row\" (keyup.enter)=\"list.get()\">\n <div class=\"col-md-6 col-lg-3\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{ 'AbpIdentity::SecurityLogs:StartTime' | abpLocalization }}</label>\n <input\n #startDate=\"ngbDatepicker\"\n class=\"form-control\"\n name=\"start-date\"\n readonly\n [(ngModel)]=\"filter.startTime\"\n [dayTemplate]=\"startDateTemplate\"\n ngbDatepicker\n (click)=\"startDate.toggle()\"\n />\n <ng-template\n #startDateTemplate\n let-date\n let-focused=\"focused\"\n let-selected=\"selected\"\n let-currentMonth=\"currentMonth\"\n >\n <div\n class=\"btn-light custom-day\"\n [class.bg-primary]=\"selected\"\n [class.text-white]=\"selected\"\n [class.text-muted]=\"currentMonth !== date.month\"\n [class.ng-range]=\"date.after(filter.startTime) && date.before(filter.endTime)\"\n [class.ng-range-end]=\"date.equals(filter.endTime)\"\n >\n {{ date.day }}\n </div>\n </ng-template>\n </div>\n </div>\n\n <div class=\"col-md-6 col-lg-3\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{ 'AbpIdentity::SecurityLogs:EndTime' | abpLocalization }}</label>\n <input\n #endDate=\"ngbDatepicker\"\n class=\"form-control\"\n name=\"end-date\"\n readonly\n [(ngModel)]=\"filter.endTime\"\n [dayTemplate]=\"endDateTemplate\"\n ngbDatepicker\n (click)=\"endDate.toggle()\"\n />\n <ng-template\n #endDateTemplate\n let-date\n let-focused=\"focused\"\n let-selected=\"selected\"\n let-currentMonth=\"currentMonth\"\n >\n <div\n class=\"btn-light custom-day\"\n [class.bg-primary]=\"selected\"\n [class.text-white]=\"selected\"\n [class.text-muted]=\"currentMonth !== date.month\"\n [class.ng-range]=\"date.after(filter.startTime) && date.before(filter.endTime)\"\n [class.ng-range-end]=\"date.equals(filter.startTime)\"\n >\n {{ date.day }}\n </div>\n </ng-template>\n </div>\n </div>\n\n <div class=\"col-md-6 col-lg-3\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{ 'AbpIdentity::SecurityLogs:Application' | abpLocalization }}</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filter.applicationName\" />\n </div>\n </div>\n\n <div class=\"col-md-6 col-lg-3\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{ 'AbpIdentity::SecurityLogs:Identity' | abpLocalization }}</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filter.identity\" />\n </div>\n </div>\n\n <div class=\"col-md-6 col-lg-3\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{ 'AbpIdentity::SecurityLogs:UserName' | abpLocalization }}</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filter.userName\" />\n </div>\n </div>\n\n <div class=\"col-md-6 col-lg-3\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{ 'AbpIdentity::SecurityLogs:Action' | abpLocalization }}</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filter.action\" />\n </div>\n </div>\n\n <div class=\"col-md-6 col-lg-3\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{ 'AbpIdentity::SecurityLogs:Client' | abpLocalization }}</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filter.clientId\" />\n </div>\n </div>\n\n <div class=\"col-md-6 col-lg-3\">\n <div class=\"mb-3\">\n <label class=\"form-label\">{{ 'AbpIdentity::SecurityLogs:CorrelationId' | abpLocalization }}</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filter.correlationId\" />\n </div>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-md-6 col-lg-3 d-grid\">\n <button (click)=\"list.get()\" class=\"mt-md-2 mb-md-2 btn btn-primary\">\n <i class=\"fas fa-search\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n <div class=\"card\">\n <div class=\"card-body p-0\">\n <abp-extensible-table\n [data]=\"data.items\"\n [recordsTotal]=\"data.totalCount\"\n [list]=\"list\"\n ></abp-extensible-table>\n </div>\n </div>\n </abp-page>\n</div>\n", components: [{ type: i4$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { type: i6$1.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], exportAs: ["abpExtensibleTable"] }], directives: [{ type: i8.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["disabled", "autoClose", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "restoreFocus", "showWeekdays", "showWeekNumbers", "startDate", "container", "positionTarget"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { 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]" }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "abpLocalization": i1.LocalizationPipe } });
810
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: SecurityLogsComponent, decorators: [{
811
- type: Component,
812
- args: [{
813
- selector: 'abp-security-logs',
814
- templateUrl: './security-logs.component.html',
815
- providers: [
816
- ListService,
817
- {
818
- provide: EXTENSIONS_IDENTIFIER,
819
- useValue: "Identity.SecurityLogs" /* SecurityLogs */,
820
- },
821
- { provide: NgbDateAdapter, useClass: DateAdapter },
822
- ],
823
- }]
824
- }], ctorParameters: function () { return [{ type: i1.ListService }, { type: i3.IdentitySecurityLogService }]; } });
825
-
826
- var eIdentityTwoFactorBehaviour;
827
- (function (eIdentityTwoFactorBehaviour) {
828
- eIdentityTwoFactorBehaviour[eIdentityTwoFactorBehaviour["Optional"] = 0] = "Optional";
829
- eIdentityTwoFactorBehaviour[eIdentityTwoFactorBehaviour["Disabled"] = 1] = "Disabled";
830
- eIdentityTwoFactorBehaviour[eIdentityTwoFactorBehaviour["Forced"] = 2] = "Forced";
831
- })(eIdentityTwoFactorBehaviour || (eIdentityTwoFactorBehaviour = {}));
832
- const identityTwoFactorBehaviourOptions = mapEnumToOptions(eIdentityTwoFactorBehaviour);
833
-
834
- class UsersComponent {
835
- constructor(list, confirmationService, service, fb, toasterService, injector, configState, roleService, organizationUnitService) {
836
- this.list = list;
837
- this.confirmationService = confirmationService;
838
- this.service = service;
839
- this.fb = fb;
840
- this.toasterService = toasterService;
841
- this.injector = injector;
842
- this.configState = configState;
843
- this.roleService = roleService;
844
- this.organizationUnitService = organizationUnitService;
845
- this.data = { items: [], totalCount: 0 };
846
- this.setPasswordForm = this.fb.group({
847
- newPassword: ['', [Validators.required, ...getPasswordValidators(this.injector)]],
848
- });
849
- this.visiblePermissions = false;
850
- this.modalBusy = false;
851
- this.visibleClaims = false;
852
- this.claimSubject = {};
853
- this.filters = {};
854
- this.organization = {
855
- response: {},
856
- nodes: [],
857
- checkedKeys: [],
858
- expandedKeys: [],
859
- selectFn: () => false,
860
- };
861
- this.twoFactor = {
862
- isModalVisible: false,
863
- checkboxValue: false,
864
- isOptional: false,
865
- };
866
- this.lockForm = this.fb.group({
867
- lockoutEnd: [new Date(), [Validators.required]],
868
- });
869
- this.dateTimePickerProps = {
870
- defaultValue: new Date(),
871
- displayName: 'AbpIdentity::DisplayName:LockoutEnd',
872
- validators: () => [Validators.required],
873
- name: 'lockoutEnd',
874
- id: 'lockout-end',
875
- type: "dateTime" /* DateTime */,
876
- };
877
- this.trackByFn = (index, item) => Object.keys(item)[0] || index;
878
- this.onVisiblePermissionChange = (value) => {
879
- this.visiblePermissions = value;
880
- };
881
- }
882
- get roleGroups() {
883
- var _a;
884
- return ((_a = this.form.get('roleNames')) === null || _a === void 0 ? void 0 : _a.controls) || [];
885
- }
886
- ngOnInit() {
887
- const { key } = identityTwoFactorBehaviourOptions[0];
888
- this.twoFactor.isOptional =
889
- this.configState.getFeature('Identity.TwoFactor') === key &&
890
- this.configState.getSetting('Abp.Identity.TwoFactor.Behaviour') === key;
891
- this.hookToQuery();
892
- }
893
- clearFilters() {
894
- this.filters = {};
895
- }
896
- hookToQuery() {
897
- this.list
898
- .hookToQuery(query => this.service.getList(Object.assign(Object.assign({}, query), this.filters)))
899
- .subscribe(res => (this.data = res));
900
- }
901
- buildForm() {
902
- const data = new FormPropData(this.injector, this.selected);
903
- this.form = generateFormFromProps(data);
904
- this.service.getAssignableRoles().subscribe(({ items }) => {
905
- this.roles = items;
906
- this.form.addControl('roleNames', this.fb.array(this.roles.map(role => {
907
- var _a;
908
- return this.fb.group({
909
- [role.name]: [
910
- this.selected.id
911
- ? !!((_a = this.selectedUserRoles) === null || _a === void 0 ? void 0 : _a.find(userRole => userRole.id === role.id))
912
- : role.isDefault,
913
- ],
914
- });
915
- })));
916
- });
917
- this.service.getAvailableOrganizationUnits().subscribe(res => {
918
- this.organization.response = res;
919
- this.organization.nodes = new TreeAdapter(res.items).getTree();
920
- this.organization.expandedKeys = res.items.map(item => item.id);
921
- this.organization.checkedKeys = this.selectedOrganizationUnits.map(unit => unit.id);
922
- });
923
- }
924
- openModal() {
925
- this.buildForm();
926
- this.isModalVisible = true;
927
- }
928
- onAdd() {
929
- this.selected = {};
930
- this.selectedUserRoles = [];
931
- this.selectedOrganizationUnits = [];
932
- this.openModal();
933
- }
934
- onEdit(id) {
935
- this.service
936
- .get(id)
937
- .pipe(tap(selectedUser => (this.selected = selectedUser)), switchMap(() => this.service.getRoles(id)), tap(res => (this.selectedUserRoles = res.items || [])), switchMap(() => this.service.getOrganizationUnits(id)), tap(res => (this.selectedOrganizationUnits = res)), take(1))
938
- .subscribe(() => this.openModal());
939
- }
940
- save() {
941
- var _a;
942
- if (!this.form.valid)
943
- return;
944
- this.modalBusy = true;
945
- const { roleNames } = this.form.value;
946
- const mappedRoleNames = ((_a = roleNames === null || roleNames === void 0 ? void 0 : roleNames.filter(role => !!role[Object.keys(role)[0]])) === null || _a === void 0 ? void 0 : _a.map(role => Object.keys(role)[0])) ||
947
- [];
948
- const { id } = this.selected;
949
- (id
950
- ? this.service.update(id, Object.assign(Object.assign(Object.assign({}, this.selected), this.form.value), { roleNames: mappedRoleNames, organizationUnitIds: this.organization.checkedKeys }))
951
- : this.service.create(Object.assign(Object.assign({}, this.form.value), { roleNames: mappedRoleNames, organizationUnitIds: this.organization.checkedKeys })))
952
- .pipe(finalize(() => (this.modalBusy = false)))
953
- .subscribe(() => {
954
- this.list.get();
955
- this.isModalVisible = false;
956
- });
957
- }
958
- delete(id, userName) {
959
- this.confirmationService
960
- .warn('AbpIdentity::UserDeletionConfirmationMessage', 'AbpIdentity::AreYouSure', {
961
- messageLocalizationParams: [userName],
962
- })
963
- .subscribe((status) => {
964
- if (status === Confirmation.Status.confirm) {
965
- this.service.delete(id).subscribe(() => this.list.get());
966
- }
967
- });
968
- }
969
- onManageClaims(id) {
970
- this.claimSubject = {
971
- id,
972
- type: 'users',
973
- };
974
- this.visibleClaims = true;
975
- }
976
- unlock(id) {
977
- this.service.unlock(id).subscribe(() => {
978
- this.toasterService.success('AbpIdentity::UserUnlocked');
979
- this.list.get();
980
- });
981
- }
982
- openPermissionsModal(providerKey) {
983
- this.providerKey = providerKey;
984
- setTimeout(() => {
985
- this.visiblePermissions = true;
986
- }, 0);
987
- }
988
- setPassword() {
989
- if (this.setPasswordForm.invalid)
990
- return;
991
- this.modalBusy = true;
992
- this.service
993
- .updatePassword(this.selected.id, this.setPasswordForm.value)
994
- .pipe(finalize(() => (this.modalBusy = false)))
995
- .subscribe(() => {
996
- this.isSetPasswordModalVisible = false;
997
- this.selected = {};
998
- this.setPasswordForm.reset();
999
- });
1000
- }
1001
- generatePassword() {
1002
- this.setPasswordForm.get('newPassword').setValue(generatePassword());
1003
- }
1004
- lock() {
1005
- const { lockoutEnd } = this.lockForm.value;
1006
- this.modalBusy = true;
1007
- this.service
1008
- .lock(this.selected.id, lockoutEnd)
1009
- .pipe(finalize(() => (this.modalBusy = false)))
1010
- .subscribe(() => {
1011
- this.isLockModalVisible = false;
1012
- this.lockForm.reset({
1013
- lockoutEnd: new Date(),
1014
- });
1015
- this.list.get();
1016
- });
1017
- }
1018
- setTwoFactor() {
1019
- this.modalBusy = true;
1020
- this.service
1021
- .setTwoFactorEnabled(this.selected.id, this.twoFactor.checkboxValue)
1022
- .pipe(finalize(() => (this.modalBusy = false)))
1023
- .subscribe(() => (this.twoFactor.isModalVisible = false));
1024
- }
1025
- }
1026
- UsersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: UsersComponent, deps: [{ token: i1.ListService }, { token: i2.ConfirmationService }, { token: i3.IdentityUserService }, { token: i4.FormBuilder }, { token: i2.ToasterService }, { token: i0.Injector }, { token: i1.ConfigStateService }, { token: i3.IdentityRoleService }, { token: i3.OrganizationUnitService }], target: i0.ɵɵFactoryTarget.Component });
1027
- UsersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.0", type: UsersComponent, selector: "abp-users", providers: [
1028
- ListService,
1029
- {
1030
- provide: EXTENSIONS_IDENTIFIER,
1031
- useValue: "Identity.UsersComponent" /* Users */,
1032
- },
1033
- ], viewQueries: [{ propertyName: "modalContent", first: true, predicate: ["modalContent"], descendants: true }], ngImport: i0, template: "<abp-page [title]=\"'AbpIdentity::Users' | abpLocalization\" [toolbar]=\"data.items\">\n <div id=\"identity-users-wrapper\">\n <abp-advanced-entity-filters [list]=\"list\" localizationSourceName=\"AbpIdentity\">\n <abp-advanced-entity-filters-form>\n <form #filterForm (keyup.enter)=\"list.get()\">\n <div class=\"row\">\n <div class=\"col-12 col-sm-3\">\n <div class=\"mb-3\">\n <label for=\"roleIdFilter\" class=\"form-label\">\n {{ 'AbpIdentity::Role' | abpLocalization }}\n </label>\n <abp-lookup-select\n cid=\"roleIdFilter\"\n lookupNameProp=\"name\"\n [getFn]=\"roleService.getList\"\n [(ngModel)]=\"filters.roleId\"\n [ngModelOptions]=\"{ standalone: true }\"\n ></abp-lookup-select>\n </div>\n </div>\n\n <div class=\"col-12 col-sm-3\">\n <div class=\"mb-3\">\n <label for=\"organizationUnitIdFilter\" class=\"form-label\">\n {{ 'AbpIdentity::OrganizationUnit' | abpLocalization }}\n </label>\n <abp-lookup-select\n cid=\"organizationUnitIdFilter\"\n [getFn]=\"organizationUnitService.getList\"\n [(ngModel)]=\"filters.organizationUnitId\"\n [ngModelOptions]=\"{ standalone: true }\"\n ></abp-lookup-select>\n </div>\n </div>\n\n <div class=\"col-12 col-sm-3\">\n <div class=\"form-group mb-3\">\n <label for=\"UserName\" class=\"form-label\">\n {{ 'AbpIdentity::UserName' | abpLocalization }}\n </label>\n <input\n type=\"text\"\n id=\"UserName\"\n class=\"form-control\"\n [(ngModel)]=\"filters.userName\"\n [ngModelOptions]=\"{ standalone: true }\"\n />\n </div>\n </div>\n\n <div class=\"col-12 col-sm-3\">\n <div class=\"form-group mb-3\">\n <label for=\"PhoneNumber\" class=\"form-label\">\n {{ 'AbpIdentity::PhoneNumber' | abpLocalization }}\n </label>\n <input\n type=\"text\"\n id=\"PhoneNumber\"\n class=\"form-control\"\n [(ngModel)]=\"filters.phoneNumber\"\n [ngModelOptions]=\"{ standalone: true }\"\n />\n </div>\n </div>\n\n <div class=\"col-12 col-sm-3\">\n <div class=\"form-group mb-3\">\n <label for=\"EmailAddress\" class=\"form-label\">\n {{ 'AbpIdentity::EmailAddress' | abpLocalization }}\n </label>\n <input\n type=\"text\"\n id=\"EmailAddress\"\n class=\"form-control\"\n [(ngModel)]=\"filters.emailAddress\"\n [ngModelOptions]=\"{ standalone: true }\"\n />\n </div>\n </div>\n\n <div class=\"d-flex col-3\">\n <div class=\"align-self-center\">\n <div class=\"form-check\">\n <input\n class=\"form-check-input\"\n type=\"checkbox\"\n id=\"is-locked-out\"\n [(ngModel)]=\"filters.isLockedOut\"\n [ngModelOptions]=\"{ standalone: true }\"\n />\n <label class=\"form-check-label\" for=\"is-locked-out\">{{\n 'AbpIdentity::Lock' | abpLocalization\n }}</label>\n </div>\n </div>\n <div class=\"align-self-center ms-3\">\n <div class=\"form-check\">\n <input\n class=\"form-check-input\"\n type=\"checkbox\"\n id=\"not-active\"\n [(ngModel)]=\"filters.notActive\"\n [ngModelOptions]=\"{ standalone: true }\"\n />\n <label class=\"form-check-label\" for=\"not-active\">{{\n 'AbpIdentity::NotActive' | abpLocalization\n }}</label>\n </div>\n </div>\n </div>\n\n <div class=\"col-12 col-sm-auto align-self-end mb-3\">\n <div class=\"row\">\n <div class=\"col-6 col-sm-auto d-grid\">\n <button type=\"button\" class=\"btn btn-outline-primary\" (click)=\"clearFilters()\">\n <span>{{ 'AbpUi::Clear' | abpLocalization }}</span>\n </button>\n </div>\n <div class=\"col-6 col-sm-auto d-grid\">\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"list.get()\">\n <span>{{ 'AbpUi::Refresh' | abpLocalization }}</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </form>\n </abp-advanced-entity-filters-form>\n </abp-advanced-entity-filters>\n\n <div class=\"card\">\n <abp-extensible-table\n [data]=\"data.items\"\n [recordsTotal]=\"data.totalCount\"\n [list]=\"list\"\n ></abp-extensible-table>\n </div>\n </div>\n</abp-page>\n\n<abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\" (disappear)=\"form = null\">\n <ng-template #abpHeader>\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewUser') | abpLocalization }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <form *ngIf=\"form\" [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\n <ul id=\"user-nav-tabs\" ngbNav #nav=\"ngbNav\" class=\"nav-tabs\">\n <li id=\"user-informations\" ngbNavItem>\n <a ngbNavLink>{{ 'AbpIdentity::UserInformations' | abpLocalization }}</a>\n <ng-template ngbNavContent\n ><abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form\n ></ng-template>\n </li>\n <li id=\"user-roles\" ngbNavItem>\n <a ngbNavLink>{{ 'AbpIdentity::Roles' | abpLocalization }}</a>\n <ng-template ngbNavContent>\n <div\n *ngFor=\"let roleGroup of roleGroups; let i = index; trackBy: trackByFn\"\n class=\"form-check mb-2\"\n >\n <input\n type=\"checkbox\"\n class=\"form-check-input\"\n [attr.id]=\"'roles-' + i\"\n [formControl]=\"roleGroup.controls[roles[i].name]\"\n />\n <label class=\"form-check-label\" [attr.for]=\"'roles-' + i\">{{ roles[i].name }}</label>\n </div></ng-template\n >\n </li>\n <li id=\"user-organization-units\" ngbNavItem>\n <a ngbNavLink>{{ 'AbpIdentity::OrganizationUnits' | abpLocalization }}</a>\n <ng-template ngbNavContent>\n <abp-tree\n *ngIf=\"organization.nodes?.length; else noDataMessage\"\n [checkStrictly]=\"true\"\n [checkable]=\"true\"\n [nodes]=\"organization.nodes\"\n [isNodeSelected]=\"organization.selectFn\"\n [(checkedKeys)]=\"organization.checkedKeys\"\n [(expandedKeys)]=\"organization.expandedKeys\"\n ></abp-tree>\n\n <ng-template #noDataMessage>\n <p class=\"text-muted\">\n {{ 'AbpIdentity::NoOrganizationUnits' | abpLocalization }}\n </p>\n </ng-template>\n </ng-template>\n </li>\n </ul>\n <div [ngbNavOutlet]=\"nav\" class=\"mt-2 fade-in-top\"></div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\n </button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"save()\" [disabled]=\"form?.invalid\">{{\n 'AbpIdentity::Save' | abpLocalization\n }}</abp-button>\n </ng-template>\n</abp-modal>\n\n<abp-permission-management\n *abpReplaceableTemplate=\"{\n inputs: {\n providerName: { value: 'U' },\n providerKey: { value: providerKey },\n hideBadges: { value: true },\n visible: { value: visiblePermissions, twoWay: true }\n },\n outputs: { visibleChange: onVisiblePermissionChange },\n componentKey: 'PermissionManagement.PermissionManagementComponent'\n }\"\n [(visible)]=\"visiblePermissions\"\n [providerKey]=\"providerKey\"\n [hideBadges]=\"true\"\n providerName=\"U\"\n>\n</abp-permission-management>\n\n<abp-claim-modal [(visible)]=\"visibleClaims\" [subject]=\"claimSubject\"></abp-claim-modal>\n\n<abp-modal [(visible)]=\"isSetPasswordModalVisible\" [busy]=\"modalBusy\">\n <ng-template #abpHeader>\n <h3>{{ 'AbpIdentity::SetPassword' | abpLocalization }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <form [formGroup]=\"setPasswordForm\" (ngSubmit)=\"setPassword()\" validateOnSubmit>\n <div class=\"mt-2 fade-in-top\">\n <div class=\"mb-3\">\n <label class=\"form-label\" for=\"new-password\">{{\n 'AbpIdentity::Password' | abpLocalization\n }}</label>\n <div class=\"input-group\">\n <div class=\"col-10 p-0\">\n <input\n type=\"text\"\n id=\"new-password\"\n class=\"form-control\"\n formControlName=\"newPassword\"\n autofocus\n />\n </div>\n\n <button\n class=\"btn btn-secondary\"\n id=\"generate-random-password-button\"\n type=\"button\"\n (click)=\"generatePassword()\"\n >\n <i class=\"fa fa-refresh\"></i>\n </button>\n </div>\n </div>\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\n </button>\n <abp-button\n iconClass=\"fa fa-check\"\n (click)=\"setPassword()\"\n [disabled]=\"setPasswordForm?.invalid\"\n >{{ 'AbpIdentity::Save' | abpLocalization }}</abp-button\n >\n </ng-template>\n</abp-modal>\n\n<abp-modal [(visible)]=\"isLockModalVisible\" [busy]=\"modalBusy\">\n <ng-template #abpHeader>\n <h3>{{ 'AbpIdentity::Lock' | abpLocalization }} - {{ selected.userName }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <form [formGroup]=\"lockForm\" (ngSubmit)=\"lock()\" validateOnSubmit>\n <div class=\"mt-2 fade-in-top\">\n <div class=\"mb-3\" [formGroup]=\"lockForm\">\n <abp-date-time-picker [prop]=\"dateTimePickerProps\"></abp-date-time-picker>\n </div>\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\n </button>\n <abp-button\n iconClass=\"fa fa-check\"\n (click)=\"lock()\"\n [disabled]=\"lockForm?.invalid || modalBusy\"\n >{{ 'AbpIdentity::Save' | abpLocalization }}</abp-button\n >\n </ng-template>\n</abp-modal>\n\n<abp-modal [(visible)]=\"twoFactor.isModalVisible\" [busy]=\"modalBusy\">\n <ng-template #abpHeader>\n <h3>{{ 'AbpIdentity::TwoFactor' | abpLocalization }} - {{ selected.userName }}</h3>\n </ng-template>\n\n <ng-template #abpBody>\n <div class=\"mt-2 fade-in-top\">\n <div class=\"form-check mb-2\">\n <input\n type=\"checkbox\"\n class=\"form-check-input\"\n id=\"two-factor-enabled\"\n [(ngModel)]=\"twoFactor.checkboxValue\"\n />\n <label class=\"form-check-label\" for=\"two-factor-enabled\">{{\n 'AbpIdentity::DisplayName:TwoFactorEnabled' | abpLocalization\n }}</label>\n </div>\n </div>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\n </button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"setTwoFactor()\" [disabled]=\"modalBusy\">{{\n 'AbpIdentity::Save' | abpLocalization\n }}</abp-button>\n </ng-template>\n</abp-modal>\n", styles: ["\n .mh-35 {\n max-height: 35px;\n }\n "], components: [{ type: i4$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { type: i6.AdvancedEntityFiltersComponent, selector: "abp-advanced-entity-filters", inputs: ["list", "localizationSourceName", "entityFilterPlaceholder"] }, { type: i6.AdvancedEntityFiltersFormComponent, selector: "abp-advanced-entity-filters-form" }, { type: i6.LookupSelectComponent, selector: "abp-lookup-select", inputs: ["maxResultCount"] }, { type: i6$1.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], exportAs: ["abpExtensibleTable"] }, { type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { type: i6$1.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { type: i5$1.TreeComponent, selector: "abp-tree", inputs: ["noAnimation", "draggable", "checkable", "checkStrictly", "checkedKeys", "nodes", "expandedKeys", "selectedNode", "isNodeSelected", "beforeDrop"], outputs: ["checkedKeysChange", "expandedKeysChange", "selectedNodeChange", "dropOver"] }, { type: i8.NgbNavOutlet, selector: "[ngbNavOutlet]", inputs: ["paneRole", "ngbNavOutlet"] }, { type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { type: i7.PermissionManagementComponent, selector: "abp-permission-management", inputs: ["providerName", "providerKey", "hideBadges", "visible"], outputs: ["visibleChange"], exportAs: ["abpPermissionManagement"] }, { type: ClaimModalComponent, selector: "abp-claim-modal", inputs: ["subject", "visible"], outputs: ["visibleChange"] }, { type: i6$1.DateTimePickerComponent, selector: "abp-date-time-picker", inputs: ["prop", "meridian"], exportAs: ["abpDateTimePicker"] }], directives: [{ type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { 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]" }, { type: i4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i13.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", inputs: ["blueprints", "errorTemplate", "invalidClasses", "mapErrorsFn", "skipValidation", "targetSelector", "validateOnSubmit"] }, { type: i8.NgbNav, selector: "[ngbNav]", inputs: ["destroyOnHide", "orientation", "roles", "keyboard", "activeId"], outputs: ["activeIdChange", "navChange"], exportAs: ["ngbNav"] }, { type: i8.NgbNavItem, selector: "[ngbNavItem]", inputs: ["disabled", "domId", "destroyOnHide", "ngbNavItem"], exportAs: ["ngbNavItem"] }, { type: i8.NgbNavLink, selector: "a[ngbNavLink]" }, { type: i8.NgbNavContent, selector: "ng-template[ngbNavContent]" }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i13.ValidationDirective, selector: "[formControl],[formControlName]", inputs: ["blueprints", "errorTemplate", "invalidClasses", "mapErrorsFn", "skipValidation", "targetSelector", "validateOnSubmit"] }, { type: i2.ModalCloseDirective, selector: "[abpClose]" }, { type: i1.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }, { type: i4.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i1.AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }], pipes: { "abpLocalization": i1.LocalizationPipe } });
1034
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: UsersComponent, decorators: [{
1035
- type: Component,
1036
- args: [{
1037
- selector: 'abp-users',
1038
- templateUrl: './users.component.html',
1039
- providers: [
1040
- ListService,
1041
- {
1042
- provide: EXTENSIONS_IDENTIFIER,
1043
- useValue: "Identity.UsersComponent" /* Users */,
1044
- },
1045
- ],
1046
- styles: [
1047
- `
1048
- .mh-35 {
1049
- max-height: 35px;
1050
- }
1051
- `,
1052
- ],
1053
- }]
1054
- }], ctorParameters: function () { return [{ type: i1.ListService }, { type: i2.ConfirmationService }, { type: i3.IdentityUserService }, { type: i4.FormBuilder }, { type: i2.ToasterService }, { type: i0.Injector }, { type: i1.ConfigStateService }, { type: i3.IdentityRoleService }, { type: i3.OrganizationUnitService }]; }, propDecorators: { modalContent: [{
1055
- type: ViewChild,
1056
- args: ['modalContent']
1057
- }] } });
1058
-
1059
- const DEFAULT_CLAIMS_ENTITY_ACTIONS = EntityAction.createMany([
1060
- {
1061
- text: 'AbpIdentity::Edit',
1062
- action: data => {
1063
- const component = data.getInjected(ClaimsComponent);
1064
- component.onEdit(data.record.id);
1065
- },
1066
- permission: 'AbpIdentity.ClaimTypes.Update',
1067
- visible: data => !data.record.isStatic,
1068
- },
1069
- {
1070
- text: 'AbpIdentity::Delete',
1071
- action: data => {
1072
- const component = data.getInjected(ClaimsComponent);
1073
- component.delete(data.record.id, data.record.name);
1074
- },
1075
- permission: 'AbpIdentity.ClaimTypes.Delete',
1076
- },
1077
- ]);
1078
-
1079
- const DEFAULT_CLAIMS_ENTITY_PROPS = EntityProp.createMany([
1080
- {
1081
- type: "string" /* String */,
1082
- name: 'name',
1083
- displayName: 'AbpIdentity::Name',
1084
- sortable: true,
1085
- columnWidth: 250,
1086
- },
1087
- {
1088
- type: "string" /* String */,
1089
- name: 'valueType',
1090
- displayName: 'AbpIdentity::ValueType',
1091
- sortable: true,
1092
- columnWidth: 200,
1093
- valueResolver: data => of(data.getInjected(ClaimsComponent).getTypeName(data.record.valueType)),
1094
- },
1095
- {
1096
- type: "string" /* String */,
1097
- name: 'description',
1098
- displayName: 'AbpIdentity::Description',
1099
- sortable: true,
1100
- columnWidth: 250,
1101
- },
1102
- {
1103
- type: "string" /* String */,
1104
- name: 'regex',
1105
- displayName: 'AbpIdentity::Regex',
1106
- sortable: true,
1107
- columnWidth: 200,
1108
- },
1109
- {
1110
- type: "boolean" /* Boolean */,
1111
- name: 'required',
1112
- displayName: 'AbpIdentity::Required',
1113
- sortable: true,
1114
- columnWidth: 150,
1115
- },
1116
- {
1117
- type: "boolean" /* Boolean */,
1118
- name: 'isStatic',
1119
- displayName: 'AbpIdentity::IsStatic',
1120
- sortable: true,
1121
- columnWidth: 150,
1122
- },
1123
- ]);
1124
-
1125
- const DEFAULT_CLAIMS_CREATE_FORM_PROPS = FormProp.createMany([
1126
- {
1127
- type: "string" /* String */,
1128
- name: 'name',
1129
- displayName: 'AbpIdentity::Name',
1130
- id: 'name',
1131
- validators: () => [Validators.required, Validators.maxLength(256)],
1132
- },
1133
- {
1134
- type: "boolean" /* Boolean */,
1135
- name: 'required',
1136
- displayName: 'AbpIdentity::Required',
1137
- id: 'required',
1138
- defaultValue: false,
1139
- },
1140
- {
1141
- type: "string" /* String */,
1142
- name: 'regex',
1143
- displayName: 'AbpIdentity::Regex',
1144
- id: 'regex',
1145
- },
1146
- {
1147
- type: "string" /* String */,
1148
- name: 'regexDescription',
1149
- displayName: 'AbpIdentity::RegexDescription',
1150
- id: 'regex-description',
1151
- },
1152
- {
1153
- type: "string" /* String */,
1154
- name: 'description',
1155
- displayName: 'AbpIdentity::Description',
1156
- id: 'description',
1157
- },
1158
- {
1159
- type: "number" /* Number */,
1160
- name: 'valueType',
1161
- displayName: 'AbpIdentity::ValueType',
1162
- id: 'value-type',
1163
- defaultValue: 0,
1164
- options: () => of([
1165
- { key: 'String', value: 0 },
1166
- { key: 'Int', value: 1 },
1167
- { key: 'Boolean', value: 2 },
1168
- { key: 'DateTime', value: 3 },
1169
- ]),
1170
- },
1171
- ]);
1172
- const DEFAULT_CLAIMS_EDIT_FORM_PROPS = DEFAULT_CLAIMS_CREATE_FORM_PROPS;
1173
-
1174
- const DEFAULT_CLAIMS_TOOLBAR_ACTIONS = ToolbarAction.createMany([
1175
- {
1176
- text: 'AbpIdentity::NewClaimType',
1177
- action: data => {
1178
- const component = data.getInjected(ClaimsComponent);
1179
- component.onAdd();
1180
- },
1181
- permission: 'AbpIdentity.ClaimTypes.Create',
1182
- icon: 'fa fa-plus',
1183
- },
1184
- ]);
1185
-
1186
- /* tslint:disable:max-line-length */
1187
- const DEFAULT_ORGANIZATION_MEMBERS_ENTITY_ACTIONS = EntityAction.createMany([
1188
- {
1189
- text: 'AbpIdentity::Delete',
1190
- action: data => {
1191
- const component = data.getInjected(OrganizationMembersComponent);
1192
- component.delete(data.record.id, data.record.name);
1193
- },
1194
- permission: 'AbpIdentity.OrganizationUnits.ManageMembers',
1195
- },
1196
- ]);
1197
-
1198
- const DEFAULT_ORGANIZATION_MEMBERS_ENTITY_PROPS = EntityProp.createMany([
1199
- {
1200
- type: "string" /* String */,
1201
- name: 'userName',
1202
- displayName: 'AbpIdentity::UserName',
1203
- sortable: true,
1204
- columnWidth: 180,
1205
- },
1206
- {
1207
- type: "string" /* String */,
1208
- name: 'email',
1209
- displayName: 'AbpIdentity::EmailAddress',
1210
- sortable: true,
1211
- columnWidth: 200,
1212
- valueResolver: data => {
1213
- const { email, emailConfirmed } = data.record;
1214
- return of((email || '') + (emailConfirmed ? `<i class="fa fa-check text-success ms-1"></i>` : ''));
1215
- },
1216
- },
1217
- ]);
1218
-
1219
- /* tslint:disable:max-line-length */
1220
- const DEFAULT_ORGANIZATION_ROLES_ENTITY_ACTIONS = EntityAction.createMany([
1221
- {
1222
- text: 'AbpIdentity::Delete',
1223
- action: data => {
1224
- const component = data.getInjected(OrganizationRolesComponent);
1225
- component.delete(data.record.id, data.record.name);
1226
- },
1227
- permission: 'AbpIdentity.OrganizationUnits.ManageRoles',
1228
- },
1229
- ]);
1230
-
1231
- const DEFAULT_ORGANIZATION_ROLES_ENTITY_PROPS = EntityProp.createMany([
1232
- {
1233
- type: "string" /* String */,
1234
- name: 'name',
1235
- displayName: 'AbpIdentity::RoleName',
1236
- sortable: true,
1237
- },
1238
- ]);
1239
-
1240
- const DEFAULT_ORGANIZATION_UNITS_CREATE_FORM_PROPS = FormProp.createMany([
1241
- {
1242
- type: "string" /* String */,
1243
- name: 'displayName',
1244
- displayName: 'AbpIdentity::DisplayName',
1245
- id: 'organization-unit-display-name',
1246
- validators: () => [Validators.required, Validators.maxLength(256)],
1247
- },
1248
- ]);
1249
- const DEFAULT_ORGANIZATION_UNITS_EDIT_FORM_PROPS = DEFAULT_ORGANIZATION_UNITS_CREATE_FORM_PROPS;
1250
-
1251
- const DEFAULT_ORGANIZATION_UNITS_TOOLBAR_ACTIONS = ToolbarAction.createMany([]);
1252
-
1253
- const DEFAULT_ROLES_ENTITY_ACTIONS = EntityAction.createMany([
1254
- {
1255
- text: 'AbpIdentity::Edit',
1256
- action: data => {
1257
- const component = data.getInjected(RolesComponent);
1258
- component.onEdit(data.record.id);
1259
- },
1260
- permission: 'AbpIdentity.Roles.Update',
1261
- },
1262
- {
1263
- text: 'AbpIdentity::Claims',
1264
- action: data => {
1265
- const component = data.getInjected(RolesComponent);
1266
- component.onManageClaims(data.record.id);
1267
- },
1268
- permission: 'AbpIdentity.Roles.Update',
1269
- },
1270
- {
1271
- text: 'AbpIdentity::Permissions',
1272
- action: data => {
1273
- const component = data.getInjected(RolesComponent);
1274
- component.openPermissionsModal(data.record.name);
1275
- },
1276
- permission: 'AbpIdentity.Roles.ManagePermissions',
1277
- },
1278
- {
1279
- text: 'AbpIdentity::ChangeHistory',
1280
- action: data => {
1281
- const showHistory = data.getInjected(SHOW_ENTITY_HISTORY);
1282
- showHistory(data.record.id, 'Volo.Abp.Identity.IdentityRole');
1283
- },
1284
- permission: 'AbpIdentity.Roles.ViewChangeHistory',
1285
- visible: data => Boolean(data.getInjected(SHOW_ENTITY_HISTORY, null)),
1286
- },
1287
- {
1288
- text: 'AbpIdentity::Delete',
1289
- action: data => {
1290
- const component = data.getInjected(RolesComponent);
1291
- component.delete(data.record.id, data.record.name);
1292
- },
1293
- permission: 'AbpIdentity.Roles.Delete',
1294
- visible: data => !data.record.isStatic,
1295
- },
1296
- ]);
1297
-
1298
- const DEFAULT_ROLES_ENTITY_PROPS = EntityProp.createMany([
1299
- {
1300
- type: "string" /* String */,
1301
- name: 'name',
1302
- displayName: 'AbpIdentity::RoleName',
1303
- sortable: true,
1304
- valueResolver: data => {
1305
- const l10n = data.getInjected(LocalizationService);
1306
- const t = l10n.instant.bind(l10n);
1307
- const { isDefault, isPublic, name } = data.record;
1308
- return of(name +
1309
- (isDefault
1310
- ? `<span class="badge rounded-pill bg-success ms-1">${t('AbpIdentity::DisplayName:IsDefault')}</span>`
1311
- : '') +
1312
- (isPublic
1313
- ? `<span class="badge rounded-pill bg-info ms-1">${t('AbpIdentity::DisplayName:IsPublic')}</span>`
1314
- : ''));
1315
- },
1316
- },
1317
- ]);
1318
-
1319
- const DEFAULT_ROLES_CREATE_FORM_PROPS = FormProp.createMany([
1320
- {
1321
- type: "string" /* String */,
1322
- name: 'name',
1323
- displayName: 'AbpIdentity::RoleName',
1324
- id: 'role-name',
1325
- disabled: (data) => data.record && data.record.isStatic,
1326
- validators: () => [Validators.required],
1327
- },
1328
- {
1329
- type: "boolean" /* Boolean */,
1330
- name: 'isDefault',
1331
- displayName: 'AbpIdentity::DisplayName:IsDefault',
1332
- id: 'role-is-default',
1333
- defaultValue: false,
1334
- },
1335
- {
1336
- type: "boolean" /* Boolean */,
1337
- name: 'isPublic',
1338
- displayName: 'AbpIdentity::DisplayName:IsPublic',
1339
- id: 'role-is-public',
1340
- defaultValue: false,
1341
- },
1342
- ]);
1343
- const DEFAULT_ROLES_EDIT_FORM_PROPS = DEFAULT_ROLES_CREATE_FORM_PROPS;
1344
-
1345
- const DEFAULT_ROLES_TOOLBAR_ACTIONS = ToolbarAction.createMany([
1346
- {
1347
- text: 'AbpIdentity::NewRole',
1348
- action: data => {
1349
- const component = data.getInjected(RolesComponent);
1350
- component.onAdd();
1351
- },
1352
- permission: 'AbpIdentity.Roles.Create',
1353
- icon: 'fa fa-plus',
1354
- },
1355
- ]);
1356
-
1357
- const DEFAULT_SECURITY_LOGS_ENTITY_ACTIONS = EntityAction.createMany([]);
1358
-
1359
- const DEFAULT_SECURITY_LOGS_ENTITY_PROPS = EntityProp.createMany([
1360
- {
1361
- type: "string" /* String */,
1362
- name: 'creationTime',
1363
- displayName: 'AbpIdentity::SecurityLogs:Time',
1364
- sortable: true,
1365
- columnWidth: 180,
1366
- valueResolver: data => {
1367
- const config = data.getInjected(ConfigStateService);
1368
- const localeId = data.getInjected(LOCALE_ID);
1369
- return of(formatDate(data.record.creationTime, getShortDateShortTimeFormat(config), localeId));
1370
- },
1371
- },
1372
- {
1373
- type: "string" /* String */,
1374
- name: 'action',
1375
- displayName: 'AbpIdentity::SecurityLogs:Action',
1376
- sortable: true,
1377
- columnWidth: 180,
1378
- valueResolver: data => {
1379
- return of(`<div style="max-width: 160px" class="pointer abp-ellipsis-inline">${data.record.action || ''}</div>`);
1380
- },
1381
- action: data => {
1382
- const component = data.getInjected(SecurityLogsComponent);
1383
- component.filter.action = data.record.action;
1384
- component.list.get();
1385
- },
1386
- },
1387
- {
1388
- type: "string" /* String */,
1389
- name: 'clientIpAddress',
1390
- displayName: 'AbpIdentity::SecurityLogs:IpAddress',
1391
- sortable: false,
1392
- columnWidth: 200,
1393
- valueResolver: data => {
1394
- return of(`<div style="max-width: 180px" class="abp-ellipsis-inline">${data.record.clientIpAddress || ''}</div>`);
1395
- },
1396
- },
1397
- {
1398
- type: "string" /* String */,
1399
- name: 'browserInfo',
1400
- displayName: 'AbpIdentity::SecurityLogs:Browser',
1401
- sortable: false,
1402
- columnWidth: 200,
1403
- valueResolver: data => {
1404
- return of(`<div style="max-width: 180px" class="abp-ellipsis-inline">${data.record.browserInfo || ''}</div>`);
1405
- },
1406
- },
1407
- {
1408
- type: "string" /* String */,
1409
- name: 'applicationName',
1410
- displayName: 'AbpIdentity::SecurityLogs:Application',
1411
- sortable: true,
1412
- columnWidth: 150,
1413
- valueResolver: data => {
1414
- return of(`<div style="max-width: 135px" class="pointer abp-ellipsis-inline">${data.record.applicationName || ''}</div>`);
1415
- },
1416
- action: data => {
1417
- const component = data.getInjected(SecurityLogsComponent);
1418
- component.filter.applicationName = data.record.applicationName;
1419
- component.list.get();
1420
- },
1421
- },
1422
- {
1423
- type: "string" /* String */,
1424
- name: 'identity',
1425
- displayName: 'AbpIdentity::SecurityLogs:Identity',
1426
- sortable: true,
1427
- columnWidth: 150,
1428
- valueResolver: data => {
1429
- return of(`<div style="max-width: 135px" class="pointer abp-ellipsis-inline">${data.record.identity || ''}</div>`);
1430
- },
1431
- action: data => {
1432
- const component = data.getInjected(SecurityLogsComponent);
1433
- component.filter.identity = data.record.identity;
1434
- component.list.get();
1435
- },
1436
- },
1437
- {
1438
- type: "string" /* String */,
1439
- name: 'userName',
1440
- displayName: 'AbpIdentity::SecurityLogs:UserName',
1441
- sortable: true,
1442
- columnWidth: 150,
1443
- valueResolver: data => {
1444
- return of(`<div style="max-width: 135px" class="pointer abp-ellipsis-inline">${data.record.userName || ''}</div>`);
1445
- },
1446
- action: data => {
1447
- const component = data.getInjected(SecurityLogsComponent);
1448
- component.filter.userName = data.record.userName;
1449
- component.list.get();
1450
- },
1451
- },
1452
- {
1453
- type: "string" /* String */,
1454
- name: 'clientId',
1455
- displayName: 'AbpIdentity::SecurityLogs:Client',
1456
- sortable: true,
1457
- columnWidth: 320,
1458
- valueResolver: data => {
1459
- return of(`<div class="pointer">${data.record.clientId || ''}</div>`);
1460
- },
1461
- action: data => {
1462
- const component = data.getInjected(SecurityLogsComponent);
1463
- component.filter.clientId = data.record.clientId;
1464
- component.list.get();
1465
- },
1466
- },
1467
- {
1468
- type: "string" /* String */,
1469
- name: 'correlationId',
1470
- displayName: 'AbpIdentity::SecurityLogs:CorrelationId',
1471
- sortable: true,
1472
- columnWidth: 320,
1473
- valueResolver: data => {
1474
- return of(`<div class="pointer">${data.record.correlationId || ''}</div>`);
1475
- },
1476
- action: data => {
1477
- const component = data.getInjected(SecurityLogsComponent);
1478
- component.filter.correlationId = data.record.correlationId;
1479
- component.list.get();
1480
- },
1481
- },
1482
- ]);
1483
-
1484
- const DEFAULT_SECURITY_LOGS_TOOLBAR_ACTIONS = ToolbarAction.createMany([]);
1485
-
1486
- const DEFAULT_USERS_ENTITY_ACTIONS = EntityAction.createMany([
1487
- {
1488
- text: 'AbpIdentity::Edit',
1489
- action: data => {
1490
- const component = data.getInjected(UsersComponent);
1491
- component.onEdit(data.record.id);
1492
- },
1493
- permission: 'AbpIdentity.Users.Update',
1494
- },
1495
- {
1496
- text: 'AbpIdentity::Claims',
1497
- action: data => {
1498
- const component = data.getInjected(UsersComponent);
1499
- component.onManageClaims(data.record.id);
1500
- },
1501
- permission: 'AbpIdentity.Users.Update',
1502
- },
1503
- {
1504
- text: 'AbpIdentity::Lock',
1505
- action: data => {
1506
- const component = data.getInjected(UsersComponent);
1507
- component.selected = data.record;
1508
- component.isLockModalVisible = true;
1509
- },
1510
- permission: 'AbpIdentity.Users.Update',
1511
- visible: data => !data.record.isLockedOut && data.record.lockoutEnabled,
1512
- },
1513
- {
1514
- text: 'AbpIdentity::Unlock',
1515
- action: data => {
1516
- const component = data.getInjected(UsersComponent);
1517
- component.unlock(data.record.id);
1518
- },
1519
- permission: 'AbpIdentity.Users.Update',
1520
- visible: data => data.record.isLockedOut,
1521
- },
1522
- {
1523
- text: 'AbpIdentity::Permissions',
1524
- action: data => {
1525
- const component = data.getInjected(UsersComponent);
1526
- component.openPermissionsModal(data.record.id);
1527
- },
1528
- permission: 'AbpIdentity.Users.ManagePermissions',
1529
- },
1530
- {
1531
- text: 'AbpIdentity::ChangeHistory',
1532
- action: data => {
1533
- const showHistory = data.getInjected(SHOW_ENTITY_HISTORY);
1534
- showHistory(data.record.id, 'Volo.Abp.Identity.IdentityUser');
1535
- },
1536
- permission: 'AbpIdentity.Users.ViewChangeHistory',
1537
- visible: data => Boolean(data.getInjected(SHOW_ENTITY_HISTORY, null)),
1538
- },
1539
- {
1540
- text: 'AbpIdentity::SetPassword',
1541
- action: data => {
1542
- const component = data.getInjected(UsersComponent);
1543
- component.selected = data.record;
1544
- component.isSetPasswordModalVisible = true;
1545
- },
1546
- permission: 'AbpIdentity.Users.Update',
1547
- },
1548
- {
1549
- text: 'AbpIdentity::TwoFactor',
1550
- action: data => {
1551
- const component = data.getInjected(UsersComponent);
1552
- component.selected = data.record;
1553
- component.service.getTwoFactorEnabled(data.record.id).subscribe(res => {
1554
- component.twoFactor.checkboxValue = res;
1555
- component.twoFactor.isModalVisible = true;
1556
- });
1557
- },
1558
- permission: 'AbpIdentity.Users.Update',
1559
- visible: data => data.getInjected(UsersComponent).twoFactor.isOptional,
1560
- },
1561
- {
1562
- text: 'AbpIdentity::LoginWithThisUser',
1563
- permission: 'AbpIdentity.Users.Impersonation',
1564
- action: data => {
1565
- const impersonation = data.getInjected(ImpersonationService);
1566
- impersonation.impersonateUser(data.record.id).subscribe();
1567
- },
1568
- visible: data => {
1569
- const configState = data.getInjected(ConfigStateService);
1570
- const currentUserId = configState.getDeep('currentUser.id');
1571
- const currentImpersonatorUserId = configState.getDeep('currentUser.impersonatorUserId');
1572
- return data.record.id !== currentUserId && currentImpersonatorUserId === null;
1573
- },
1574
- },
1575
- {
1576
- text: 'AbpIdentity::Delete',
1577
- action: data => {
1578
- const component = data.getInjected(UsersComponent);
1579
- component.delete(data.record.id, data.record.name || data.record.userName);
1580
- },
1581
- permission: 'AbpIdentity.Users.Delete',
1582
- },
1583
- ]);
1584
-
1585
- const DEFAULT_USERS_ENTITY_PROPS = EntityProp.createMany([
1586
- {
1587
- type: "string" /* String */,
1588
- name: 'userName',
1589
- displayName: 'AbpIdentity::UserName',
1590
- sortable: true,
1591
- columnWidth: 250,
1592
- valueResolver: data => {
1593
- const l10n = data.getInjected(LocalizationService);
1594
- const t = l10n.instant.bind(l10n);
1595
- const lockOutIcon = `<i title="${t('AbpIdentity::ThisUserIsLockedOutMessage')}" class="fas fa-lock text-danger me-1"></i>`;
1596
- const inactiveIcon = `<i title="${t('AbpIdentity::ThisUserIsNotActiveMessage')}" class="fas fa-ban text-danger me-1"></i>`;
1597
- return of(`
1598
- ${data.record.isLockedOut ? lockOutIcon : ''}
1599
- ${!data.record.isActive ? inactiveIcon : ''}
1600
- <span class="${data.record.isLockedOut || !data.record.isActive ? 'opc-65' : ''}">${data.record.userName}</span>`);
1601
- },
1602
- },
1603
- {
1604
- type: "string" /* String */,
1605
- name: 'email',
1606
- displayName: 'AbpIdentity::EmailAddress',
1607
- sortable: true,
1608
- columnWidth: 250,
1609
- valueResolver: data => {
1610
- const { email, emailConfirmed } = data.record;
1611
- return of((email || '') + (emailConfirmed ? `<i class="fa fa-check text-success ms-1"></i>` : ''));
1612
- },
1613
- },
1614
- {
1615
- type: "string" /* String */,
1616
- name: 'roleNames',
1617
- displayName: 'AbpIdentity::Roles',
1618
- columnWidth: 250,
1619
- valueResolver: data => of(data.record.roleNames.join(', ')),
1620
- },
1621
- {
1622
- type: "string" /* String */,
1623
- name: 'phoneNumber',
1624
- displayName: 'AbpIdentity::PhoneNumber',
1625
- sortable: true,
1626
- columnWidth: 250,
1627
- valueResolver: data => {
1628
- const { phoneNumber, phoneNumberConfirmed } = data.record;
1629
- return of((phoneNumber || '') +
1630
- (phoneNumberConfirmed ? `<i class="fa fa-check text-success ms-1"></i>` : ''));
1631
- },
1632
- },
1633
- ]);
1634
-
1635
- const DEFAULT_USERS_CREATE_FORM_PROPS = FormProp.createMany([
1636
- {
1637
- type: "string" /* String */,
1638
- name: 'userName',
1639
- displayName: 'AbpIdentity::UserName',
1640
- id: 'user-name',
1641
- validators: () => [Validators.required, Validators.maxLength(256)],
1642
- },
1643
- {
1644
- type: "password" /* Password */,
1645
- name: 'password',
1646
- displayName: 'AbpIdentity::Password',
1647
- id: 'password',
1648
- autocomplete: 'new-password',
1649
- validators: data => [Validators.required, ...getPasswordValidators({ get: data.getInjected })],
1650
- },
1651
- {
1652
- type: "string" /* String */,
1653
- name: 'name',
1654
- displayName: 'AbpIdentity::DisplayName:Name',
1655
- id: 'name',
1656
- validators: () => [Validators.maxLength(64)],
1657
- },
1658
- {
1659
- type: "string" /* String */,
1660
- name: 'surname',
1661
- displayName: 'AbpIdentity::DisplayName:Surname',
1662
- id: 'surname',
1663
- validators: () => [Validators.maxLength(64)],
1664
- },
1665
- {
1666
- type: "email" /* Email */,
1667
- name: 'email',
1668
- displayName: 'AbpIdentity::EmailAddress',
1669
- id: 'email',
1670
- validators: () => [Validators.required, Validators.maxLength(256), Validators.email],
1671
- },
1672
- {
1673
- type: "string" /* String */,
1674
- name: 'phoneNumber',
1675
- displayName: 'AbpIdentity::PhoneNumber',
1676
- id: 'phone-number',
1677
- validators: () => [Validators.maxLength(16)],
1678
- },
1679
- {
1680
- type: "boolean" /* Boolean */,
1681
- name: 'isActive',
1682
- displayName: 'AbpIdentity::DisplayName:IsActive',
1683
- id: 'active-checkbox',
1684
- defaultValue: true,
1685
- },
1686
- {
1687
- type: "boolean" /* Boolean */,
1688
- name: 'lockoutEnabled',
1689
- displayName: 'AbpIdentity::DisplayName:LockoutEnabled',
1690
- id: 'lockout-checkbox',
1691
- defaultValue: true,
1692
- },
1693
- ]);
1694
- const DEFAULT_USERS_EDIT_FORM_PROPS = DEFAULT_USERS_CREATE_FORM_PROPS.filter(prop => prop.name !== 'password');
1695
-
1696
- const DEFAULT_USERS_TOOLBAR_ACTIONS = ToolbarAction.createMany([
1697
- {
1698
- text: 'AbpIdentity::NewUser',
1699
- action: data => {
1700
- const component = data.getInjected(UsersComponent);
1701
- component.onAdd();
1702
- },
1703
- permission: 'AbpIdentity.Users.Create',
1704
- icon: 'fa fa-plus',
1705
- },
1706
- ]);
1707
-
1708
- const DEFAULT_IDENTITY_ENTITY_ACTIONS = {
1709
- ["Identity.ClaimsComponent" /* Claims */]: DEFAULT_CLAIMS_ENTITY_ACTIONS,
1710
- ["Identity.RolesComponent" /* Roles */]: DEFAULT_ROLES_ENTITY_ACTIONS,
1711
- ["Identity.UsersComponent" /* Users */]: DEFAULT_USERS_ENTITY_ACTIONS,
1712
- ["Identity.OrganizationMembersComponent" /* OrganizationMembers */]: DEFAULT_ORGANIZATION_MEMBERS_ENTITY_ACTIONS,
1713
- ["Identity.OrganizationRolesComponent" /* OrganizationRoles */]: DEFAULT_ORGANIZATION_ROLES_ENTITY_ACTIONS,
1714
- ["Identity.SecurityLogs" /* SecurityLogs */]: DEFAULT_SECURITY_LOGS_ENTITY_ACTIONS,
1715
- };
1716
- const DEFAULT_IDENTITY_TOOLBAR_ACTIONS = {
1717
- ["Identity.ClaimsComponent" /* Claims */]: DEFAULT_CLAIMS_TOOLBAR_ACTIONS,
1718
- ["Identity.RolesComponent" /* Roles */]: DEFAULT_ROLES_TOOLBAR_ACTIONS,
1719
- ["Identity.UsersComponent" /* Users */]: DEFAULT_USERS_TOOLBAR_ACTIONS,
1720
- ["Identity.OrganizationUnitsComponent" /* OrganizationUnits */]: DEFAULT_ORGANIZATION_UNITS_TOOLBAR_ACTIONS,
1721
- ["Identity.SecurityLogs" /* SecurityLogs */]: DEFAULT_SECURITY_LOGS_TOOLBAR_ACTIONS,
1722
- };
1723
- const DEFAULT_IDENTITY_ENTITY_PROPS = {
1724
- ["Identity.ClaimsComponent" /* Claims */]: DEFAULT_CLAIMS_ENTITY_PROPS,
1725
- ["Identity.RolesComponent" /* Roles */]: DEFAULT_ROLES_ENTITY_PROPS,
1726
- ["Identity.UsersComponent" /* Users */]: DEFAULT_USERS_ENTITY_PROPS,
1727
- ["Identity.OrganizationMembersComponent" /* OrganizationMembers */]: DEFAULT_ORGANIZATION_MEMBERS_ENTITY_PROPS,
1728
- ["Identity.OrganizationRolesComponent" /* OrganizationRoles */]: DEFAULT_ORGANIZATION_ROLES_ENTITY_PROPS,
1729
- ["Identity.SecurityLogs" /* SecurityLogs */]: DEFAULT_SECURITY_LOGS_ENTITY_PROPS,
1730
- };
1731
- const DEFAULT_IDENTITY_CREATE_FORM_PROPS = {
1732
- ["Identity.ClaimsComponent" /* Claims */]: DEFAULT_CLAIMS_CREATE_FORM_PROPS,
1733
- ["Identity.RolesComponent" /* Roles */]: DEFAULT_ROLES_CREATE_FORM_PROPS,
1734
- ["Identity.UsersComponent" /* Users */]: DEFAULT_USERS_CREATE_FORM_PROPS,
1735
- ["Identity.OrganizationUnitsComponent" /* OrganizationUnits */]: DEFAULT_ORGANIZATION_UNITS_CREATE_FORM_PROPS,
1736
- };
1737
- const DEFAULT_IDENTITY_EDIT_FORM_PROPS = {
1738
- ["Identity.ClaimsComponent" /* Claims */]: DEFAULT_CLAIMS_EDIT_FORM_PROPS,
1739
- ["Identity.RolesComponent" /* Roles */]: DEFAULT_ROLES_EDIT_FORM_PROPS,
1740
- ["Identity.UsersComponent" /* Users */]: DEFAULT_USERS_EDIT_FORM_PROPS,
1741
- ["Identity.OrganizationUnitsComponent" /* OrganizationUnits */]: DEFAULT_ORGANIZATION_UNITS_EDIT_FORM_PROPS,
1742
- };
1743
- const IDENTITY_ENTITY_ACTION_CONTRIBUTORS = new InjectionToken('IDENTITY_ENTITY_ACTION_CONTRIBUTORS');
1744
- const IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS = new InjectionToken('IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS');
1745
- const IDENTITY_ENTITY_PROP_CONTRIBUTORS = new InjectionToken('IDENTITY_ENTITY_PROP_CONTRIBUTORS');
1746
- const IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS = new InjectionToken('IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS');
1747
- const IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS = new InjectionToken('IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS');
1748
-
1749
- class IdentityExtensionsGuard {
1750
- constructor(injector) {
1751
- this.injector = injector;
1752
- }
1753
- canActivate() {
1754
- const extensions = this.injector.get(ExtensionsService);
1755
- const actionContributors = this.injector.get(IDENTITY_ENTITY_ACTION_CONTRIBUTORS, null) || {};
1756
- const toolbarContributors = this.injector.get(IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS, null) || {};
1757
- const propContributors = this.injector.get(IDENTITY_ENTITY_PROP_CONTRIBUTORS, null) || {};
1758
- const createFormContributors = this.injector.get(IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS, null) || {};
1759
- const editFormContributors = this.injector.get(IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS, null) || {};
1760
- const configState = this.injector.get(ConfigStateService);
1761
- return getObjectExtensionEntitiesFromStore(configState, 'Identity').pipe(map(entities => ({
1762
- ["Identity.ClaimsComponent" /* Claims */]: entities.ClaimType,
1763
- ["Identity.RolesComponent" /* Roles */]: entities.Role,
1764
- ["Identity.UsersComponent" /* Users */]: entities.User,
1765
- ["Identity.OrganizationUnitsComponent" /* OrganizationUnits */]: entities.OrganizationUnit,
1766
- })), mapEntitiesToContributors(configState, 'AbpIdentity'), tap(objectExtensionContributors => {
1767
- mergeWithDefaultActions(extensions.entityActions, DEFAULT_IDENTITY_ENTITY_ACTIONS, actionContributors);
1768
- mergeWithDefaultActions(extensions.toolbarActions, DEFAULT_IDENTITY_TOOLBAR_ACTIONS, toolbarContributors);
1769
- mergeWithDefaultProps(extensions.entityProps, DEFAULT_IDENTITY_ENTITY_PROPS, objectExtensionContributors.prop, propContributors);
1770
- mergeWithDefaultProps(extensions.createFormProps, DEFAULT_IDENTITY_CREATE_FORM_PROPS, objectExtensionContributors.createForm, createFormContributors);
1771
- mergeWithDefaultProps(extensions.editFormProps, DEFAULT_IDENTITY_EDIT_FORM_PROPS, objectExtensionContributors.editForm, editFormContributors);
1772
- }), mapTo(true));
1773
- }
1774
- }
1775
- IdentityExtensionsGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: IdentityExtensionsGuard, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
1776
- IdentityExtensionsGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: IdentityExtensionsGuard });
1777
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: IdentityExtensionsGuard, decorators: [{
1778
- type: Injectable
1779
- }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
1780
-
1781
- const routes = [
1782
- { path: '', redirectTo: 'roles', pathMatch: 'full' },
1783
- {
1784
- path: '',
1785
- component: DynamicLayoutComponent,
1786
- canActivate: [AuthGuard, PermissionGuard, IdentityExtensionsGuard],
1787
- children: [
1788
- {
1789
- path: 'roles',
1790
- component: ReplaceableRouteContainerComponent,
1791
- data: {
1792
- requiredPolicy: 'AbpIdentity.Roles',
1793
- replaceableComponent: {
1794
- key: "Identity.RolesComponent" /* Roles */,
1795
- defaultComponent: RolesComponent,
1796
- },
1797
- },
1798
- },
1799
- {
1800
- path: 'users',
1801
- component: ReplaceableRouteContainerComponent,
1802
- data: {
1803
- requiredPolicy: 'AbpIdentity.Users',
1804
- replaceableComponent: {
1805
- key: "Identity.UsersComponent" /* Users */,
1806
- defaultComponent: UsersComponent,
1807
- },
1808
- },
1809
- },
1810
- {
1811
- path: 'claim-types',
1812
- component: ReplaceableRouteContainerComponent,
1813
- data: {
1814
- requiredPolicy: 'AbpIdentity.ClaimTypes',
1815
- replaceableComponent: {
1816
- key: "Identity.ClaimsComponent" /* Claims */,
1817
- defaultComponent: ClaimsComponent,
1818
- },
1819
- },
1820
- },
1821
- {
1822
- path: 'organization-units',
1823
- component: ReplaceableRouteContainerComponent,
1824
- data: {
1825
- requiredPolicy: 'AbpIdentity.OrganizationUnits',
1826
- replaceableComponent: {
1827
- key: "Identity.OrganizationUnitsComponent" /* OrganizationUnits */,
1828
- defaultComponent: OrganizationUnitsComponent,
1829
- },
1830
- },
1831
- },
1832
- {
1833
- path: 'security-logs',
1834
- component: ReplaceableRouteContainerComponent,
1835
- data: {
1836
- requiredPolicy: 'AbpIdentity.SecurityLogs',
1837
- replaceableComponent: {
1838
- key: "Identity.SecurityLogs" /* SecurityLogs */,
1839
- defaultComponent: SecurityLogsComponent,
1840
- },
1841
- },
1842
- },
1843
- ],
1844
- },
1845
- ];
1846
- class IdentityRoutingModule {
1847
- }
1848
- IdentityRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: IdentityRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1849
- IdentityRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: IdentityRoutingModule, imports: [i1$1.RouterModule], exports: [RouterModule] });
1850
- IdentityRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: IdentityRoutingModule, imports: [[RouterModule.forChild(routes)], RouterModule] });
1851
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: IdentityRoutingModule, decorators: [{
1852
- type: NgModule,
1853
- args: [{
1854
- imports: [RouterModule.forChild(routes)],
1855
- exports: [RouterModule],
1856
- }]
1857
- }] });
1858
-
1859
- /* tslint:disable:max-line-length */
1860
- class IdentityModule {
1861
- static forChild(options = {}) {
1862
- return {
1863
- ngModule: IdentityModule,
1864
- providers: [
1865
- {
1866
- provide: IDENTITY_ENTITY_ACTION_CONTRIBUTORS,
1867
- useValue: options.entityActionContributors,
1868
- },
1869
- {
1870
- provide: IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS,
1871
- useValue: options.toolbarActionContributors,
1872
- },
1873
- {
1874
- provide: IDENTITY_ENTITY_PROP_CONTRIBUTORS,
1875
- useValue: options.entityPropContributors,
1876
- },
1877
- {
1878
- provide: IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS,
1879
- useValue: options.createFormPropContributors,
1880
- },
1881
- {
1882
- provide: IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS,
1883
- useValue: options.editFormPropContributors,
1884
- },
1885
- IdentityExtensionsGuard,
1886
- ],
1887
- };
1888
- }
1889
- static forLazy(options = {}) {
1890
- return new LazyModuleFactory(IdentityModule.forChild(options));
1891
- }
1892
- }
1893
- IdentityModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: IdentityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1894
- IdentityModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: IdentityModule, declarations: [RolesComponent,
1895
- UsersComponent,
1896
- ClaimModalComponent,
1897
- ClaimsComponent,
1898
- OrganizationUnitsComponent,
1899
- OrganizationMembersComponent,
1900
- OrganizationMembersModalBodyComponent,
1901
- OrganizationRolesComponent,
1902
- OrganizationRolesModalBodyComponent,
1903
- AbstractOrganizationUnitComponent,
1904
- SecurityLogsComponent], imports: [CoreModule,
1905
- CommercialUiModule,
1906
- IdentityRoutingModule,
1907
- NgbNavModule,
1908
- ThemeSharedModule,
1909
- NgbDropdownModule,
1910
- NgbDatepickerModule,
1911
- PermissionManagementModule,
1912
- NgxValidateCoreModule,
1913
- TreeModule,
1914
- PageModule,
1915
- AdvancedEntityFiltersModule,
1916
- UiExtensionsModule], exports: [RolesComponent,
1917
- UsersComponent,
1918
- ClaimModalComponent,
1919
- ClaimsComponent,
1920
- OrganizationUnitsComponent,
1921
- OrganizationMembersComponent,
1922
- OrganizationMembersModalBodyComponent,
1923
- OrganizationRolesComponent,
1924
- OrganizationRolesModalBodyComponent,
1925
- AbstractOrganizationUnitComponent,
1926
- SecurityLogsComponent] });
1927
- IdentityModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: IdentityModule, imports: [[
1928
- CoreModule,
1929
- CommercialUiModule,
1930
- IdentityRoutingModule,
1931
- NgbNavModule,
1932
- ThemeSharedModule,
1933
- NgbDropdownModule,
1934
- NgbDatepickerModule,
1935
- PermissionManagementModule,
1936
- NgxValidateCoreModule,
1937
- TreeModule,
1938
- PageModule,
1939
- AdvancedEntityFiltersModule,
1940
- UiExtensionsModule,
1941
- ]] });
1942
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.0", ngImport: i0, type: IdentityModule, decorators: [{
1943
- type: NgModule,
1944
- args: [{
1945
- declarations: [
1946
- RolesComponent,
1947
- UsersComponent,
1948
- ClaimModalComponent,
1949
- ClaimsComponent,
1950
- OrganizationUnitsComponent,
1951
- OrganizationMembersComponent,
1952
- OrganizationMembersModalBodyComponent,
1953
- OrganizationRolesComponent,
1954
- OrganizationRolesModalBodyComponent,
1955
- AbstractOrganizationUnitComponent,
1956
- SecurityLogsComponent,
1957
- ],
1958
- exports: [
1959
- RolesComponent,
1960
- UsersComponent,
1961
- ClaimModalComponent,
1962
- ClaimsComponent,
1963
- OrganizationUnitsComponent,
1964
- OrganizationMembersComponent,
1965
- OrganizationMembersModalBodyComponent,
1966
- OrganizationRolesComponent,
1967
- OrganizationRolesModalBodyComponent,
1968
- AbstractOrganizationUnitComponent,
1969
- SecurityLogsComponent,
1970
- ],
1971
- imports: [
1972
- CoreModule,
1973
- CommercialUiModule,
1974
- IdentityRoutingModule,
1975
- NgbNavModule,
1976
- ThemeSharedModule,
1977
- NgbDropdownModule,
1978
- NgbDatepickerModule,
1979
- PermissionManagementModule,
1980
- NgxValidateCoreModule,
1981
- TreeModule,
1982
- PageModule,
1983
- AdvancedEntityFiltersModule,
1984
- UiExtensionsModule,
1985
- ],
1986
- entryComponents: [],
1987
- }]
1988
- }] });
1989
-
1990
- /**
1991
- * Generated bundle index. Do not edit.
1992
- */
1993
-
1994
- export { AbstractOrganizationUnitComponent, ClaimModalComponent, ClaimsComponent, 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, ORGANIZATION_UNIT_CONFIG, OrganizationMembersComponent, OrganizationMembersModalBodyComponent, OrganizationRolesComponent, OrganizationRolesModalBodyComponent, OrganizationUnitsComponent, RolesComponent, SecurityLogsComponent, UsersComponent, eIdentityTwoFactorBehaviour, identityTwoFactorBehaviourOptions };
1995
- //# sourceMappingURL=volo-abp.ng.identity.js.map