@volo/abp.ng.identity 7.2.1 → 7.3.0-rc.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.
- package/config/components/authority-delegation/authority-delegation.component.d.ts +14 -14
- package/config/components/authority-delegation/authority-delegation.module.d.ts +15 -15
- package/config/components/authority-delegation/create-user-delegate.component.d.ts +17 -17
- package/config/components/authority-delegation/index.d.ts +5 -5
- package/config/components/authority-delegation/list-authority-delegation.component.d.ts +28 -28
- package/config/components/authority-delegation/my-delegated-users.component.d.ts +24 -24
- package/config/components/identity-setting-tabs/identity-external-login-settings.component.d.ts +20 -20
- package/config/components/identity-setting-tabs/identity-ldap-settings.component.d.ts +17 -17
- package/config/components/identity-setting-tabs/identity-setting.component.d.ts +24 -24
- package/config/components/identity-setting-tabs/index.d.ts +3 -3
- package/config/components/identity-settings.component.d.ts +12 -12
- package/config/components/index.d.ts +4 -4
- package/config/components/my-link-users-modal.component.d.ts +39 -39
- package/config/enums/index.d.ts +3 -3
- package/config/enums/policy-names.d.ts +8 -8
- package/config/enums/route-names.d.ts +8 -8
- package/config/enums/setting-tab-names.d.ts +3 -3
- package/config/handlers/link-login.handler.d.ts +18 -18
- package/config/identity-config.module.d.ts +18 -18
- package/config/index.d.ts +5 -5
- package/config/models/delegate-authority.d.ts +1 -1
- package/config/models/identity-settings.d.ts +30 -30
- package/config/models/index.d.ts +2 -2
- package/config/providers/index.d.ts +2 -2
- package/config/providers/route.provider.d.ts +8 -8
- package/config/providers/setting-tab.provider.d.ts +8 -8
- package/config/public-api.d.ts +7 -7
- package/config/services/authority-delegation.service.d.ts +20 -20
- package/config/services/identity-config.service.d.ts +13 -13
- package/config/services/identity-link-login.service.d.ts +10 -10
- package/config/services/index.d.ts +3 -3
- package/config/utils/factories.d.ts +3 -3
- package/esm2022/config/components/authority-delegation/authority-delegation.component.mjs +33 -0
- package/esm2022/config/components/authority-delegation/authority-delegation.module.mjs +55 -0
- package/esm2022/config/components/authority-delegation/create-user-delegate.component.mjs +56 -0
- package/{esm2020 → esm2022}/config/components/authority-delegation/index.mjs +5 -5
- package/esm2022/config/components/authority-delegation/list-authority-delegation.component.mjs +79 -0
- package/esm2022/config/components/authority-delegation/my-delegated-users.component.mjs +63 -0
- package/esm2022/config/components/identity-setting-tabs/identity-external-login-settings.component.mjs +61 -0
- package/esm2022/config/components/identity-setting-tabs/identity-ldap-settings.component.mjs +40 -0
- package/esm2022/config/components/identity-setting-tabs/identity-setting.component.mjs +97 -0
- package/{esm2020 → esm2022}/config/components/identity-setting-tabs/index.mjs +3 -3
- package/esm2022/config/components/identity-settings.component.mjs +29 -0
- package/{esm2020 → esm2022}/config/components/index.mjs +4 -4
- package/esm2022/config/components/my-link-users-modal.component.mjs +138 -0
- package/{esm2020 → esm2022}/config/enums/index.mjs +3 -3
- package/{esm2020 → esm2022}/config/enums/policy-names.mjs +1 -1
- package/{esm2020 → esm2022}/config/enums/route-names.mjs +1 -1
- package/{esm2020 → esm2022}/config/enums/setting-tab-names.mjs +1 -1
- package/esm2022/config/handlers/link-login.handler.mjs +71 -0
- package/esm2022/config/identity-config.module.mjs +80 -0
- package/{esm2020 → esm2022}/config/models/delegate-authority.mjs +1 -1
- package/{esm2020 → esm2022}/config/models/identity-settings.mjs +1 -1
- package/{esm2020 → esm2022}/config/models/index.mjs +1 -1
- package/{esm2020 → esm2022}/config/providers/index.mjs +2 -2
- package/{esm2020 → esm2022}/config/providers/route.provider.mjs +55 -55
- package/{esm2020 → esm2022}/config/providers/setting-tab.provider.mjs +23 -23
- package/{esm2020 → esm2022}/config/public-api.mjs +7 -7
- package/esm2022/config/services/authority-delegation.service.mjs +62 -0
- package/esm2022/config/services/identity-config.service.mjs +33 -0
- package/esm2022/config/services/identity-link-login.service.mjs +30 -0
- package/{esm2020 → esm2022}/config/services/index.mjs +3 -3
- package/{esm2020 → esm2022}/config/utils/factories.mjs +25 -25
- package/{esm2020 → esm2022}/config/volo-abp.ng.identity-config.mjs +4 -4
- package/esm2022/lib/components/claim-modal/claim-modal.component.mjs +138 -0
- package/esm2022/lib/components/claims/claims.component.mjs +115 -0
- package/esm2022/lib/components/external-login/external-login.component.mjs +86 -0
- package/esm2022/lib/components/external-login/user-dropdown-menu/user-dropdown-menu.component.mjs +33 -0
- package/{esm2020 → esm2022}/lib/components/index.mjs +14 -14
- package/esm2022/lib/components/organization-units/abstract-organization-unit/abstract-organization-unit.component.mjs +78 -0
- package/esm2022/lib/components/organization-units/organization-members/organization-members-modal-body.component.mjs +118 -0
- package/esm2022/lib/components/organization-units/organization-members/organization-members.component.mjs +56 -0
- package/esm2022/lib/components/organization-units/organization-roles/organization-roles-modal-body.component.mjs +86 -0
- package/esm2022/lib/components/organization-units/organization-roles/organization-roles.component.mjs +51 -0
- package/esm2022/lib/components/organization-units/organization-units.component.mjs +158 -0
- package/esm2022/lib/components/organization-units/selected-organization-unit/selected-organization-unit.component.mjs +18 -0
- package/esm2022/lib/components/roles/roles.component.mjs +126 -0
- package/esm2022/lib/components/security-logs/security-logs.component.mjs +57 -0
- package/esm2022/lib/components/users/users.component.mjs +274 -0
- package/{esm2020 → esm2022}/lib/defaults/claims/default-claims-entity-actions.mjs +21 -21
- package/{esm2020 → esm2022}/lib/defaults/claims/default-claims-entity-props.mjs +48 -48
- package/{esm2020 → esm2022}/lib/defaults/claims/default-claims-form-props.mjs +51 -51
- package/{esm2020 → esm2022}/lib/defaults/claims/default-claims-toolbar-actions.mjs +13 -13
- package/{esm2020 → esm2022}/lib/defaults/claims/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/defaults/index.mjs +5 -5
- package/{esm2020 → esm2022}/lib/defaults/organization-unit/default-organization-members-entity-actions.mjs +13 -13
- package/{esm2020 → esm2022}/lib/defaults/organization-unit/default-organization-members-entity-props.mjs +22 -22
- package/{esm2020 → esm2022}/lib/defaults/organization-unit/default-organization-roles-entity-actions.mjs +13 -13
- package/{esm2020 → esm2022}/lib/defaults/organization-unit/default-organization-roles-entity-props.mjs +9 -9
- package/{esm2020 → esm2022}/lib/defaults/organization-unit/default-organization-units-form-props.mjs +12 -12
- package/{esm2020 → esm2022}/lib/defaults/organization-unit/default-organization-units-toolbar-actions.mjs +2 -2
- package/{esm2020 → esm2022}/lib/defaults/organization-unit/index.mjs +6 -6
- package/{esm2020 → esm2022}/lib/defaults/roles/default-roles-entity-actions.mjs +47 -47
- package/{esm2020 → esm2022}/lib/defaults/roles/default-roles-entity-props.mjs +23 -23
- package/{esm2020 → esm2022}/lib/defaults/roles/default-roles-form-props.mjs +27 -27
- package/{esm2020 → esm2022}/lib/defaults/roles/default-roles-toolbar-actions.mjs +13 -13
- package/{esm2020 → esm2022}/lib/defaults/roles/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/defaults/security-logs/default-security-logs-entity-actions.mjs +2 -2
- package/{esm2020 → esm2022}/lib/defaults/security-logs/default-security-logs-entity-props.mjs +130 -130
- package/{esm2020 → esm2022}/lib/defaults/security-logs/default-security-logs-toolbar-actions.mjs +2 -2
- package/{esm2020 → esm2022}/lib/defaults/security-logs/index.mjs +3 -3
- package/{esm2020 → esm2022}/lib/defaults/users/default-users-entity-actions.mjs +103 -103
- package/{esm2020 → esm2022}/lib/defaults/users/default-users-entity-props.mjs +112 -112
- package/{esm2020 → esm2022}/lib/defaults/users/default-users-form-props.mjs +70 -70
- package/{esm2020 → esm2022}/lib/defaults/users/default-users-toolbar-actions.mjs +24 -24
- package/{esm2020 → esm2022}/lib/defaults/users/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/enums/components.mjs +1 -1
- package/{esm2020 → esm2022}/lib/enums/index.mjs +2 -2
- package/{esm2020 → esm2022}/lib/enums/two-factor-behaviour.mjs +8 -8
- package/esm2022/lib/guards/extensions.guard.mjs +39 -0
- package/{esm2020 → esm2022}/lib/guards/index.mjs +1 -1
- package/{esm2020 → esm2022}/lib/identity-routing.module.mjs +90 -89
- package/esm2022/lib/identity.module.mjs +173 -0
- package/{esm2020 → esm2022}/lib/models/config-options.mjs +1 -1
- package/{esm2020 → esm2022}/lib/models/identity.mjs +1 -1
- package/{esm2020 → esm2022}/lib/models/index.mjs +2 -2
- package/{esm2020 → esm2022}/lib/services/index.mjs +1 -1
- package/esm2022/lib/services/organization-units-state.service.mjs +28 -0
- package/{esm2020 → esm2022}/lib/tokens/extensions.token.mjs +62 -62
- package/{esm2020 → esm2022}/lib/tokens/index.mjs +1 -1
- package/{esm2020 → esm2022}/proxy/lib/index.mjs +2 -2
- package/esm2022/proxy/lib/proxy/identity/identity-claim-type.service.mjs +43 -0
- package/{esm2020 → esm2022}/proxy/lib/proxy/identity/identity-claim-value-type.enum.mjs +9 -9
- package/esm2022/proxy/lib/proxy/identity/identity-external-login.service.mjs +24 -0
- package/esm2022/proxy/lib/proxy/identity/identity-role.service.mjs +60 -0
- package/esm2022/proxy/lib/proxy/identity/identity-security-log.service.mjs +38 -0
- package/esm2022/proxy/lib/proxy/identity/identity-settings.service.mjs +47 -0
- package/esm2022/proxy/lib/proxy/identity/identity-user-lookup.service.mjs +38 -0
- package/esm2022/proxy/lib/proxy/identity/identity-user.service.mjs +123 -0
- package/{esm2020 → esm2022}/proxy/lib/proxy/identity/index.mjs +10 -10
- package/{esm2020 → esm2022}/proxy/lib/proxy/identity/models.mjs +1 -1
- package/esm2022/proxy/lib/proxy/identity/organization-unit.service.mjs +91 -0
- package/{esm2020 → esm2022}/proxy/lib/proxy/users/index.mjs +1 -1
- package/{esm2020 → esm2022}/proxy/lib/proxy/users/models.mjs +1 -1
- package/{esm2020 → esm2022}/proxy/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/proxy/volo-abp.ng.identity-proxy.mjs +4 -4
- package/{esm2020 → esm2022}/public-api.mjs +8 -8
- package/{esm2020 → esm2022}/volo-abp.ng.identity.mjs +4 -4
- package/{fesm2020 → fesm2022}/volo-abp.ng.identity-config.mjs +822 -822
- package/{fesm2020 → fesm2022}/volo-abp.ng.identity-config.mjs.map +1 -1
- package/{fesm2015 → fesm2022}/volo-abp.ng.identity-proxy.mjs +419 -419
- package/{fesm2015 → fesm2022}/volo-abp.ng.identity-proxy.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/volo-abp.ng.identity.mjs +2074 -2076
- package/{fesm2020 → fesm2022}/volo-abp.ng.identity.mjs.map +1 -1
- package/index.d.ts +5 -5
- package/lib/components/claim-modal/claim-modal.component.d.ts +42 -42
- package/lib/components/claims/claims.component.d.ts +31 -31
- package/lib/components/external-login/external-login.component.d.ts +32 -32
- package/lib/components/external-login/user-dropdown-menu/user-dropdown-menu.component.d.ts +14 -14
- package/lib/components/index.d.ts +14 -14
- package/lib/components/organization-units/abstract-organization-unit/abstract-organization-unit.component.d.ts +34 -34
- package/lib/components/organization-units/organization-members/organization-members-modal-body.component.d.ts +17 -17
- package/lib/components/organization-units/organization-members/organization-members.component.d.ts +9 -9
- package/lib/components/organization-units/organization-roles/organization-roles-modal-body.component.d.ts +17 -17
- package/lib/components/organization-units/organization-roles/organization-roles.component.d.ts +7 -7
- package/lib/components/organization-units/organization-units.component.d.ts +43 -43
- package/lib/components/organization-units/selected-organization-unit/selected-organization-unit.component.d.ts +8 -8
- package/lib/components/roles/roles.component.d.ts +39 -39
- package/lib/components/security-logs/security-logs.component.d.ts +19 -19
- package/lib/components/users/users.component.d.ts +83 -83
- package/lib/defaults/claims/default-claims-entity-actions.d.ts +3 -3
- package/lib/defaults/claims/default-claims-entity-props.d.ts +3 -3
- package/lib/defaults/claims/default-claims-form-props.d.ts +4 -4
- package/lib/defaults/claims/default-claims-toolbar-actions.d.ts +3 -3
- package/lib/defaults/claims/index.d.ts +4 -4
- package/lib/defaults/index.d.ts +5 -5
- package/lib/defaults/organization-unit/default-organization-members-entity-actions.d.ts +3 -3
- package/lib/defaults/organization-unit/default-organization-members-entity-props.d.ts +3 -3
- package/lib/defaults/organization-unit/default-organization-roles-entity-actions.d.ts +3 -3
- package/lib/defaults/organization-unit/default-organization-roles-entity-props.d.ts +3 -3
- package/lib/defaults/organization-unit/default-organization-units-form-props.d.ts +4 -4
- package/lib/defaults/organization-unit/default-organization-units-toolbar-actions.d.ts +3 -3
- package/lib/defaults/organization-unit/index.d.ts +6 -6
- package/lib/defaults/roles/default-roles-entity-actions.d.ts +3 -3
- package/lib/defaults/roles/default-roles-entity-props.d.ts +3 -3
- package/lib/defaults/roles/default-roles-form-props.d.ts +4 -4
- package/lib/defaults/roles/default-roles-toolbar-actions.d.ts +3 -3
- package/lib/defaults/roles/index.d.ts +4 -4
- package/lib/defaults/security-logs/default-security-logs-entity-actions.d.ts +3 -3
- package/lib/defaults/security-logs/default-security-logs-entity-props.d.ts +3 -3
- package/lib/defaults/security-logs/default-security-logs-toolbar-actions.d.ts +3 -3
- package/lib/defaults/security-logs/index.d.ts +3 -3
- package/lib/defaults/users/default-users-entity-actions.d.ts +3 -3
- package/lib/defaults/users/default-users-entity-props.d.ts +3 -3
- package/lib/defaults/users/default-users-form-props.d.ts +4 -4
- package/lib/defaults/users/default-users-toolbar-actions.d.ts +5 -5
- package/lib/defaults/users/index.d.ts +4 -4
- package/lib/enums/components.d.ts +9 -9
- package/lib/enums/index.d.ts +2 -2
- package/lib/enums/two-factor-behaviour.d.ts +6 -6
- package/lib/guards/extensions.guard.d.ts +10 -11
- package/lib/guards/index.d.ts +1 -1
- package/lib/identity-routing.module.d.ts +7 -7
- package/lib/identity.module.d.ts +34 -34
- package/lib/models/config-options.d.ts +35 -35
- package/lib/models/identity.d.ts +13 -13
- package/lib/models/index.d.ts +2 -2
- package/lib/services/index.d.ts +1 -1
- package/lib/services/organization-units-state.service.d.ts +15 -15
- package/lib/tokens/extensions.token.d.ts +74 -74
- package/lib/tokens/index.d.ts +1 -1
- package/package.json +17 -27
- package/proxy/index.d.ts +5 -5
- package/proxy/lib/index.d.ts +2 -2
- package/proxy/lib/proxy/identity/identity-claim-type.service.d.ts +16 -16
- package/proxy/lib/proxy/identity/identity-claim-value-type.enum.d.ts +7 -7
- package/proxy/lib/proxy/identity/identity-external-login.service.d.ts +10 -10
- package/proxy/lib/proxy/identity/identity-role.service.d.ts +20 -20
- package/proxy/lib/proxy/identity/identity-security-log.service.d.ts +15 -15
- package/proxy/lib/proxy/identity/identity-settings.service.d.ts +16 -16
- package/proxy/lib/proxy/identity/identity-user-lookup.service.d.ts +16 -16
- package/proxy/lib/proxy/identity/identity-user.service.d.ts +35 -35
- package/proxy/lib/proxy/identity/index.d.ts +10 -10
- package/proxy/lib/proxy/identity/models.d.ts +269 -269
- package/proxy/lib/proxy/identity/organization-unit.service.d.ts +26 -26
- package/proxy/lib/proxy/users/index.d.ts +1 -1
- package/proxy/lib/proxy/users/models.d.ts +12 -12
- package/proxy/public-api.d.ts +1 -1
- package/public-api.d.ts +8 -8
- package/esm2020/config/components/authority-delegation/authority-delegation.component.mjs +0 -32
- package/esm2020/config/components/authority-delegation/authority-delegation.module.mjs +0 -54
- package/esm2020/config/components/authority-delegation/create-user-delegate.component.mjs +0 -55
- package/esm2020/config/components/authority-delegation/list-authority-delegation.component.mjs +0 -78
- package/esm2020/config/components/authority-delegation/my-delegated-users.component.mjs +0 -62
- package/esm2020/config/components/identity-setting-tabs/identity-external-login-settings.component.mjs +0 -60
- package/esm2020/config/components/identity-setting-tabs/identity-ldap-settings.component.mjs +0 -39
- package/esm2020/config/components/identity-setting-tabs/identity-setting.component.mjs +0 -96
- package/esm2020/config/components/identity-settings.component.mjs +0 -28
- package/esm2020/config/components/my-link-users-modal.component.mjs +0 -137
- package/esm2020/config/handlers/link-login.handler.mjs +0 -70
- package/esm2020/config/identity-config.module.mjs +0 -79
- package/esm2020/config/services/authority-delegation.service.mjs +0 -61
- package/esm2020/config/services/identity-config.service.mjs +0 -32
- package/esm2020/config/services/identity-link-login.service.mjs +0 -29
- package/esm2020/lib/components/claim-modal/claim-modal.component.mjs +0 -137
- package/esm2020/lib/components/claims/claims.component.mjs +0 -114
- package/esm2020/lib/components/external-login/external-login.component.mjs +0 -85
- package/esm2020/lib/components/external-login/user-dropdown-menu/user-dropdown-menu.component.mjs +0 -32
- package/esm2020/lib/components/organization-units/abstract-organization-unit/abstract-organization-unit.component.mjs +0 -77
- package/esm2020/lib/components/organization-units/organization-members/organization-members-modal-body.component.mjs +0 -117
- package/esm2020/lib/components/organization-units/organization-members/organization-members.component.mjs +0 -55
- package/esm2020/lib/components/organization-units/organization-roles/organization-roles-modal-body.component.mjs +0 -85
- package/esm2020/lib/components/organization-units/organization-roles/organization-roles.component.mjs +0 -50
- package/esm2020/lib/components/organization-units/organization-units.component.mjs +0 -157
- package/esm2020/lib/components/organization-units/selected-organization-unit/selected-organization-unit.component.mjs +0 -17
- package/esm2020/lib/components/roles/roles.component.mjs +0 -125
- package/esm2020/lib/components/security-logs/security-logs.component.mjs +0 -56
- package/esm2020/lib/components/users/users.component.mjs +0 -275
- package/esm2020/lib/guards/extensions.guard.mjs +0 -38
- package/esm2020/lib/identity.module.mjs +0 -172
- package/esm2020/lib/services/organization-units-state.service.mjs +0 -27
- package/esm2020/proxy/lib/proxy/identity/identity-claim-type.service.mjs +0 -42
- package/esm2020/proxy/lib/proxy/identity/identity-external-login.service.mjs +0 -23
- package/esm2020/proxy/lib/proxy/identity/identity-role.service.mjs +0 -59
- package/esm2020/proxy/lib/proxy/identity/identity-security-log.service.mjs +0 -37
- package/esm2020/proxy/lib/proxy/identity/identity-settings.service.mjs +0 -46
- package/esm2020/proxy/lib/proxy/identity/identity-user-lookup.service.mjs +0 -37
- package/esm2020/proxy/lib/proxy/identity/identity-user.service.mjs +0 -122
- package/esm2020/proxy/lib/proxy/identity/organization-unit.service.mjs +0 -90
- package/fesm2015/volo-abp.ng.identity-config.mjs +0 -886
- package/fesm2015/volo-abp.ng.identity-config.mjs.map +0 -1
- package/fesm2015/volo-abp.ng.identity.mjs +0 -2285
- package/fesm2015/volo-abp.ng.identity.mjs.map +0 -1
- package/fesm2020/volo-abp.ng.identity-proxy.mjs +0 -444
- package/fesm2020/volo-abp.ng.identity-proxy.mjs.map +0 -1
- package/proxy/src/lib/proxy/README.md +0 -17
|
@@ -23,864 +23,864 @@ import { CommercialUiModule } from '@volo/abp.commercial.ng.ui';
|
|
|
23
23
|
import { OPEN_MY_LINK_USERS_MODAL, OPEN_AUTHORITY_DELEGATION_MODAL } from '@volo/abp.commercial.ng.ui/config';
|
|
24
24
|
import { SettingTabsService } from '@abp/ng.setting-management/config';
|
|
25
25
|
|
|
26
|
-
class IdentityConfigService {
|
|
27
|
-
constructor(restService) {
|
|
28
|
-
this.restService = restService;
|
|
29
|
-
this.apiName = 'AbpIdentity';
|
|
30
|
-
}
|
|
31
|
-
getSettings() {
|
|
32
|
-
return this.restService.request({
|
|
33
|
-
method: 'GET',
|
|
34
|
-
url: '/api/identity/settings',
|
|
35
|
-
}, { apiName: this.apiName });
|
|
36
|
-
}
|
|
37
|
-
updateSettings(body) {
|
|
38
|
-
return this.restService.request({
|
|
39
|
-
method: 'PUT',
|
|
40
|
-
url: `/api/identity/settings`,
|
|
41
|
-
body,
|
|
42
|
-
}, { apiName: this.apiName });
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
48
|
-
type: Injectable,
|
|
49
|
-
args: [{
|
|
50
|
-
providedIn: 'root',
|
|
51
|
-
}]
|
|
26
|
+
class IdentityConfigService {
|
|
27
|
+
constructor(restService) {
|
|
28
|
+
this.restService = restService;
|
|
29
|
+
this.apiName = 'AbpIdentity';
|
|
30
|
+
}
|
|
31
|
+
getSettings() {
|
|
32
|
+
return this.restService.request({
|
|
33
|
+
method: 'GET',
|
|
34
|
+
url: '/api/identity/settings',
|
|
35
|
+
}, { apiName: this.apiName });
|
|
36
|
+
}
|
|
37
|
+
updateSettings(body) {
|
|
38
|
+
return this.restService.request({
|
|
39
|
+
method: 'PUT',
|
|
40
|
+
url: `/api/identity/settings`,
|
|
41
|
+
body,
|
|
42
|
+
}, { apiName: this.apiName });
|
|
43
|
+
}
|
|
44
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentityConfigService, deps: [{ token: i3.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
45
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentityConfigService, providedIn: 'root' }); }
|
|
46
|
+
}
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentityConfigService, decorators: [{
|
|
48
|
+
type: Injectable,
|
|
49
|
+
args: [{
|
|
50
|
+
providedIn: 'root',
|
|
51
|
+
}]
|
|
52
52
|
}], ctorParameters: function () { return [{ type: i3.RestService }]; } });
|
|
53
53
|
|
|
54
|
-
const { required, max, min } = Validators;
|
|
55
|
-
class IdentitySettingComponent {
|
|
56
|
-
constructor(identityConfigService, toaster, fb, subscription, configState) {
|
|
57
|
-
this.identityConfigService = identityConfigService;
|
|
58
|
-
this.toaster = toaster;
|
|
59
|
-
this.fb = fb;
|
|
60
|
-
this.subscription = subscription;
|
|
61
|
-
this.configState = configState;
|
|
62
|
-
this.settings = {};
|
|
63
|
-
this.doNotRequireConfirmedPhoneNumber = () => {
|
|
64
|
-
this.form.get('signIn.requireConfirmedPhoneNumber').setValue(false);
|
|
65
|
-
};
|
|
66
|
-
this.enablePhoneNumberConfirmation = () => {
|
|
67
|
-
this.form.get('signIn.enablePhoneNumberConfirmation').setValue(true);
|
|
68
|
-
};
|
|
69
|
-
identityConfigService.getSettings().subscribe(settings => {
|
|
70
|
-
this.settings = settings;
|
|
71
|
-
this.buildForm();
|
|
72
|
-
this.syncConfirmationOptions();
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
buildForm() {
|
|
76
|
-
const passwordSettings = this.settings?.password || {};
|
|
77
|
-
const password = this.fb.group({
|
|
78
|
-
requiredLength: [passwordSettings.requiredLength, [required, max(32), min(2)]],
|
|
79
|
-
requiredUniqueChars: [passwordSettings.requiredUniqueChars, [required, max(32), min(1)]],
|
|
80
|
-
requireNonAlphanumeric: passwordSettings.requireNonAlphanumeric,
|
|
81
|
-
requireLowercase: passwordSettings.requireLowercase,
|
|
82
|
-
requireUppercase: passwordSettings.requireUppercase,
|
|
83
|
-
requireDigit: passwordSettings.requireDigit,
|
|
84
|
-
forceUsersToPeriodicallyChangePassword: passwordSettings.forceUsersToPeriodicallyChangePassword,
|
|
85
|
-
passwordChangePeriodDays: [passwordSettings.passwordChangePeriodDays, [required, min(0)]],
|
|
86
|
-
});
|
|
87
|
-
const lockoutSettings = this.settings?.lockout || {};
|
|
88
|
-
const lockout = this.fb.group({
|
|
89
|
-
allowedForNewUsers: lockoutSettings.allowedForNewUsers,
|
|
90
|
-
lockoutDuration: [lockoutSettings.lockoutDuration, [required]],
|
|
91
|
-
maxFailedAccessAttempts: [lockoutSettings.maxFailedAccessAttempts, [required]],
|
|
92
|
-
});
|
|
93
|
-
const signInSettings = this.settings?.signIn || {};
|
|
94
|
-
const signIn = this.fb.group({
|
|
95
|
-
requireConfirmedEmail: signInSettings.requireConfirmedEmail,
|
|
96
|
-
enablePhoneNumberConfirmation: signInSettings.enablePhoneNumberConfirmation,
|
|
97
|
-
requireConfirmedPhoneNumber: signInSettings.requireConfirmedPhoneNumber,
|
|
98
|
-
});
|
|
99
|
-
const userSettings = this.settings?.user || {};
|
|
100
|
-
const user = this.fb.group({
|
|
101
|
-
isUserNameUpdateEnabled: userSettings.isUserNameUpdateEnabled,
|
|
102
|
-
isEmailUpdateEnabled: userSettings.isEmailUpdateEnabled,
|
|
103
|
-
});
|
|
104
|
-
this.form = this.fb.group({
|
|
105
|
-
password,
|
|
106
|
-
lockout,
|
|
107
|
-
signIn,
|
|
108
|
-
user,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
syncConfirmationOptions() {
|
|
112
|
-
this.subscription.addOne(this.form.get('signIn.requireConfirmedPhoneNumber').valueChanges.pipe(filter(Boolean)), this.enablePhoneNumberConfirmation);
|
|
113
|
-
this.subscription.addOne(this.form
|
|
114
|
-
.get('signIn.enablePhoneNumberConfirmation')
|
|
115
|
-
.valueChanges.pipe(filter(value => !value)), this.doNotRequireConfirmedPhoneNumber);
|
|
116
|
-
}
|
|
117
|
-
submit() {
|
|
118
|
-
if (this.loading || this.form?.invalid)
|
|
119
|
-
return;
|
|
120
|
-
this.loading = true;
|
|
121
|
-
this.identityConfigService
|
|
122
|
-
.updateSettings(this.form.value)
|
|
123
|
-
.pipe(finalize(() => {
|
|
124
|
-
this.loading = false;
|
|
125
|
-
this.configState.refreshAppState().subscribe();
|
|
126
|
-
}))
|
|
127
|
-
.subscribe(() => this.toaster.success('AbpIdentity::SavedSuccessfully', null));
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
IdentitySettingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: IdentitySettingComponent, deps: [{ token: IdentityConfigService }, { token: i2.ToasterService }, { token: i3$1.UntypedFormBuilder }, { token: i3.SubscriptionService }, { token: i3.ConfigStateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
131
|
-
IdentitySettingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.1", type: IdentitySettingComponent, selector: "abp-identity-setting", providers: [SubscriptionService], ngImport: i0, template: "\r\n<form\r\n class=\"py-2\"\r\n *ngIf=\"form\"\r\n id=\"IdentitySettingsForm\"\r\n [formGroup]=\"form\"\r\n (ngSubmit)=\"submit()\"\r\n validateOnSubmit\r\n>\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <div formGroupName=\"password\">\r\n <h4>{{ 'AbpIdentity::PasswordSettings' | abpLocalization }}</h4>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Password_RequiredLength\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequiredLength' | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Password_RequiredLength\"\r\n name=\"Password.RequiredLength\"\r\n class=\"form-control\"\r\n formControlName=\"requiredLength\"\r\n min=\"2\"\r\n max=\"32\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequiredLength' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Password_RequiredUniqueChars\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequiredUniqueChars' | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Password_RequiredUniqueChars\"\r\n name=\"Password.RequiredUniqueChars\"\r\n class=\"form-control\"\r\n formControlName=\"requiredUniqueChars\"\r\n min=\"0\"\r\n max=\"32\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequiredUniqueChars' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireNonAlphanumeric\"\r\n name=\"Password.RequireNonAlphanumeric\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireNonAlphanumeric\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireNonAlphanumeric\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireNonAlphanumeric'\r\n | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireNonAlphanumeric'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireLowercase\"\r\n name=\"Password.RequireLowercase\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireLowercase\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireLowercase\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireLowercase' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireLowercase' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireUppercase\"\r\n name=\"Password.RequireUppercase\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireUppercase\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireUppercase\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireUppercase' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireUppercase' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireDigit\"\r\n name=\"Password.RequireDigit\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireDigit\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireDigit\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireDigit' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireDigit' | abpLocalization\r\n }}</small>\r\n </div>\r\n\r\n <hr class=\"my-4\" />\r\n <h4>{{ 'AbpIdentity::PasswordRenewingSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_ForceUsersToPeriodicallyChangePassword\"\r\n name=\"Password.ForceUsersToPeriodicallyChangePassword\"\r\n class=\"form-check-input\"\r\n formControlName=\"forceUsersToPeriodicallyChangePassword\"\r\n />\r\n <label class=\"form-check-label\" for=\"Password_ForceUsersToPeriodicallyChangePassword\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.ForceUsersToPeriodicallyChangePassword'\r\n | abpLocalization\r\n }}</label>\r\n <br />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.ForceUsersToPeriodicallyChangePassword'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Password_PasswordChangePeriodDays\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.PasswordChangePeriodDays'\r\n | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Password_PasswordChangePeriodDays\"\r\n name=\"Password.PasswordChangePeriodDays\"\r\n class=\"form-control\"\r\n formControlName=\"passwordChangePeriodDays\"\r\n />\r\n <small\r\n class=\"form-text text-muted\"\r\n >{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.PasswordChangePeriodDays'\r\n | abpLocalization\r\n }}</small\r\n >\r\n </div>\r\n </div>\r\n <hr class=\"my-4\" />\r\n <div formGroupName=\"lockout\">\r\n <h4>{{ 'AbpIdentity::LockoutSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Lockout_AllowedForNewUsers\"\r\n name=\"Lockout.AllowedForNewUsers\"\r\n class=\"form-check-input\"\r\n formControlName=\"allowedForNewUsers\"\r\n /><label class=\"form-check-label\" for=\"Lockout_AllowedForNewUsers\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Lockout.AllowedForNewUsers' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Lockout.AllowedForNewUsers' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Lockout_LockoutDuration\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Lockout.LockoutDuration' | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Lockout_LockoutDuration\"\r\n name=\"Lockout.LockoutDuration\"\r\n class=\"form-control\"\r\n formControlName=\"lockoutDuration\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Lockout.LockoutDuration' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Lockout_MaxFailedAccessAttempts\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Lockout.MaxFailedAccessAttempts'\r\n | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Lockout_MaxFailedAccessAttempts\"\r\n name=\"Lockout.MaxFailedAccessAttempts\"\r\n class=\"form-control\"\r\n formControlName=\"maxFailedAccessAttempts\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Lockout.MaxFailedAccessAttempts'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n </div>\r\n <hr class=\"my-4\" />\r\n <div formGroupName=\"signIn\">\r\n <h4>{{ 'AbpIdentity::SignInSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"SignIn_RequireConfirmedEmail\"\r\n name=\"SignIn.RequireConfirmedEmail\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireConfirmedEmail\"\r\n /><label class=\"form-check-label\" for=\"SignIn_RequireConfirmedEmail\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.SignIn.RequireConfirmedEmail' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.SignIn.RequireConfirmedEmail' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"SignIn_EnablePhoneNumberConfirmation\"\r\n name=\"SignIn.EnablePhoneNumberConfirmation\"\r\n class=\"form-check-input\"\r\n formControlName=\"enablePhoneNumberConfirmation\"\r\n /><label class=\"form-check-label\" for=\"SignIn_EnablePhoneNumberConfirmation\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.SignIn.EnablePhoneNumberConfirmation'\r\n | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.SignIn.EnablePhoneNumberConfirmation'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"SignIn_RequireConfirmedPhoneNumber\"\r\n name=\"SignIn.RequireConfirmedPhoneNumber\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireConfirmedPhoneNumber\"\r\n /><label class=\"form-check-label\" for=\"SignIn_RequireConfirmedPhoneNumber\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.SignIn.RequireConfirmedPhoneNumber'\r\n | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n </div>\r\n <hr class=\"my-4\" />\r\n <div formGroupName=\"user\">\r\n <h4>{{ 'AbpIdentity::UserSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"User_IsEmailUpdateEnabled\"\r\n name=\"User.IsEmailUpdateEnabled\"\r\n class=\"form-check-input\"\r\n formControlName=\"isEmailUpdateEnabled\"\r\n /><label class=\"form-check-label\" for=\"User_IsEmailUpdateEnabled\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.User.IsEmailUpdateEnabled' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.User.IsEmailUpdateEnabled' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"User_IsUserNameUpdateEnabled\"\r\n name=\"User.IsUserNameUpdateEnabled\"\r\n class=\"form-check-input\"\r\n formControlName=\"isUserNameUpdateEnabled\"\r\n /><label class=\"form-check-label\" for=\"User_IsUserNameUpdateEnabled\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.User.IsUserNameUpdateEnabled' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.User.IsUserNameUpdateEnabled' | abpLocalization\r\n }}</small>\r\n </div>\r\n </div>\r\n <hr class=\"my-3\" />\r\n <div>\r\n <abp-button\r\n iconClass=\"fa fa-save\"\r\n [loading]=\"loading\"\r\n buttonType=\"submit\"\r\n [disabled]=\"form?.invalid\"\r\n >\r\n {{ 'AbpIdentity::Save' | abpLocalization }}\r\n </abp-button>\r\n </div>\r\n </div>\r\n </div>\r\n</form>\r\n", dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i3$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i6.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i6.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] });
|
|
132
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
133
|
-
type: Component,
|
|
134
|
-
args: [{ selector: 'abp-identity-setting', providers: [SubscriptionService], template: "\r\n<form\r\n class=\"py-2\"\r\n *ngIf=\"form\"\r\n id=\"IdentitySettingsForm\"\r\n [formGroup]=\"form\"\r\n (ngSubmit)=\"submit()\"\r\n validateOnSubmit\r\n>\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <div formGroupName=\"password\">\r\n <h4>{{ 'AbpIdentity::PasswordSettings' | abpLocalization }}</h4>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Password_RequiredLength\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequiredLength' | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Password_RequiredLength\"\r\n name=\"Password.RequiredLength\"\r\n class=\"form-control\"\r\n formControlName=\"requiredLength\"\r\n min=\"2\"\r\n max=\"32\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequiredLength' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Password_RequiredUniqueChars\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequiredUniqueChars' | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Password_RequiredUniqueChars\"\r\n name=\"Password.RequiredUniqueChars\"\r\n class=\"form-control\"\r\n formControlName=\"requiredUniqueChars\"\r\n min=\"0\"\r\n max=\"32\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequiredUniqueChars' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireNonAlphanumeric\"\r\n name=\"Password.RequireNonAlphanumeric\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireNonAlphanumeric\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireNonAlphanumeric\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireNonAlphanumeric'\r\n | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireNonAlphanumeric'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireLowercase\"\r\n name=\"Password.RequireLowercase\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireLowercase\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireLowercase\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireLowercase' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireLowercase' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireUppercase\"\r\n name=\"Password.RequireUppercase\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireUppercase\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireUppercase\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireUppercase' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireUppercase' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireDigit\"\r\n name=\"Password.RequireDigit\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireDigit\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireDigit\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireDigit' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireDigit' | abpLocalization\r\n }}</small>\r\n </div>\r\n\r\n <hr class=\"my-4\" />\r\n <h4>{{ 'AbpIdentity::PasswordRenewingSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_ForceUsersToPeriodicallyChangePassword\"\r\n name=\"Password.ForceUsersToPeriodicallyChangePassword\"\r\n class=\"form-check-input\"\r\n formControlName=\"forceUsersToPeriodicallyChangePassword\"\r\n />\r\n <label class=\"form-check-label\" for=\"Password_ForceUsersToPeriodicallyChangePassword\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.ForceUsersToPeriodicallyChangePassword'\r\n | abpLocalization\r\n }}</label>\r\n <br />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.ForceUsersToPeriodicallyChangePassword'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Password_PasswordChangePeriodDays\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.PasswordChangePeriodDays'\r\n | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Password_PasswordChangePeriodDays\"\r\n name=\"Password.PasswordChangePeriodDays\"\r\n class=\"form-control\"\r\n formControlName=\"passwordChangePeriodDays\"\r\n />\r\n <small\r\n class=\"form-text text-muted\"\r\n >{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.PasswordChangePeriodDays'\r\n | abpLocalization\r\n }}</small\r\n >\r\n </div>\r\n </div>\r\n <hr class=\"my-4\" />\r\n <div formGroupName=\"lockout\">\r\n <h4>{{ 'AbpIdentity::LockoutSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Lockout_AllowedForNewUsers\"\r\n name=\"Lockout.AllowedForNewUsers\"\r\n class=\"form-check-input\"\r\n formControlName=\"allowedForNewUsers\"\r\n /><label class=\"form-check-label\" for=\"Lockout_AllowedForNewUsers\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Lockout.AllowedForNewUsers' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Lockout.AllowedForNewUsers' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Lockout_LockoutDuration\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Lockout.LockoutDuration' | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Lockout_LockoutDuration\"\r\n name=\"Lockout.LockoutDuration\"\r\n class=\"form-control\"\r\n formControlName=\"lockoutDuration\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Lockout.LockoutDuration' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Lockout_MaxFailedAccessAttempts\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Lockout.MaxFailedAccessAttempts'\r\n | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Lockout_MaxFailedAccessAttempts\"\r\n name=\"Lockout.MaxFailedAccessAttempts\"\r\n class=\"form-control\"\r\n formControlName=\"maxFailedAccessAttempts\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Lockout.MaxFailedAccessAttempts'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n </div>\r\n <hr class=\"my-4\" />\r\n <div formGroupName=\"signIn\">\r\n <h4>{{ 'AbpIdentity::SignInSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"SignIn_RequireConfirmedEmail\"\r\n name=\"SignIn.RequireConfirmedEmail\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireConfirmedEmail\"\r\n /><label class=\"form-check-label\" for=\"SignIn_RequireConfirmedEmail\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.SignIn.RequireConfirmedEmail' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.SignIn.RequireConfirmedEmail' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"SignIn_EnablePhoneNumberConfirmation\"\r\n name=\"SignIn.EnablePhoneNumberConfirmation\"\r\n class=\"form-check-input\"\r\n formControlName=\"enablePhoneNumberConfirmation\"\r\n /><label class=\"form-check-label\" for=\"SignIn_EnablePhoneNumberConfirmation\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.SignIn.EnablePhoneNumberConfirmation'\r\n | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.SignIn.EnablePhoneNumberConfirmation'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"SignIn_RequireConfirmedPhoneNumber\"\r\n name=\"SignIn.RequireConfirmedPhoneNumber\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireConfirmedPhoneNumber\"\r\n /><label class=\"form-check-label\" for=\"SignIn_RequireConfirmedPhoneNumber\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.SignIn.RequireConfirmedPhoneNumber'\r\n | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n </div>\r\n <hr class=\"my-4\" />\r\n <div formGroupName=\"user\">\r\n <h4>{{ 'AbpIdentity::UserSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"User_IsEmailUpdateEnabled\"\r\n name=\"User.IsEmailUpdateEnabled\"\r\n class=\"form-check-input\"\r\n formControlName=\"isEmailUpdateEnabled\"\r\n /><label class=\"form-check-label\" for=\"User_IsEmailUpdateEnabled\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.User.IsEmailUpdateEnabled' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.User.IsEmailUpdateEnabled' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"User_IsUserNameUpdateEnabled\"\r\n name=\"User.IsUserNameUpdateEnabled\"\r\n class=\"form-check-input\"\r\n formControlName=\"isUserNameUpdateEnabled\"\r\n /><label class=\"form-check-label\" for=\"User_IsUserNameUpdateEnabled\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.User.IsUserNameUpdateEnabled' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.User.IsUserNameUpdateEnabled' | abpLocalization\r\n }}</small>\r\n </div>\r\n </div>\r\n <hr class=\"my-3\" />\r\n <div>\r\n <abp-button\r\n iconClass=\"fa fa-save\"\r\n [loading]=\"loading\"\r\n buttonType=\"submit\"\r\n [disabled]=\"form?.invalid\"\r\n >\r\n {{ 'AbpIdentity::Save' | abpLocalization }}\r\n </abp-button>\r\n </div>\r\n </div>\r\n </div>\r\n</form>\r\n" }]
|
|
54
|
+
const { required, max, min } = Validators;
|
|
55
|
+
class IdentitySettingComponent {
|
|
56
|
+
constructor(identityConfigService, toaster, fb, subscription, configState) {
|
|
57
|
+
this.identityConfigService = identityConfigService;
|
|
58
|
+
this.toaster = toaster;
|
|
59
|
+
this.fb = fb;
|
|
60
|
+
this.subscription = subscription;
|
|
61
|
+
this.configState = configState;
|
|
62
|
+
this.settings = {};
|
|
63
|
+
this.doNotRequireConfirmedPhoneNumber = () => {
|
|
64
|
+
this.form.get('signIn.requireConfirmedPhoneNumber').setValue(false);
|
|
65
|
+
};
|
|
66
|
+
this.enablePhoneNumberConfirmation = () => {
|
|
67
|
+
this.form.get('signIn.enablePhoneNumberConfirmation').setValue(true);
|
|
68
|
+
};
|
|
69
|
+
identityConfigService.getSettings().subscribe(settings => {
|
|
70
|
+
this.settings = settings;
|
|
71
|
+
this.buildForm();
|
|
72
|
+
this.syncConfirmationOptions();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
buildForm() {
|
|
76
|
+
const passwordSettings = this.settings?.password || {};
|
|
77
|
+
const password = this.fb.group({
|
|
78
|
+
requiredLength: [passwordSettings.requiredLength, [required, max(32), min(2)]],
|
|
79
|
+
requiredUniqueChars: [passwordSettings.requiredUniqueChars, [required, max(32), min(1)]],
|
|
80
|
+
requireNonAlphanumeric: passwordSettings.requireNonAlphanumeric,
|
|
81
|
+
requireLowercase: passwordSettings.requireLowercase,
|
|
82
|
+
requireUppercase: passwordSettings.requireUppercase,
|
|
83
|
+
requireDigit: passwordSettings.requireDigit,
|
|
84
|
+
forceUsersToPeriodicallyChangePassword: passwordSettings.forceUsersToPeriodicallyChangePassword,
|
|
85
|
+
passwordChangePeriodDays: [passwordSettings.passwordChangePeriodDays, [required, min(0)]],
|
|
86
|
+
});
|
|
87
|
+
const lockoutSettings = this.settings?.lockout || {};
|
|
88
|
+
const lockout = this.fb.group({
|
|
89
|
+
allowedForNewUsers: lockoutSettings.allowedForNewUsers,
|
|
90
|
+
lockoutDuration: [lockoutSettings.lockoutDuration, [required]],
|
|
91
|
+
maxFailedAccessAttempts: [lockoutSettings.maxFailedAccessAttempts, [required]],
|
|
92
|
+
});
|
|
93
|
+
const signInSettings = this.settings?.signIn || {};
|
|
94
|
+
const signIn = this.fb.group({
|
|
95
|
+
requireConfirmedEmail: signInSettings.requireConfirmedEmail,
|
|
96
|
+
enablePhoneNumberConfirmation: signInSettings.enablePhoneNumberConfirmation,
|
|
97
|
+
requireConfirmedPhoneNumber: signInSettings.requireConfirmedPhoneNumber,
|
|
98
|
+
});
|
|
99
|
+
const userSettings = this.settings?.user || {};
|
|
100
|
+
const user = this.fb.group({
|
|
101
|
+
isUserNameUpdateEnabled: userSettings.isUserNameUpdateEnabled,
|
|
102
|
+
isEmailUpdateEnabled: userSettings.isEmailUpdateEnabled,
|
|
103
|
+
});
|
|
104
|
+
this.form = this.fb.group({
|
|
105
|
+
password,
|
|
106
|
+
lockout,
|
|
107
|
+
signIn,
|
|
108
|
+
user,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
syncConfirmationOptions() {
|
|
112
|
+
this.subscription.addOne(this.form.get('signIn.requireConfirmedPhoneNumber').valueChanges.pipe(filter(Boolean)), this.enablePhoneNumberConfirmation);
|
|
113
|
+
this.subscription.addOne(this.form
|
|
114
|
+
.get('signIn.enablePhoneNumberConfirmation')
|
|
115
|
+
.valueChanges.pipe(filter(value => !value)), this.doNotRequireConfirmedPhoneNumber);
|
|
116
|
+
}
|
|
117
|
+
submit() {
|
|
118
|
+
if (this.loading || this.form?.invalid)
|
|
119
|
+
return;
|
|
120
|
+
this.loading = true;
|
|
121
|
+
this.identityConfigService
|
|
122
|
+
.updateSettings(this.form.value)
|
|
123
|
+
.pipe(finalize(() => {
|
|
124
|
+
this.loading = false;
|
|
125
|
+
this.configState.refreshAppState().subscribe();
|
|
126
|
+
}))
|
|
127
|
+
.subscribe(() => this.toaster.success('AbpIdentity::SavedSuccessfully', null));
|
|
128
|
+
}
|
|
129
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentitySettingComponent, deps: [{ token: IdentityConfigService }, { token: i2.ToasterService }, { token: i3$1.UntypedFormBuilder }, { token: i3.SubscriptionService }, { token: i3.ConfigStateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
130
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: IdentitySettingComponent, selector: "abp-identity-setting", providers: [SubscriptionService], ngImport: i0, template: "\r\n<form\r\n class=\"py-2\"\r\n *ngIf=\"form\"\r\n id=\"IdentitySettingsForm\"\r\n [formGroup]=\"form\"\r\n (ngSubmit)=\"submit()\"\r\n validateOnSubmit\r\n>\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <div formGroupName=\"password\">\r\n <h4>{{ 'AbpIdentity::PasswordSettings' | abpLocalization }}</h4>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Password_RequiredLength\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequiredLength' | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Password_RequiredLength\"\r\n name=\"Password.RequiredLength\"\r\n class=\"form-control\"\r\n formControlName=\"requiredLength\"\r\n min=\"2\"\r\n max=\"32\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequiredLength' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Password_RequiredUniqueChars\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequiredUniqueChars' | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Password_RequiredUniqueChars\"\r\n name=\"Password.RequiredUniqueChars\"\r\n class=\"form-control\"\r\n formControlName=\"requiredUniqueChars\"\r\n min=\"0\"\r\n max=\"32\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequiredUniqueChars' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireNonAlphanumeric\"\r\n name=\"Password.RequireNonAlphanumeric\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireNonAlphanumeric\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireNonAlphanumeric\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireNonAlphanumeric'\r\n | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireNonAlphanumeric'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireLowercase\"\r\n name=\"Password.RequireLowercase\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireLowercase\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireLowercase\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireLowercase' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireLowercase' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireUppercase\"\r\n name=\"Password.RequireUppercase\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireUppercase\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireUppercase\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireUppercase' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireUppercase' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireDigit\"\r\n name=\"Password.RequireDigit\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireDigit\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireDigit\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireDigit' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireDigit' | abpLocalization\r\n }}</small>\r\n </div>\r\n\r\n <hr class=\"my-4\" />\r\n <h4>{{ 'AbpIdentity::PasswordRenewingSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_ForceUsersToPeriodicallyChangePassword\"\r\n name=\"Password.ForceUsersToPeriodicallyChangePassword\"\r\n class=\"form-check-input\"\r\n formControlName=\"forceUsersToPeriodicallyChangePassword\"\r\n />\r\n <label class=\"form-check-label\" for=\"Password_ForceUsersToPeriodicallyChangePassword\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.ForceUsersToPeriodicallyChangePassword'\r\n | abpLocalization\r\n }}</label>\r\n <br />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.ForceUsersToPeriodicallyChangePassword'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Password_PasswordChangePeriodDays\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.PasswordChangePeriodDays'\r\n | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Password_PasswordChangePeriodDays\"\r\n name=\"Password.PasswordChangePeriodDays\"\r\n class=\"form-control\"\r\n formControlName=\"passwordChangePeriodDays\"\r\n />\r\n <small\r\n class=\"form-text text-muted\"\r\n >{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.PasswordChangePeriodDays'\r\n | abpLocalization\r\n }}</small\r\n >\r\n </div>\r\n </div>\r\n <hr class=\"my-4\" />\r\n <div formGroupName=\"lockout\">\r\n <h4>{{ 'AbpIdentity::LockoutSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Lockout_AllowedForNewUsers\"\r\n name=\"Lockout.AllowedForNewUsers\"\r\n class=\"form-check-input\"\r\n formControlName=\"allowedForNewUsers\"\r\n /><label class=\"form-check-label\" for=\"Lockout_AllowedForNewUsers\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Lockout.AllowedForNewUsers' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Lockout.AllowedForNewUsers' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Lockout_LockoutDuration\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Lockout.LockoutDuration' | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Lockout_LockoutDuration\"\r\n name=\"Lockout.LockoutDuration\"\r\n class=\"form-control\"\r\n formControlName=\"lockoutDuration\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Lockout.LockoutDuration' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Lockout_MaxFailedAccessAttempts\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Lockout.MaxFailedAccessAttempts'\r\n | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Lockout_MaxFailedAccessAttempts\"\r\n name=\"Lockout.MaxFailedAccessAttempts\"\r\n class=\"form-control\"\r\n formControlName=\"maxFailedAccessAttempts\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Lockout.MaxFailedAccessAttempts'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n </div>\r\n <hr class=\"my-4\" />\r\n <div formGroupName=\"signIn\">\r\n <h4>{{ 'AbpIdentity::SignInSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"SignIn_RequireConfirmedEmail\"\r\n name=\"SignIn.RequireConfirmedEmail\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireConfirmedEmail\"\r\n /><label class=\"form-check-label\" for=\"SignIn_RequireConfirmedEmail\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.SignIn.RequireConfirmedEmail' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.SignIn.RequireConfirmedEmail' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"SignIn_EnablePhoneNumberConfirmation\"\r\n name=\"SignIn.EnablePhoneNumberConfirmation\"\r\n class=\"form-check-input\"\r\n formControlName=\"enablePhoneNumberConfirmation\"\r\n /><label class=\"form-check-label\" for=\"SignIn_EnablePhoneNumberConfirmation\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.SignIn.EnablePhoneNumberConfirmation'\r\n | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.SignIn.EnablePhoneNumberConfirmation'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"SignIn_RequireConfirmedPhoneNumber\"\r\n name=\"SignIn.RequireConfirmedPhoneNumber\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireConfirmedPhoneNumber\"\r\n /><label class=\"form-check-label\" for=\"SignIn_RequireConfirmedPhoneNumber\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.SignIn.RequireConfirmedPhoneNumber'\r\n | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n </div>\r\n <hr class=\"my-4\" />\r\n <div formGroupName=\"user\">\r\n <h4>{{ 'AbpIdentity::UserSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"User_IsEmailUpdateEnabled\"\r\n name=\"User.IsEmailUpdateEnabled\"\r\n class=\"form-check-input\"\r\n formControlName=\"isEmailUpdateEnabled\"\r\n /><label class=\"form-check-label\" for=\"User_IsEmailUpdateEnabled\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.User.IsEmailUpdateEnabled' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.User.IsEmailUpdateEnabled' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"User_IsUserNameUpdateEnabled\"\r\n name=\"User.IsUserNameUpdateEnabled\"\r\n class=\"form-check-input\"\r\n formControlName=\"isUserNameUpdateEnabled\"\r\n /><label class=\"form-check-label\" for=\"User_IsUserNameUpdateEnabled\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.User.IsUserNameUpdateEnabled' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.User.IsUserNameUpdateEnabled' | abpLocalization\r\n }}</small>\r\n </div>\r\n </div>\r\n <hr class=\"my-3\" />\r\n <div>\r\n <abp-button\r\n iconClass=\"fa fa-save\"\r\n [loading]=\"loading\"\r\n buttonType=\"submit\"\r\n [disabled]=\"form?.invalid\"\r\n >\r\n {{ 'AbpIdentity::Save' | abpLocalization }}\r\n </abp-button>\r\n </div>\r\n </div>\r\n </div>\r\n</form>\r\n", dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i3$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i6.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i6.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
131
|
+
}
|
|
132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentitySettingComponent, decorators: [{
|
|
133
|
+
type: Component,
|
|
134
|
+
args: [{ selector: 'abp-identity-setting', providers: [SubscriptionService], template: "\r\n<form\r\n class=\"py-2\"\r\n *ngIf=\"form\"\r\n id=\"IdentitySettingsForm\"\r\n [formGroup]=\"form\"\r\n (ngSubmit)=\"submit()\"\r\n validateOnSubmit\r\n>\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <div formGroupName=\"password\">\r\n <h4>{{ 'AbpIdentity::PasswordSettings' | abpLocalization }}</h4>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Password_RequiredLength\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequiredLength' | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Password_RequiredLength\"\r\n name=\"Password.RequiredLength\"\r\n class=\"form-control\"\r\n formControlName=\"requiredLength\"\r\n min=\"2\"\r\n max=\"32\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequiredLength' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Password_RequiredUniqueChars\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequiredUniqueChars' | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Password_RequiredUniqueChars\"\r\n name=\"Password.RequiredUniqueChars\"\r\n class=\"form-control\"\r\n formControlName=\"requiredUniqueChars\"\r\n min=\"0\"\r\n max=\"32\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequiredUniqueChars' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireNonAlphanumeric\"\r\n name=\"Password.RequireNonAlphanumeric\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireNonAlphanumeric\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireNonAlphanumeric\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireNonAlphanumeric'\r\n | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireNonAlphanumeric'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireLowercase\"\r\n name=\"Password.RequireLowercase\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireLowercase\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireLowercase\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireLowercase' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireLowercase' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireUppercase\"\r\n name=\"Password.RequireUppercase\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireUppercase\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireUppercase\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireUppercase' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireUppercase' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_RequireDigit\"\r\n name=\"Password.RequireDigit\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireDigit\"\r\n /><label class=\"form-check-label\" for=\"Password_RequireDigit\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.RequireDigit' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.RequireDigit' | abpLocalization\r\n }}</small>\r\n </div>\r\n\r\n <hr class=\"my-4\" />\r\n <h4>{{ 'AbpIdentity::PasswordRenewingSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Password_ForceUsersToPeriodicallyChangePassword\"\r\n name=\"Password.ForceUsersToPeriodicallyChangePassword\"\r\n class=\"form-check-input\"\r\n formControlName=\"forceUsersToPeriodicallyChangePassword\"\r\n />\r\n <label class=\"form-check-label\" for=\"Password_ForceUsersToPeriodicallyChangePassword\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.ForceUsersToPeriodicallyChangePassword'\r\n | abpLocalization\r\n }}</label>\r\n <br />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.ForceUsersToPeriodicallyChangePassword'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Password_PasswordChangePeriodDays\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Password.PasswordChangePeriodDays'\r\n | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Password_PasswordChangePeriodDays\"\r\n name=\"Password.PasswordChangePeriodDays\"\r\n class=\"form-control\"\r\n formControlName=\"passwordChangePeriodDays\"\r\n />\r\n <small\r\n class=\"form-text text-muted\"\r\n >{{\r\n 'AbpIdentity::Description:Abp.Identity.Password.PasswordChangePeriodDays'\r\n | abpLocalization\r\n }}</small\r\n >\r\n </div>\r\n </div>\r\n <hr class=\"my-4\" />\r\n <div formGroupName=\"lockout\">\r\n <h4>{{ 'AbpIdentity::LockoutSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"Lockout_AllowedForNewUsers\"\r\n name=\"Lockout.AllowedForNewUsers\"\r\n class=\"form-check-input\"\r\n formControlName=\"allowedForNewUsers\"\r\n /><label class=\"form-check-label\" for=\"Lockout_AllowedForNewUsers\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Lockout.AllowedForNewUsers' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Lockout.AllowedForNewUsers' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Lockout_LockoutDuration\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Lockout.LockoutDuration' | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Lockout_LockoutDuration\"\r\n name=\"Lockout.LockoutDuration\"\r\n class=\"form-control\"\r\n formControlName=\"lockoutDuration\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Lockout.LockoutDuration' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"Lockout_MaxFailedAccessAttempts\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Lockout.MaxFailedAccessAttempts'\r\n | abpLocalization\r\n }}</label\r\n ><input\r\n type=\"number\"\r\n id=\"Lockout_MaxFailedAccessAttempts\"\r\n name=\"Lockout.MaxFailedAccessAttempts\"\r\n class=\"form-control\"\r\n formControlName=\"maxFailedAccessAttempts\"\r\n />\r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.Lockout.MaxFailedAccessAttempts'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n </div>\r\n <hr class=\"my-4\" />\r\n <div formGroupName=\"signIn\">\r\n <h4>{{ 'AbpIdentity::SignInSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"SignIn_RequireConfirmedEmail\"\r\n name=\"SignIn.RequireConfirmedEmail\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireConfirmedEmail\"\r\n /><label class=\"form-check-label\" for=\"SignIn_RequireConfirmedEmail\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.SignIn.RequireConfirmedEmail' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.SignIn.RequireConfirmedEmail' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"SignIn_EnablePhoneNumberConfirmation\"\r\n name=\"SignIn.EnablePhoneNumberConfirmation\"\r\n class=\"form-check-input\"\r\n formControlName=\"enablePhoneNumberConfirmation\"\r\n /><label class=\"form-check-label\" for=\"SignIn_EnablePhoneNumberConfirmation\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.SignIn.EnablePhoneNumberConfirmation'\r\n | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.SignIn.EnablePhoneNumberConfirmation'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"SignIn_RequireConfirmedPhoneNumber\"\r\n name=\"SignIn.RequireConfirmedPhoneNumber\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireConfirmedPhoneNumber\"\r\n /><label class=\"form-check-label\" for=\"SignIn_RequireConfirmedPhoneNumber\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.SignIn.RequireConfirmedPhoneNumber'\r\n | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber'\r\n | abpLocalization\r\n }}</small>\r\n </div>\r\n </div>\r\n <hr class=\"my-4\" />\r\n <div formGroupName=\"user\">\r\n <h4>{{ 'AbpIdentity::UserSettings' | abpLocalization }}</h4>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"User_IsEmailUpdateEnabled\"\r\n name=\"User.IsEmailUpdateEnabled\"\r\n class=\"form-check-input\"\r\n formControlName=\"isEmailUpdateEnabled\"\r\n /><label class=\"form-check-label\" for=\"User_IsEmailUpdateEnabled\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.User.IsEmailUpdateEnabled' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.User.IsEmailUpdateEnabled' | abpLocalization\r\n }}</small>\r\n </div>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"User_IsUserNameUpdateEnabled\"\r\n name=\"User.IsUserNameUpdateEnabled\"\r\n class=\"form-check-input\"\r\n formControlName=\"isUserNameUpdateEnabled\"\r\n /><label class=\"form-check-label\" for=\"User_IsUserNameUpdateEnabled\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.User.IsUserNameUpdateEnabled' | abpLocalization\r\n }}</label>\r\n \r\n <small class=\"form-text text-muted\">{{\r\n 'AbpIdentity::Description:Abp.Identity.User.IsUserNameUpdateEnabled' | abpLocalization\r\n }}</small>\r\n </div>\r\n </div>\r\n <hr class=\"my-3\" />\r\n <div>\r\n <abp-button\r\n iconClass=\"fa fa-save\"\r\n [loading]=\"loading\"\r\n buttonType=\"submit\"\r\n [disabled]=\"form?.invalid\"\r\n >\r\n {{ 'AbpIdentity::Save' | abpLocalization }}\r\n </abp-button>\r\n </div>\r\n </div>\r\n </div>\r\n</form>\r\n" }]
|
|
135
135
|
}], ctorParameters: function () { return [{ type: IdentityConfigService }, { type: i2.ToasterService }, { type: i3$1.UntypedFormBuilder }, { type: i3.SubscriptionService }, { type: i3.ConfigStateService }]; } });
|
|
136
136
|
|
|
137
|
-
class IdentityExternalLoginSettingsComponent {
|
|
138
|
-
constructor(service, toaster, configState, fb) {
|
|
139
|
-
this.service = service;
|
|
140
|
-
this.toaster = toaster;
|
|
141
|
-
this.configState = configState;
|
|
142
|
-
this.fb = fb;
|
|
143
|
-
this.loading = false;
|
|
144
|
-
}
|
|
145
|
-
ngOnInit() {
|
|
146
|
-
this.service.getOAuth().subscribe(settings => {
|
|
147
|
-
this.settings = settings;
|
|
148
|
-
this.buildForm();
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
submit() {
|
|
152
|
-
if (this.form.invalid) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
this.loading = true;
|
|
156
|
-
this.service
|
|
157
|
-
.updateOAuth(this.form.value)
|
|
158
|
-
.pipe(finalize(() => (this.loading = false)))
|
|
159
|
-
.subscribe(() => {
|
|
160
|
-
this.toaster.success('AbpSettingManagement::SuccessfullySaved', null);
|
|
161
|
-
this.configState.refreshAppState().subscribe();
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
buildForm() {
|
|
165
|
-
this.form = this.fb.group({
|
|
166
|
-
enableOAuthLogin: [this.settings.enableOAuthLogin, []],
|
|
167
|
-
clientId: [this.settings.clientId, [Validators.required]],
|
|
168
|
-
clientSecret: [this.settings.clientSecret, []],
|
|
169
|
-
authority: [this.settings.authority, [Validators.required]],
|
|
170
|
-
scope: [this.settings.scope, []],
|
|
171
|
-
requireHttpsMetadata: [this.settings.requireHttpsMetadata, []],
|
|
172
|
-
validateIssuerName: [this.settings.validateIssuerName, []],
|
|
173
|
-
validateEndpoints: [this.settings.validateEndpoints, []],
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
180
|
-
type: Component,
|
|
181
|
-
args: [{ selector: 'abp-external-login-settings', template: "<ng-container *ngIf=\"settings\">\r\n <h4>{{ 'AbpIdentity::OAuthLoginSettings' | abpLocalization }}</h4>\r\n\r\n <form [formGroup]=\"form\" (ngSubmit)=\"submit()\" validateOnSubmit>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"enable-oauth-login\"\r\n class=\"form-check-input\"\r\n formControlName=\"enableOAuthLogin\"\r\n autofocus\r\n /><label class=\"form-check-label\" for=\"enable-oauth-login\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.EnableOAuthLogin' | abpLocalization\r\n }}</label>\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.ClientId' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"clientId\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.ClientSecret' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"clientSecret\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Authority' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"authority\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Scope' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"scope\" />\r\n </div>\r\n\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"require-https-metadata\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireHttpsMetadata\"\r\n /><label class=\"form-check-label\" for=\"require-https-metadata\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.RequireHttpsMetadata' | abpLocalization\r\n }}</label>\r\n </div>\r\n\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"validate-endpoints\"\r\n class=\"form-check-input\"\r\n formControlName=\"validateEndpoints\"\r\n /><label class=\"form-check-label\" for=\"validate-endpoints\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.ValidateEndpoints' | abpLocalization\r\n }}</label>\r\n </div>\r\n\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"validate-issuer-name\"\r\n class=\"form-check-input\"\r\n formControlName=\"validateIssuerName\"\r\n /><label class=\"form-check-label\" for=\"validate-issuer-name\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.ValidateIssuerName' | abpLocalization\r\n }}</label>\r\n </div>\r\n <hr class=\"my-3\" />\r\n\r\n <div>\r\n <abp-button\r\n buttonType=\"submit\"\r\n iconClass=\"fa fa-save\"\r\n [loading]=\"loading\"\r\n [disabled]=\"form.invalid\"\r\n >{{ 'AbpAccount::Save' | abpLocalization }}</abp-button\r\n >\r\n </div>\r\n </form>\r\n</ng-container>\r\n" }]
|
|
137
|
+
class IdentityExternalLoginSettingsComponent {
|
|
138
|
+
constructor(service, toaster, configState, fb) {
|
|
139
|
+
this.service = service;
|
|
140
|
+
this.toaster = toaster;
|
|
141
|
+
this.configState = configState;
|
|
142
|
+
this.fb = fb;
|
|
143
|
+
this.loading = false;
|
|
144
|
+
}
|
|
145
|
+
ngOnInit() {
|
|
146
|
+
this.service.getOAuth().subscribe(settings => {
|
|
147
|
+
this.settings = settings;
|
|
148
|
+
this.buildForm();
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
submit() {
|
|
152
|
+
if (this.form.invalid) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
this.loading = true;
|
|
156
|
+
this.service
|
|
157
|
+
.updateOAuth(this.form.value)
|
|
158
|
+
.pipe(finalize(() => (this.loading = false)))
|
|
159
|
+
.subscribe(() => {
|
|
160
|
+
this.toaster.success('AbpSettingManagement::SuccessfullySaved', null);
|
|
161
|
+
this.configState.refreshAppState().subscribe();
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
buildForm() {
|
|
165
|
+
this.form = this.fb.group({
|
|
166
|
+
enableOAuthLogin: [this.settings.enableOAuthLogin, []],
|
|
167
|
+
clientId: [this.settings.clientId, [Validators.required]],
|
|
168
|
+
clientSecret: [this.settings.clientSecret, []],
|
|
169
|
+
authority: [this.settings.authority, [Validators.required]],
|
|
170
|
+
scope: [this.settings.scope, []],
|
|
171
|
+
requireHttpsMetadata: [this.settings.requireHttpsMetadata, []],
|
|
172
|
+
validateIssuerName: [this.settings.validateIssuerName, []],
|
|
173
|
+
validateEndpoints: [this.settings.validateEndpoints, []],
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentityExternalLoginSettingsComponent, deps: [{ token: i1.IdentitySettingsService }, { token: i2.ToasterService }, { token: i3.ConfigStateService }, { token: i3$1.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
177
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: IdentityExternalLoginSettingsComponent, selector: "abp-external-login-settings", ngImport: i0, template: "<ng-container *ngIf=\"settings\">\r\n <h4>{{ 'AbpIdentity::OAuthLoginSettings' | abpLocalization }}</h4>\r\n\r\n <form [formGroup]=\"form\" (ngSubmit)=\"submit()\" validateOnSubmit>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"enable-oauth-login\"\r\n class=\"form-check-input\"\r\n formControlName=\"enableOAuthLogin\"\r\n autofocus\r\n /><label class=\"form-check-label\" for=\"enable-oauth-login\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.EnableOAuthLogin' | abpLocalization\r\n }}</label>\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.ClientId' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"clientId\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.ClientSecret' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"clientSecret\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Authority' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"authority\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Scope' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"scope\" />\r\n </div>\r\n\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"require-https-metadata\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireHttpsMetadata\"\r\n /><label class=\"form-check-label\" for=\"require-https-metadata\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.RequireHttpsMetadata' | abpLocalization\r\n }}</label>\r\n </div>\r\n\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"validate-endpoints\"\r\n class=\"form-check-input\"\r\n formControlName=\"validateEndpoints\"\r\n /><label class=\"form-check-label\" for=\"validate-endpoints\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.ValidateEndpoints' | abpLocalization\r\n }}</label>\r\n </div>\r\n\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"validate-issuer-name\"\r\n class=\"form-check-input\"\r\n formControlName=\"validateIssuerName\"\r\n /><label class=\"form-check-label\" for=\"validate-issuer-name\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.ValidateIssuerName' | abpLocalization\r\n }}</label>\r\n </div>\r\n <hr class=\"my-3\" />\r\n\r\n <div>\r\n <abp-button\r\n buttonType=\"submit\"\r\n iconClass=\"fa fa-save\"\r\n [loading]=\"loading\"\r\n [disabled]=\"form.invalid\"\r\n >{{ 'AbpAccount::Save' | abpLocalization }}</abp-button\r\n >\r\n </div>\r\n </form>\r\n</ng-container>\r\n", dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3.AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }, { kind: "directive", type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i6.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i6.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
178
|
+
}
|
|
179
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentityExternalLoginSettingsComponent, decorators: [{
|
|
180
|
+
type: Component,
|
|
181
|
+
args: [{ selector: 'abp-external-login-settings', template: "<ng-container *ngIf=\"settings\">\r\n <h4>{{ 'AbpIdentity::OAuthLoginSettings' | abpLocalization }}</h4>\r\n\r\n <form [formGroup]=\"form\" (ngSubmit)=\"submit()\" validateOnSubmit>\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"enable-oauth-login\"\r\n class=\"form-check-input\"\r\n formControlName=\"enableOAuthLogin\"\r\n autofocus\r\n /><label class=\"form-check-label\" for=\"enable-oauth-login\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.EnableOAuthLogin' | abpLocalization\r\n }}</label>\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.ClientId' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"clientId\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.ClientSecret' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"clientSecret\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Authority' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"authority\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.Scope' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"scope\" />\r\n </div>\r\n\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"require-https-metadata\"\r\n class=\"form-check-input\"\r\n formControlName=\"requireHttpsMetadata\"\r\n /><label class=\"form-check-label\" for=\"require-https-metadata\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.RequireHttpsMetadata' | abpLocalization\r\n }}</label>\r\n </div>\r\n\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"validate-endpoints\"\r\n class=\"form-check-input\"\r\n formControlName=\"validateEndpoints\"\r\n /><label class=\"form-check-label\" for=\"validate-endpoints\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.ValidateEndpoints' | abpLocalization\r\n }}</label>\r\n </div>\r\n\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"validate-issuer-name\"\r\n class=\"form-check-input\"\r\n formControlName=\"validateIssuerName\"\r\n /><label class=\"form-check-label\" for=\"validate-issuer-name\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.ValidateIssuerName' | abpLocalization\r\n }}</label>\r\n </div>\r\n <hr class=\"my-3\" />\r\n\r\n <div>\r\n <abp-button\r\n buttonType=\"submit\"\r\n iconClass=\"fa fa-save\"\r\n [loading]=\"loading\"\r\n [disabled]=\"form.invalid\"\r\n >{{ 'AbpAccount::Save' | abpLocalization }}</abp-button\r\n >\r\n </div>\r\n </form>\r\n</ng-container>\r\n" }]
|
|
182
182
|
}], ctorParameters: function () { return [{ type: i1.IdentitySettingsService }, { type: i2.ToasterService }, { type: i3.ConfigStateService }, { type: i3$1.UntypedFormBuilder }]; } });
|
|
183
183
|
|
|
184
|
-
class IdentityLdapSettingsComponent {
|
|
185
|
-
constructor(service, toaster, configState) {
|
|
186
|
-
this.service = service;
|
|
187
|
-
this.toaster = toaster;
|
|
188
|
-
this.configState = configState;
|
|
189
|
-
this.loading = false;
|
|
190
|
-
}
|
|
191
|
-
ngOnInit() {
|
|
192
|
-
this.service.getLdap().subscribe(settings => (this.settings = settings));
|
|
193
|
-
}
|
|
194
|
-
submit(settings) {
|
|
195
|
-
this.loading = true;
|
|
196
|
-
this.service
|
|
197
|
-
.updateLdap(settings)
|
|
198
|
-
.pipe(finalize(() => (this.loading = false)))
|
|
199
|
-
.subscribe(() => {
|
|
200
|
-
this.toaster.success('AbpSettingManagement::SuccessfullySaved', null);
|
|
201
|
-
this.configState.refreshAppState().subscribe();
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
208
|
-
type: Component,
|
|
209
|
-
args: [{ selector: 'abp-ldap-login-settings', template: "<ng-container *ngIf=\"settings\">\r\n <h4>{{ 'AbpIdentity::LdapLoginSettings' | abpLocalization }}</h4>\r\n <div id=\"ldap-login-settings\" (keyup.enter)=\"submit(settings)\">\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"enable-ldap-login\"\r\n class=\"form-check-input\"\r\n [(ngModel)]=\"settings.enableLdapLogin\"\r\n autofocus\r\n /><label class=\"form-check-label\" for=\"enable-ldap-login\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.EnableLdapLogin' | abpLocalization\r\n }}</label>\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.ServerHost' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapServerHost\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.ServerPort' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapServerPort\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.BaseDc' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapBaseDc\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.Domain' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapDomain\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.UserName' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapUserName\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.Password' | abpLocalization\r\n }}</label>\r\n <input\r\n type=\"password\"\r\n class=\"form-control\"\r\n placeholder=\"{{ 'AbpIdentity::LdapPasswordPlaceholder' | abpLocalization }}\"\r\n [(ngModel)]=\"settings.ldapPassword\"\r\n autocomplete=\"new-password\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <hr class=\"my-3\" />\r\n\r\n <div>\r\n <abp-button (click)=\"submit(settings)\" iconClass=\"fa fa-save\" [loading]=\"loading\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </div>\r\n</ng-container>\r\n" }]
|
|
184
|
+
class IdentityLdapSettingsComponent {
|
|
185
|
+
constructor(service, toaster, configState) {
|
|
186
|
+
this.service = service;
|
|
187
|
+
this.toaster = toaster;
|
|
188
|
+
this.configState = configState;
|
|
189
|
+
this.loading = false;
|
|
190
|
+
}
|
|
191
|
+
ngOnInit() {
|
|
192
|
+
this.service.getLdap().subscribe(settings => (this.settings = settings));
|
|
193
|
+
}
|
|
194
|
+
submit(settings) {
|
|
195
|
+
this.loading = true;
|
|
196
|
+
this.service
|
|
197
|
+
.updateLdap(settings)
|
|
198
|
+
.pipe(finalize(() => (this.loading = false)))
|
|
199
|
+
.subscribe(() => {
|
|
200
|
+
this.toaster.success('AbpSettingManagement::SuccessfullySaved', null);
|
|
201
|
+
this.configState.refreshAppState().subscribe();
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentityLdapSettingsComponent, deps: [{ token: i1.IdentitySettingsService }, { token: i2.ToasterService }, { token: i3.ConfigStateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
205
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: IdentityLdapSettingsComponent, selector: "abp-ldap-login-settings", ngImport: i0, template: "<ng-container *ngIf=\"settings\">\r\n <h4>{{ 'AbpIdentity::LdapLoginSettings' | abpLocalization }}</h4>\r\n <div id=\"ldap-login-settings\" (keyup.enter)=\"submit(settings)\">\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"enable-ldap-login\"\r\n class=\"form-check-input\"\r\n [(ngModel)]=\"settings.enableLdapLogin\"\r\n autofocus\r\n /><label class=\"form-check-label\" for=\"enable-ldap-login\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.EnableLdapLogin' | abpLocalization\r\n }}</label>\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.ServerHost' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapServerHost\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.ServerPort' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapServerPort\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.BaseDc' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapBaseDc\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.Domain' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapDomain\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.UserName' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapUserName\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.Password' | abpLocalization\r\n }}</label>\r\n <input\r\n type=\"password\"\r\n class=\"form-control\"\r\n placeholder=\"{{ 'AbpIdentity::LdapPasswordPlaceholder' | abpLocalization }}\"\r\n [(ngModel)]=\"settings.ldapPassword\"\r\n autocomplete=\"new-password\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <hr class=\"my-3\" />\r\n\r\n <div>\r\n <abp-button (click)=\"submit(settings)\" iconClass=\"fa fa-save\" [loading]=\"loading\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </div>\r\n</ng-container>\r\n", dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }, { kind: "component", type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
206
|
+
}
|
|
207
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentityLdapSettingsComponent, decorators: [{
|
|
208
|
+
type: Component,
|
|
209
|
+
args: [{ selector: 'abp-ldap-login-settings', template: "<ng-container *ngIf=\"settings\">\r\n <h4>{{ 'AbpIdentity::LdapLoginSettings' | abpLocalization }}</h4>\r\n <div id=\"ldap-login-settings\" (keyup.enter)=\"submit(settings)\">\r\n <div class=\"form-check mb-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"enable-ldap-login\"\r\n class=\"form-check-input\"\r\n [(ngModel)]=\"settings.enableLdapLogin\"\r\n autofocus\r\n /><label class=\"form-check-label\" for=\"enable-ldap-login\">{{\r\n 'AbpIdentity::DisplayName:Abp.Identity.EnableLdapLogin' | abpLocalization\r\n }}</label>\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.ServerHost' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapServerHost\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.ServerPort' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapServerPort\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.BaseDc' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapBaseDc\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.Domain' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapDomain\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.UserName' | abpLocalization\r\n }}</label>\r\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"settings.ldapUserName\" />\r\n </div>\r\n\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\">{{\r\n 'AbpLdap::DisplayName:Abp.Ldap.Password' | abpLocalization\r\n }}</label>\r\n <input\r\n type=\"password\"\r\n class=\"form-control\"\r\n placeholder=\"{{ 'AbpIdentity::LdapPasswordPlaceholder' | abpLocalization }}\"\r\n [(ngModel)]=\"settings.ldapPassword\"\r\n autocomplete=\"new-password\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <hr class=\"my-3\" />\r\n\r\n <div>\r\n <abp-button (click)=\"submit(settings)\" iconClass=\"fa fa-save\" [loading]=\"loading\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </div>\r\n</ng-container>\r\n" }]
|
|
210
210
|
}], ctorParameters: function () { return [{ type: i1.IdentitySettingsService }, { type: i2.ToasterService }, { type: i3.ConfigStateService }]; } });
|
|
211
211
|
|
|
212
|
-
class IdentitySettingsComponent {
|
|
213
|
-
constructor(configState) {
|
|
214
|
-
this.configState = configState;
|
|
215
|
-
this.externalLoginKey = 'Identity.EnableOAuthLogin';
|
|
216
|
-
this.ldapLoginKey = 'Account.EnableLdapLogin';
|
|
217
|
-
this.features$ = this.configState
|
|
218
|
-
.getFeatures$([this.ldapLoginKey, this.externalLoginKey])
|
|
219
|
-
.pipe(map(val => Object.entries(val).reduce((acc, [key, value]) => (value === 'true' ? [...acc, key] : acc), [])));
|
|
220
|
-
}
|
|
221
|
-
submit() { }
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
226
|
-
type: Component,
|
|
227
|
-
args: [{ selector: 'abp-identity-settings', providers: [SubscriptionService], template: "<h2>{{ 'AbpIdentity::Menu:IdentityManagement' | abpLocalization }}</h2>\r\n<hr class=\"my-2\"/>\r\n<ng-container *ngIf=\"features$ | async as features; else identityComponent\">\r\n <ul ngbNav #nav=\"ngbNav\" class=\"nav-tabs\">\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::IdentitySettingsGeneral' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <ng-container *ngTemplateOutlet=\"identityComponent\"></ng-container>\r\n </ng-template>\r\n </li>\r\n\r\n <li ngbNavItem *ngFor=\"let feature of features\">\r\n <a ngbNavLink>{{\r\n (feature === externalLoginKey\r\n ? 'AbpIdentity::IdentitySettingsOAuth'\r\n : 'AbpIdentity::IdentitySettingsLdap'\r\n ) | abpLocalization\r\n }}</a>\r\n <ng-template ngbNavContent>\r\n <ng-container\r\n *ngTemplateOutlet=\"feature === externalLoginKey ? externalLogin : ldapLogin\"\r\n ></ng-container>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n <div [ngbNavOutlet]=\"nav\"></div>\r\n</ng-container>\r\n\r\n<ng-template #identityComponent>\r\n <abp-identity-setting></abp-identity-setting>\r\n</ng-template>\r\n\r\n<ng-template #externalLogin>\r\n <abp-external-login-settings></abp-external-login-settings>\r\n</ng-template>\r\n\r\n<ng-template #ldapLogin>\r\n <abp-ldap-login-settings></abp-ldap-login-settings>\r\n</ng-template>\r\n" }]
|
|
212
|
+
class IdentitySettingsComponent {
|
|
213
|
+
constructor(configState) {
|
|
214
|
+
this.configState = configState;
|
|
215
|
+
this.externalLoginKey = 'Identity.EnableOAuthLogin';
|
|
216
|
+
this.ldapLoginKey = 'Account.EnableLdapLogin';
|
|
217
|
+
this.features$ = this.configState
|
|
218
|
+
.getFeatures$([this.ldapLoginKey, this.externalLoginKey])
|
|
219
|
+
.pipe(map(val => Object.entries(val).reduce((acc, [key, value]) => (value === 'true' ? [...acc, key] : acc), [])));
|
|
220
|
+
}
|
|
221
|
+
submit() { }
|
|
222
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentitySettingsComponent, deps: [{ token: i3.ConfigStateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
223
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: IdentitySettingsComponent, selector: "abp-identity-settings", providers: [SubscriptionService], ngImport: i0, template: "<h2>{{ 'AbpIdentity::Menu:IdentityManagement' | abpLocalization }}</h2>\r\n<hr class=\"my-2\"/>\r\n<ng-container *ngIf=\"features$ | async as features; else identityComponent\">\r\n <ul ngbNav #nav=\"ngbNav\" class=\"nav-tabs\">\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::IdentitySettingsGeneral' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <ng-container *ngTemplateOutlet=\"identityComponent\"></ng-container>\r\n </ng-template>\r\n </li>\r\n\r\n <li ngbNavItem *ngFor=\"let feature of features\">\r\n <a ngbNavLink>{{\r\n (feature === externalLoginKey\r\n ? 'AbpIdentity::IdentitySettingsOAuth'\r\n : 'AbpIdentity::IdentitySettingsLdap'\r\n ) | abpLocalization\r\n }}</a>\r\n <ng-template ngbNavContent>\r\n <ng-container\r\n *ngTemplateOutlet=\"feature === externalLoginKey ? externalLogin : ldapLogin\"\r\n ></ng-container>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n <div [ngbNavOutlet]=\"nav\"></div>\r\n</ng-container>\r\n\r\n<ng-template #identityComponent>\r\n <abp-identity-setting></abp-identity-setting>\r\n</ng-template>\r\n\r\n<ng-template #externalLogin>\r\n <abp-external-login-settings></abp-external-login-settings>\r\n</ng-template>\r\n\r\n<ng-template #ldapLogin>\r\n <abp-ldap-login-settings></abp-ldap-login-settings>\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3$2.NgbNavContent, selector: "ng-template[ngbNavContent]" }, { kind: "directive", type: i3$2.NgbNav, selector: "[ngbNav]", inputs: ["activeId", "animation", "destroyOnHide", "orientation", "roles", "keyboard"], outputs: ["activeIdChange", "shown", "hidden", "navChange"], exportAs: ["ngbNav"] }, { kind: "directive", type: i3$2.NgbNavItem, selector: "[ngbNavItem]", inputs: ["destroyOnHide", "disabled", "domId", "ngbNavItem"], outputs: ["shown", "hidden"], exportAs: ["ngbNavItem"] }, { kind: "directive", type: i3$2.NgbNavItemRole, selector: "[ngbNavItem]:not(ng-container)" }, { kind: "directive", type: i3$2.NgbNavLink, selector: "a[ngbNavLink]" }, { kind: "directive", type: i3$2.NgbNavLinkBase, selector: "[ngbNavLink]" }, { kind: "component", type: i3$2.NgbNavOutlet, selector: "[ngbNavOutlet]", inputs: ["paneRole", "ngbNavOutlet"] }, { kind: "component", type: IdentitySettingComponent, selector: "abp-identity-setting" }, { kind: "component", type: IdentityExternalLoginSettingsComponent, selector: "abp-external-login-settings" }, { kind: "component", type: IdentityLdapSettingsComponent, selector: "abp-ldap-login-settings" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
224
|
+
}
|
|
225
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentitySettingsComponent, decorators: [{
|
|
226
|
+
type: Component,
|
|
227
|
+
args: [{ selector: 'abp-identity-settings', providers: [SubscriptionService], template: "<h2>{{ 'AbpIdentity::Menu:IdentityManagement' | abpLocalization }}</h2>\r\n<hr class=\"my-2\"/>\r\n<ng-container *ngIf=\"features$ | async as features; else identityComponent\">\r\n <ul ngbNav #nav=\"ngbNav\" class=\"nav-tabs\">\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::IdentitySettingsGeneral' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <ng-container *ngTemplateOutlet=\"identityComponent\"></ng-container>\r\n </ng-template>\r\n </li>\r\n\r\n <li ngbNavItem *ngFor=\"let feature of features\">\r\n <a ngbNavLink>{{\r\n (feature === externalLoginKey\r\n ? 'AbpIdentity::IdentitySettingsOAuth'\r\n : 'AbpIdentity::IdentitySettingsLdap'\r\n ) | abpLocalization\r\n }}</a>\r\n <ng-template ngbNavContent>\r\n <ng-container\r\n *ngTemplateOutlet=\"feature === externalLoginKey ? externalLogin : ldapLogin\"\r\n ></ng-container>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n <div [ngbNavOutlet]=\"nav\"></div>\r\n</ng-container>\r\n\r\n<ng-template #identityComponent>\r\n <abp-identity-setting></abp-identity-setting>\r\n</ng-template>\r\n\r\n<ng-template #externalLogin>\r\n <abp-external-login-settings></abp-external-login-settings>\r\n</ng-template>\r\n\r\n<ng-template #ldapLogin>\r\n <abp-ldap-login-settings></abp-ldap-login-settings>\r\n</ng-template>\r\n" }]
|
|
228
228
|
}], ctorParameters: function () { return [{ type: i3.ConfigStateService }]; } });
|
|
229
229
|
|
|
230
|
-
class IdentityLinkLoginService {
|
|
231
|
-
constructor(authService) {
|
|
232
|
-
this.authService = authService;
|
|
233
|
-
}
|
|
234
|
-
linkLogin(input) {
|
|
235
|
-
const grantType = 'LinkLogin';
|
|
236
|
-
const params = {
|
|
237
|
-
LinkUserId: input.linkUserId,
|
|
238
|
-
};
|
|
239
|
-
if (input.linkTenantId) {
|
|
240
|
-
params['LinkTenantId'] = input.linkTenantId;
|
|
241
|
-
}
|
|
242
|
-
return from(this.authService.loginUsingGrant(grantType, params));
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
248
|
-
type: Injectable,
|
|
249
|
-
args: [{
|
|
250
|
-
providedIn: 'root',
|
|
251
|
-
}]
|
|
230
|
+
class IdentityLinkLoginService {
|
|
231
|
+
constructor(authService) {
|
|
232
|
+
this.authService = authService;
|
|
233
|
+
}
|
|
234
|
+
linkLogin(input) {
|
|
235
|
+
const grantType = 'LinkLogin';
|
|
236
|
+
const params = {
|
|
237
|
+
LinkUserId: input.linkUserId,
|
|
238
|
+
};
|
|
239
|
+
if (input.linkTenantId) {
|
|
240
|
+
params['LinkTenantId'] = input.linkTenantId;
|
|
241
|
+
}
|
|
242
|
+
return from(this.authService.loginUsingGrant(grantType, params));
|
|
243
|
+
}
|
|
244
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentityLinkLoginService, deps: [{ token: i3.AuthService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
245
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentityLinkLoginService, providedIn: 'root' }); }
|
|
246
|
+
}
|
|
247
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentityLinkLoginService, decorators: [{
|
|
248
|
+
type: Injectable,
|
|
249
|
+
args: [{
|
|
250
|
+
providedIn: 'root',
|
|
251
|
+
}]
|
|
252
252
|
}], ctorParameters: function () { return [{ type: i3.AuthService }]; } });
|
|
253
253
|
|
|
254
|
-
class LinkLoginHandler {
|
|
255
|
-
constructor(router, route, identityLinkLoginService, toaster) {
|
|
256
|
-
this.router = router;
|
|
257
|
-
this.route = route;
|
|
258
|
-
this.identityLinkLoginService = identityLinkLoginService;
|
|
259
|
-
this.toaster = toaster;
|
|
260
|
-
this.handleLinkLoginError = (err) => {
|
|
261
|
-
this.toaster.error(err.error?.error);
|
|
262
|
-
return of(null);
|
|
263
|
-
};
|
|
264
|
-
this.listenToQueryParams();
|
|
265
|
-
}
|
|
266
|
-
listenToQueryParams() {
|
|
267
|
-
this.route.queryParams
|
|
268
|
-
.pipe(filter(params => params.handler === 'linkLogin' && (params.linkUserId || params.token)), switchMap((params) => {
|
|
269
|
-
if (params.token) {
|
|
270
|
-
Object.entries(JSON.parse(params.token)).forEach(([key, value]) => {
|
|
271
|
-
localStorage.setItem(key, value);
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
return params.linkUserId
|
|
275
|
-
? this.linkLogin(params)
|
|
276
|
-
: of(null).pipe(this.pipeToNavigate());
|
|
277
|
-
}))
|
|
278
|
-
.subscribe();
|
|
279
|
-
}
|
|
280
|
-
linkLogin(input) {
|
|
281
|
-
return this.identityLinkLoginService.linkLogin(input).pipe(catchError(this.handleLinkLoginError), switchMap(res => {
|
|
282
|
-
if (res.tenant_domain) {
|
|
283
|
-
const now = new Date().valueOf();
|
|
284
|
-
const token = {
|
|
285
|
-
access_token: res.access_token,
|
|
286
|
-
refresh_token: res.refresh_token,
|
|
287
|
-
access_token_stored_at: now,
|
|
288
|
-
expires_at: now + res.expires_in * 1000,
|
|
289
|
-
};
|
|
290
|
-
location.href = `${res.tenant_domain}?handler=linkLogin&token=${JSON.stringify(token)}`;
|
|
291
|
-
return of(null);
|
|
292
|
-
}
|
|
293
|
-
localStorage.setItem('access_token', res.access_token);
|
|
294
|
-
if (res.refresh_token)
|
|
295
|
-
localStorage.setItem('refresh_token', res.refresh_token);
|
|
296
|
-
return of(null).pipe(this.pipeToNavigate());
|
|
297
|
-
}));
|
|
298
|
-
}
|
|
299
|
-
pipeToNavigate() {
|
|
300
|
-
return pipe(switchMap(() => from(this.router.navigate(['.'], {
|
|
301
|
-
relativeTo: this.route,
|
|
302
|
-
queryParams: { handler: null, linkUserId: null, linkTenantId: null, token: null },
|
|
303
|
-
queryParamsHandling: 'merge',
|
|
304
|
-
}))), tap(() => location.reload()));
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
310
|
-
type: Injectable,
|
|
311
|
-
args: [{ providedIn: 'root' }]
|
|
254
|
+
class LinkLoginHandler {
|
|
255
|
+
constructor(router, route, identityLinkLoginService, toaster) {
|
|
256
|
+
this.router = router;
|
|
257
|
+
this.route = route;
|
|
258
|
+
this.identityLinkLoginService = identityLinkLoginService;
|
|
259
|
+
this.toaster = toaster;
|
|
260
|
+
this.handleLinkLoginError = (err) => {
|
|
261
|
+
this.toaster.error(err.error?.error);
|
|
262
|
+
return of(null);
|
|
263
|
+
};
|
|
264
|
+
this.listenToQueryParams();
|
|
265
|
+
}
|
|
266
|
+
listenToQueryParams() {
|
|
267
|
+
this.route.queryParams
|
|
268
|
+
.pipe(filter(params => params.handler === 'linkLogin' && (params.linkUserId || params.token)), switchMap((params) => {
|
|
269
|
+
if (params.token) {
|
|
270
|
+
Object.entries(JSON.parse(params.token)).forEach(([key, value]) => {
|
|
271
|
+
localStorage.setItem(key, value);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
return params.linkUserId
|
|
275
|
+
? this.linkLogin(params)
|
|
276
|
+
: of(null).pipe(this.pipeToNavigate());
|
|
277
|
+
}))
|
|
278
|
+
.subscribe();
|
|
279
|
+
}
|
|
280
|
+
linkLogin(input) {
|
|
281
|
+
return this.identityLinkLoginService.linkLogin(input).pipe(catchError(this.handleLinkLoginError), switchMap(res => {
|
|
282
|
+
if (res.tenant_domain) {
|
|
283
|
+
const now = new Date().valueOf();
|
|
284
|
+
const token = {
|
|
285
|
+
access_token: res.access_token,
|
|
286
|
+
refresh_token: res.refresh_token,
|
|
287
|
+
access_token_stored_at: now,
|
|
288
|
+
expires_at: now + res.expires_in * 1000,
|
|
289
|
+
};
|
|
290
|
+
location.href = `${res.tenant_domain}?handler=linkLogin&token=${JSON.stringify(token)}`;
|
|
291
|
+
return of(null);
|
|
292
|
+
}
|
|
293
|
+
localStorage.setItem('access_token', res.access_token);
|
|
294
|
+
if (res.refresh_token)
|
|
295
|
+
localStorage.setItem('refresh_token', res.refresh_token);
|
|
296
|
+
return of(null).pipe(this.pipeToNavigate());
|
|
297
|
+
}));
|
|
298
|
+
}
|
|
299
|
+
pipeToNavigate() {
|
|
300
|
+
return pipe(switchMap(() => from(this.router.navigate(['.'], {
|
|
301
|
+
relativeTo: this.route,
|
|
302
|
+
queryParams: { handler: null, linkUserId: null, linkTenantId: null, token: null },
|
|
303
|
+
queryParamsHandling: 'merge',
|
|
304
|
+
}))), tap(() => location.reload()));
|
|
305
|
+
}
|
|
306
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LinkLoginHandler, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: IdentityLinkLoginService }, { token: i2.ToasterService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
307
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LinkLoginHandler, providedIn: 'root' }); }
|
|
308
|
+
}
|
|
309
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LinkLoginHandler, decorators: [{
|
|
310
|
+
type: Injectable,
|
|
311
|
+
args: [{ providedIn: 'root' }]
|
|
312
312
|
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: IdentityLinkLoginService }, { type: i2.ToasterService }]; } });
|
|
313
313
|
|
|
314
|
-
class MyLinkUsersModalComponent {
|
|
315
|
-
|
|
316
|
-
this.
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
this.
|
|
320
|
-
|
|
321
|
-
this.
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
this.
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
this.
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
this._isModalOpen =
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}
|
|
351
|
-
navigateToLogin() {
|
|
352
|
-
this.linkUserService.generateLinkToken().subscribe(token => {
|
|
353
|
-
if (this.authService.isInternalAuth) {
|
|
354
|
-
const { id: linkUserId, userName: linkUserName } = this.currentUser;
|
|
355
|
-
const { id: linkTenantId, name: linkTenantName } = this.currentTenant;
|
|
356
|
-
this.authService.logout().subscribe(() => {
|
|
357
|
-
this.authService.navigateToLogin({
|
|
358
|
-
linkToken: token,
|
|
359
|
-
linkUserId,
|
|
360
|
-
linkUserName,
|
|
361
|
-
...(linkTenantId && {
|
|
362
|
-
linkTenantId,
|
|
363
|
-
linkTenantName,
|
|
364
|
-
}),
|
|
365
|
-
});
|
|
366
|
-
this.isModalOpen = false;
|
|
367
|
-
});
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
const { redirectUri } = this.environment.getEnvironment().oAuthConfig;
|
|
371
|
-
const issuer = this.environment.getIssuer();
|
|
372
|
-
const returnUrl = `${redirectUri}?handler=linkLogin&linkUserId=${this.currentUser.id}${this.currentTenant.id ? '&linkTenantId=' + this.currentTenant.id : ''}`;
|
|
373
|
-
const fullUrl = `${issuer}Account/Login?LinkUserId=${this.currentUser.id}${this.currentTenant.id ? '&LinkTenantId=' + this.currentTenant.id : ''}&LinkToken=${encodeURIComponent(token)}&ReturnUrl=${encodeURIComponent(returnUrl)}`;
|
|
374
|
-
window.open(fullUrl, '_self');
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
filterByText() {
|
|
378
|
-
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
379
|
-
}
|
|
380
|
-
getFilteredData() {
|
|
381
|
-
const list = this.data.filter(linkUser => linkUser.targetUserName.toLowerCase().includes(this.filterText.toLowerCase()));
|
|
382
|
-
this.resultCount = list.length;
|
|
383
|
-
return list;
|
|
384
|
-
}
|
|
385
|
-
getPageData(start, end) {
|
|
386
|
-
return this.getFilteredData().slice(start, end);
|
|
387
|
-
}
|
|
388
|
-
ngOnInit() {
|
|
389
|
-
this.getAllList();
|
|
390
|
-
}
|
|
391
|
-
getAllList() {
|
|
392
|
-
this.linkUserService.getAllList().subscribe(res => {
|
|
393
|
-
this.data = res.items;
|
|
394
|
-
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
395
|
-
});
|
|
396
|
-
this.list
|
|
397
|
-
.hookToQuery(query => of({ items: this.getPageData(query.skipCount, query.skipCount + query.maxResultCount) }))
|
|
398
|
-
.subscribe(res => (this.filteredData = res.items));
|
|
399
|
-
}
|
|
400
|
-
createNewLinkUser() {
|
|
401
|
-
this.confirmation
|
|
402
|
-
.warn('AbpAccount::NewLinkAccountWarning', 'AbpUi::AreYouSure')
|
|
403
|
-
.subscribe(res => {
|
|
404
|
-
if (res === Confirmation.Status.confirm) {
|
|
405
|
-
this.navigateToLogin();
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
|
-
}
|
|
409
|
-
delete(record) {
|
|
410
|
-
this.confirmation
|
|
411
|
-
.warn('AbpAccount::DeleteLinkAccountConfirmationMessage', 'AbpUi::AreYouSure', {
|
|
412
|
-
messageLocalizationParams: [record.targetUserName],
|
|
413
|
-
})
|
|
414
|
-
.subscribe(res => {
|
|
415
|
-
if (res === Confirmation.Status.confirm) {
|
|
416
|
-
this.linkUserService
|
|
417
|
-
.unlink({ userId: record.targetUserId, tenantId: record.targetTenantId })
|
|
418
|
-
.subscribe(() => this.getAllList());
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
}
|
|
422
|
-
LoginAsThisAccount(record) {
|
|
423
|
-
this.linkLoginHandler
|
|
424
|
-
.linkLogin({
|
|
425
|
-
linkUserId: record.targetUserId,
|
|
426
|
-
linkTenantId: record.targetTenantId,
|
|
427
|
-
})
|
|
428
|
-
.subscribe(() => (this.isModalOpen = false));
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
434
|
-
type: Component,
|
|
435
|
-
args: [{ selector: 'abp-my-link-users-modal', providers: [ListService], template: "<abp-modal [(visible)]=\"isModalOpen\" [suppressUnsavedChangesWarning]=\"true\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::LinkedAccounts' | abpLocalization }}</h5>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <div class=\"text-end mb-3\">\r\n <button\r\n id=\"create-link-user\"\r\n class=\"btn btn-primary\"\r\n type=\"button\"\r\n (click)=\"createNewLinkUser()\"\r\n >\r\n {{ 'AbpAccount::NewLinkAccount' | abpLocalization }}\r\n </button>\r\n\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"MyLinkUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n <div class=\"mt-2\">\r\n <ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"150\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <div ngbDropdown container=\"body\" class=\"d-inline-block\">\r\n <button\r\n class=\"btn btn-primary btn-sm dropdown-toggle\"\r\n data-toggle=\"dropdown\"\r\n aria-haspopup=\"true\"\r\n ngbDropdownToggle\r\n >\r\n <i class=\"fa fa-cog me-1\" aria-hidden=\"true\"></i>{{ 'AbpUi::Actions' | abpLocalization }}\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem (click)=\"LoginAsThisAccount(row)\">\r\n {{ 'AbpAccount::LoginAsThisAccount' | abpLocalization }}\r\n </button>\r\n <button *ngIf=\"row.directlyLinked\" ngbDropdownItem (click)=\"delete(row)\">\r\n {{ 'AbpUi::Delete' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'AbpAccount::UserName' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <a href=\"javascript:void(0)\" class=\"text-body\" (click)=\"LoginAsThisAccount(row)\">\r\n {{ row.targetTenantName ? row.targetTenantName + '\\\\' : ''\r\n }}{{ row.targetUserName }}\r\n </a>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'AbpAccount::DirectlyLinked' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <i class=\"fas fa-{{ row.directlyLinked ? 'check' : 'times' }}\" aria-hidden=\"true\"></i>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n </ngx-datatable>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
314
|
+
class MyLinkUsersModalComponent {
|
|
315
|
+
get isModalOpen() {
|
|
316
|
+
return this._isModalOpen;
|
|
317
|
+
}
|
|
318
|
+
set isModalOpen(value) {
|
|
319
|
+
if (value && !this._isModalOpen)
|
|
320
|
+
this.getAllList();
|
|
321
|
+
this._isModalOpen = value;
|
|
322
|
+
}
|
|
323
|
+
get currentUser() {
|
|
324
|
+
return this.configState.getAll().currentUser;
|
|
325
|
+
}
|
|
326
|
+
get currentTenant() {
|
|
327
|
+
return this.configState.getAll().currentTenant;
|
|
328
|
+
}
|
|
329
|
+
get pageStartIndex() {
|
|
330
|
+
return this.list.page * this.list.maxResultCount;
|
|
331
|
+
}
|
|
332
|
+
get pageEndIndex() {
|
|
333
|
+
return this.pageStartIndex + this.list.maxResultCount;
|
|
334
|
+
}
|
|
335
|
+
constructor(injector) {
|
|
336
|
+
this.injector = injector;
|
|
337
|
+
this._isModalOpen = true;
|
|
338
|
+
this.data = [];
|
|
339
|
+
this.filteredData = [];
|
|
340
|
+
this.filterText = '';
|
|
341
|
+
this.resultCount = 0;
|
|
342
|
+
this.list = injector.get(ListService);
|
|
343
|
+
this.list.maxResultCount = 5;
|
|
344
|
+
this.linkUserService = injector.get(IdentityLinkUserService);
|
|
345
|
+
this.confirmation = injector.get(ConfirmationService);
|
|
346
|
+
this.configState = injector.get(ConfigStateService);
|
|
347
|
+
this.authService = injector.get(AuthService);
|
|
348
|
+
this.environment = injector.get(EnvironmentService);
|
|
349
|
+
this.linkLoginHandler = injector.get(LinkLoginHandler);
|
|
350
|
+
}
|
|
351
|
+
navigateToLogin() {
|
|
352
|
+
this.linkUserService.generateLinkToken().subscribe(token => {
|
|
353
|
+
if (this.authService.isInternalAuth) {
|
|
354
|
+
const { id: linkUserId, userName: linkUserName } = this.currentUser;
|
|
355
|
+
const { id: linkTenantId, name: linkTenantName } = this.currentTenant;
|
|
356
|
+
this.authService.logout().subscribe(() => {
|
|
357
|
+
this.authService.navigateToLogin({
|
|
358
|
+
linkToken: token,
|
|
359
|
+
linkUserId,
|
|
360
|
+
linkUserName,
|
|
361
|
+
...(linkTenantId && {
|
|
362
|
+
linkTenantId,
|
|
363
|
+
linkTenantName,
|
|
364
|
+
}),
|
|
365
|
+
});
|
|
366
|
+
this.isModalOpen = false;
|
|
367
|
+
});
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
const { redirectUri } = this.environment.getEnvironment().oAuthConfig;
|
|
371
|
+
const issuer = this.environment.getIssuer();
|
|
372
|
+
const returnUrl = `${redirectUri}?handler=linkLogin&linkUserId=${this.currentUser.id}${this.currentTenant.id ? '&linkTenantId=' + this.currentTenant.id : ''}`;
|
|
373
|
+
const fullUrl = `${issuer}Account/Login?LinkUserId=${this.currentUser.id}${this.currentTenant.id ? '&LinkTenantId=' + this.currentTenant.id : ''}&LinkToken=${encodeURIComponent(token)}&ReturnUrl=${encodeURIComponent(returnUrl)}`;
|
|
374
|
+
window.open(fullUrl, '_self');
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
filterByText() {
|
|
378
|
+
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
379
|
+
}
|
|
380
|
+
getFilteredData() {
|
|
381
|
+
const list = this.data.filter(linkUser => linkUser.targetUserName.toLowerCase().includes(this.filterText.toLowerCase()));
|
|
382
|
+
this.resultCount = list.length;
|
|
383
|
+
return list;
|
|
384
|
+
}
|
|
385
|
+
getPageData(start, end) {
|
|
386
|
+
return this.getFilteredData().slice(start, end);
|
|
387
|
+
}
|
|
388
|
+
ngOnInit() {
|
|
389
|
+
this.getAllList();
|
|
390
|
+
}
|
|
391
|
+
getAllList() {
|
|
392
|
+
this.linkUserService.getAllList().subscribe(res => {
|
|
393
|
+
this.data = res.items;
|
|
394
|
+
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
395
|
+
});
|
|
396
|
+
this.list
|
|
397
|
+
.hookToQuery(query => of({ items: this.getPageData(query.skipCount, query.skipCount + query.maxResultCount) }))
|
|
398
|
+
.subscribe(res => (this.filteredData = res.items));
|
|
399
|
+
}
|
|
400
|
+
createNewLinkUser() {
|
|
401
|
+
this.confirmation
|
|
402
|
+
.warn('AbpAccount::NewLinkAccountWarning', 'AbpUi::AreYouSure')
|
|
403
|
+
.subscribe(res => {
|
|
404
|
+
if (res === Confirmation.Status.confirm) {
|
|
405
|
+
this.navigateToLogin();
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
delete(record) {
|
|
410
|
+
this.confirmation
|
|
411
|
+
.warn('AbpAccount::DeleteLinkAccountConfirmationMessage', 'AbpUi::AreYouSure', {
|
|
412
|
+
messageLocalizationParams: [record.targetUserName],
|
|
413
|
+
})
|
|
414
|
+
.subscribe(res => {
|
|
415
|
+
if (res === Confirmation.Status.confirm) {
|
|
416
|
+
this.linkUserService
|
|
417
|
+
.unlink({ userId: record.targetUserId, tenantId: record.targetTenantId })
|
|
418
|
+
.subscribe(() => this.getAllList());
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
LoginAsThisAccount(record) {
|
|
423
|
+
this.linkLoginHandler
|
|
424
|
+
.linkLogin({
|
|
425
|
+
linkUserId: record.targetUserId,
|
|
426
|
+
linkTenantId: record.targetTenantId,
|
|
427
|
+
})
|
|
428
|
+
.subscribe(() => (this.isModalOpen = false));
|
|
429
|
+
}
|
|
430
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MyLinkUsersModalComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
431
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: MyLinkUsersModalComponent, selector: "abp-my-link-users-modal", providers: [ListService], ngImport: i0, template: "<abp-modal [(visible)]=\"isModalOpen\" [suppressUnsavedChangesWarning]=\"true\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::LinkedAccounts' | abpLocalization }}</h5>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <div class=\"text-end mb-3\">\r\n <button\r\n id=\"create-link-user\"\r\n class=\"btn btn-primary\"\r\n type=\"button\"\r\n (click)=\"createNewLinkUser()\"\r\n >\r\n {{ 'AbpAccount::NewLinkAccount' | abpLocalization }}\r\n </button>\r\n\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"MyLinkUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n <div class=\"mt-2\">\r\n <ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"150\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <div ngbDropdown container=\"body\" class=\"d-inline-block\">\r\n <button\r\n class=\"btn btn-primary btn-sm dropdown-toggle\"\r\n data-toggle=\"dropdown\"\r\n aria-haspopup=\"true\"\r\n ngbDropdownToggle\r\n >\r\n <i class=\"fa fa-cog me-1\" aria-hidden=\"true\"></i>{{ 'AbpUi::Actions' | abpLocalization }}\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem (click)=\"LoginAsThisAccount(row)\">\r\n {{ 'AbpAccount::LoginAsThisAccount' | abpLocalization }}\r\n </button>\r\n <button *ngIf=\"row.directlyLinked\" ngbDropdownItem (click)=\"delete(row)\">\r\n {{ 'AbpUi::Delete' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'AbpAccount::UserName' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <a href=\"javascript:void(0)\" class=\"text-body\" (click)=\"LoginAsThisAccount(row)\">\r\n {{ row.targetTenantName ? row.targetTenantName + '\\\\' : ''\r\n }}{{ row.targetUserName }}\r\n </a>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'AbpAccount::DirectlyLinked' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <i class=\"fas fa-{{ row.directlyLinked ? 'check' : 'times' }}\" aria-hidden=\"true\"></i>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n </ngx-datatable>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</abp-modal>\r\n", dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$2.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i2$2.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i2$2.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "component", type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2.NgxDatatableDefaultDirective, selector: "ngx-datatable[default]", inputs: ["class"], exportAs: ["ngxDatatableDefault"] }, { kind: "directive", type: i2.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "directive", type: i3$2.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i3$2.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i3$2.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i3$2.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["disabled"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
432
|
+
}
|
|
433
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MyLinkUsersModalComponent, decorators: [{
|
|
434
|
+
type: Component,
|
|
435
|
+
args: [{ selector: 'abp-my-link-users-modal', providers: [ListService], template: "<abp-modal [(visible)]=\"isModalOpen\" [suppressUnsavedChangesWarning]=\"true\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::LinkedAccounts' | abpLocalization }}</h5>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <div class=\"text-end mb-3\">\r\n <button\r\n id=\"create-link-user\"\r\n class=\"btn btn-primary\"\r\n type=\"button\"\r\n (click)=\"createNewLinkUser()\"\r\n >\r\n {{ 'AbpAccount::NewLinkAccount' | abpLocalization }}\r\n </button>\r\n\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"MyLinkUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n <div class=\"mt-2\">\r\n <ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"150\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <div ngbDropdown container=\"body\" class=\"d-inline-block\">\r\n <button\r\n class=\"btn btn-primary btn-sm dropdown-toggle\"\r\n data-toggle=\"dropdown\"\r\n aria-haspopup=\"true\"\r\n ngbDropdownToggle\r\n >\r\n <i class=\"fa fa-cog me-1\" aria-hidden=\"true\"></i>{{ 'AbpUi::Actions' | abpLocalization }}\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem (click)=\"LoginAsThisAccount(row)\">\r\n {{ 'AbpAccount::LoginAsThisAccount' | abpLocalization }}\r\n </button>\r\n <button *ngIf=\"row.directlyLinked\" ngbDropdownItem (click)=\"delete(row)\">\r\n {{ 'AbpUi::Delete' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'AbpAccount::UserName' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <a href=\"javascript:void(0)\" class=\"text-body\" (click)=\"LoginAsThisAccount(row)\">\r\n {{ row.targetTenantName ? row.targetTenantName + '\\\\' : ''\r\n }}{{ row.targetUserName }}\r\n </a>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'AbpAccount::DirectlyLinked' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <i class=\"fas fa-{{ row.directlyLinked ? 'check' : 'times' }}\" aria-hidden=\"true\"></i>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n </ngx-datatable>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
436
436
|
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
437
437
|
|
|
438
|
-
class AbpAuthorityDelegationService {
|
|
439
|
-
constructor() {
|
|
440
|
-
this.service = inject(IdentityUserDelegationService);
|
|
441
|
-
this.authService = inject(AuthService);
|
|
442
|
-
this.pipeToLogin = inject(PIPE_TO_LOGIN_FN_KEY);
|
|
443
|
-
this.injector = inject(Injector);
|
|
444
|
-
this.grantType = 'Impersonation';
|
|
445
|
-
}
|
|
446
|
-
isVisible() {
|
|
447
|
-
return this.authService.isAuthenticated;
|
|
448
|
-
}
|
|
449
|
-
getUsers() {
|
|
450
|
-
return this.service.getActiveDelegations();
|
|
451
|
-
}
|
|
452
|
-
delegatedImpersonate(userDelegationId) {
|
|
453
|
-
const promise = this.authService.loginUsingGrant(this.grantType, {
|
|
454
|
-
UserDelegationId: userDelegationId,
|
|
455
|
-
});
|
|
456
|
-
return from(promise).pipe(this.pipeToLogin && this.pipeToLogin({}, this.injector));
|
|
457
|
-
}
|
|
458
|
-
getStatus(row) {
|
|
459
|
-
const { startTime, endTime } = row;
|
|
460
|
-
const curr = new Date().getTime();
|
|
461
|
-
const beg = new Date(startTime).getTime();
|
|
462
|
-
const end = new Date(endTime).getTime();
|
|
463
|
-
if (beg > curr) {
|
|
464
|
-
return 'Future';
|
|
465
|
-
}
|
|
466
|
-
else if (curr > end) {
|
|
467
|
-
return 'Expired';
|
|
468
|
-
}
|
|
469
|
-
else if (beg < curr && curr < end) {
|
|
470
|
-
return 'Active';
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
statusClass(row) {
|
|
474
|
-
const status = this.getStatus(row);
|
|
475
|
-
switch (status) {
|
|
476
|
-
case 'Active':
|
|
477
|
-
return 'success';
|
|
478
|
-
case 'Expired':
|
|
479
|
-
return 'danger';
|
|
480
|
-
case 'Future':
|
|
481
|
-
return 'warning';
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
488
|
-
type: Injectable,
|
|
489
|
-
args: [{
|
|
490
|
-
providedIn: 'root',
|
|
491
|
-
}]
|
|
438
|
+
class AbpAuthorityDelegationService {
|
|
439
|
+
constructor() {
|
|
440
|
+
this.service = inject(IdentityUserDelegationService);
|
|
441
|
+
this.authService = inject(AuthService);
|
|
442
|
+
this.pipeToLogin = inject(PIPE_TO_LOGIN_FN_KEY);
|
|
443
|
+
this.injector = inject(Injector);
|
|
444
|
+
this.grantType = 'Impersonation';
|
|
445
|
+
}
|
|
446
|
+
isVisible() {
|
|
447
|
+
return this.authService.isAuthenticated;
|
|
448
|
+
}
|
|
449
|
+
getUsers() {
|
|
450
|
+
return this.service.getActiveDelegations();
|
|
451
|
+
}
|
|
452
|
+
delegatedImpersonate(userDelegationId) {
|
|
453
|
+
const promise = this.authService.loginUsingGrant(this.grantType, {
|
|
454
|
+
UserDelegationId: userDelegationId,
|
|
455
|
+
});
|
|
456
|
+
return from(promise).pipe(this.pipeToLogin && this.pipeToLogin({}, this.injector));
|
|
457
|
+
}
|
|
458
|
+
getStatus(row) {
|
|
459
|
+
const { startTime, endTime } = row;
|
|
460
|
+
const curr = new Date().getTime();
|
|
461
|
+
const beg = new Date(startTime).getTime();
|
|
462
|
+
const end = new Date(endTime).getTime();
|
|
463
|
+
if (beg > curr) {
|
|
464
|
+
return 'Future';
|
|
465
|
+
}
|
|
466
|
+
else if (curr > end) {
|
|
467
|
+
return 'Expired';
|
|
468
|
+
}
|
|
469
|
+
else if (beg < curr && curr < end) {
|
|
470
|
+
return 'Active';
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
statusClass(row) {
|
|
474
|
+
const status = this.getStatus(row);
|
|
475
|
+
switch (status) {
|
|
476
|
+
case 'Active':
|
|
477
|
+
return 'success';
|
|
478
|
+
case 'Expired':
|
|
479
|
+
return 'danger';
|
|
480
|
+
case 'Future':
|
|
481
|
+
return 'warning';
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: AbpAuthorityDelegationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
485
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: AbpAuthorityDelegationService, providedIn: 'root' }); }
|
|
486
|
+
}
|
|
487
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: AbpAuthorityDelegationService, decorators: [{
|
|
488
|
+
type: Injectable,
|
|
489
|
+
args: [{
|
|
490
|
+
providedIn: 'root',
|
|
491
|
+
}]
|
|
492
492
|
}] });
|
|
493
493
|
|
|
494
|
-
class CreateUserDelegateComponent {
|
|
495
|
-
constructor() {
|
|
496
|
-
this.identityUserDelegationService = inject(IdentityUserDelegationService);
|
|
497
|
-
this.fb = inject(FormBuilder);
|
|
498
|
-
this.form = this.fb.group({
|
|
499
|
-
userNameId: ['', [Validators.required]],
|
|
500
|
-
times: {
|
|
501
|
-
startTime: ['', []],
|
|
502
|
-
endTime: ['', []],
|
|
503
|
-
},
|
|
504
|
-
});
|
|
505
|
-
this.save = new EventEmitter();
|
|
506
|
-
this.getFn = (input) => {
|
|
507
|
-
return this.identityUserDelegationService.getUserLookup(input).pipe(map((usersLookup) => {
|
|
508
|
-
return {
|
|
509
|
-
items: usersLookup.items,
|
|
510
|
-
totalCount: usersLookup.items.length,
|
|
511
|
-
};
|
|
512
|
-
}));
|
|
513
|
-
};
|
|
514
|
-
}
|
|
515
|
-
ngSubmit() {
|
|
516
|
-
if (this.form.invalid) {
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
const { userNameId, times } = this.form.value;
|
|
520
|
-
const newUser = {
|
|
521
|
-
targetUserId: userNameId,
|
|
522
|
-
startTime: times.startTime,
|
|
523
|
-
endTime: times.endTime,
|
|
524
|
-
};
|
|
525
|
-
this.identityUserDelegationService.delegateNewUser(newUser).subscribe(() => this.save.emit());
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
531
|
-
type: Component,
|
|
532
|
-
args: [{ selector: 'abp-create-user-delegate', providers: [{ provide: NgbDateAdapter, useClass: DateTimeAdapter }], template: "<form (ngSubmit)=\"ngSubmit()\" [formGroup]=\"form\" id=\"DelegateNewUser\" name=\"DelegateNewUser\">\r\n <div class=\"mb-3\">\r\n <label for=\"delegate-new-user-id\">{{ 'AbpAccount::UserName' | abpLocalization }}</label>\r\n <abp-lookup-typeahead\r\n cid=\"delegate-new-user-id\"\r\n displayNameProp=\"userName\"\r\n lookupNameProp=\"userName\"\r\n formControlName=\"userNameId\"\r\n [getFn]=\"getFn\"\r\n ></abp-lookup-typeahead>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label> {{ 'AbpAccount::DelegationDateRange' | abpLocalization }} </label>\r\n <abp-date-range-picker startDateProp=\"startTime\" endDateProp=\"endTime\" formControlName=\"times\">\r\n </abp-date-range-picker>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end align-items-center mb-2 gap-2\">\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpAccount::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" buttonType=\"submit\" formName=\"DelegateNewUser\">\r\n {{ 'AbpAccount::Save' | abpLocalization }}\r\n </abp-button>\r\n </div>\r\n</form>\r\n" }]
|
|
533
|
-
}], propDecorators: { save: [{
|
|
534
|
-
type: Output
|
|
494
|
+
class CreateUserDelegateComponent {
|
|
495
|
+
constructor() {
|
|
496
|
+
this.identityUserDelegationService = inject(IdentityUserDelegationService);
|
|
497
|
+
this.fb = inject(FormBuilder);
|
|
498
|
+
this.form = this.fb.group({
|
|
499
|
+
userNameId: ['', [Validators.required]],
|
|
500
|
+
times: {
|
|
501
|
+
startTime: ['', []],
|
|
502
|
+
endTime: ['', []],
|
|
503
|
+
},
|
|
504
|
+
});
|
|
505
|
+
this.save = new EventEmitter();
|
|
506
|
+
this.getFn = (input) => {
|
|
507
|
+
return this.identityUserDelegationService.getUserLookup(input).pipe(map((usersLookup) => {
|
|
508
|
+
return {
|
|
509
|
+
items: usersLookup.items,
|
|
510
|
+
totalCount: usersLookup.items.length,
|
|
511
|
+
};
|
|
512
|
+
}));
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
ngSubmit() {
|
|
516
|
+
if (this.form.invalid) {
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
const { userNameId, times } = this.form.value;
|
|
520
|
+
const newUser = {
|
|
521
|
+
targetUserId: userNameId,
|
|
522
|
+
startTime: times.startTime,
|
|
523
|
+
endTime: times.endTime,
|
|
524
|
+
};
|
|
525
|
+
this.identityUserDelegationService.delegateNewUser(newUser).subscribe(() => this.save.emit());
|
|
526
|
+
}
|
|
527
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: CreateUserDelegateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
528
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: CreateUserDelegateComponent, selector: "abp-create-user-delegate", outputs: { save: "save" }, providers: [{ provide: NgbDateAdapter, useClass: DateTimeAdapter }], ngImport: i0, template: "<form (ngSubmit)=\"ngSubmit()\" [formGroup]=\"form\" id=\"DelegateNewUser\" name=\"DelegateNewUser\">\r\n <div class=\"mb-3\">\r\n <label for=\"delegate-new-user-id\">{{ 'AbpAccount::UserName' | abpLocalization }}</label>\r\n <abp-lookup-typeahead\r\n cid=\"delegate-new-user-id\"\r\n displayNameProp=\"userName\"\r\n lookupNameProp=\"userName\"\r\n formControlName=\"userNameId\"\r\n [getFn]=\"getFn\"\r\n ></abp-lookup-typeahead>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label> {{ 'AbpAccount::DelegationDateRange' | abpLocalization }} </label>\r\n <abp-date-range-picker startDateProp=\"startTime\" endDateProp=\"endTime\" formControlName=\"times\">\r\n </abp-date-range-picker>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end align-items-center mb-2 gap-2\">\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpAccount::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" buttonType=\"submit\" formName=\"DelegateNewUser\">\r\n {{ 'AbpAccount::Save' | abpLocalization }}\r\n </abp-button>\r\n </div>\r\n</form>\r\n", dependencies: [{ kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i6.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i6.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "directive", type: i2.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: i5.LookupTypeaheadComponent, selector: "abp-lookup-typeahead", inputs: ["displayNameProp", "lookupFilterProp", "filter", "editingData"] }, { kind: "component", type: i5.DateRangePickerComponent, selector: "abp-date-range-picker", inputs: ["startDateProp", "endDateProp", "labelText"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
529
|
+
}
|
|
530
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: CreateUserDelegateComponent, decorators: [{
|
|
531
|
+
type: Component,
|
|
532
|
+
args: [{ selector: 'abp-create-user-delegate', providers: [{ provide: NgbDateAdapter, useClass: DateTimeAdapter }], template: "<form (ngSubmit)=\"ngSubmit()\" [formGroup]=\"form\" id=\"DelegateNewUser\" name=\"DelegateNewUser\">\r\n <div class=\"mb-3\">\r\n <label for=\"delegate-new-user-id\">{{ 'AbpAccount::UserName' | abpLocalization }}</label>\r\n <abp-lookup-typeahead\r\n cid=\"delegate-new-user-id\"\r\n displayNameProp=\"userName\"\r\n lookupNameProp=\"userName\"\r\n formControlName=\"userNameId\"\r\n [getFn]=\"getFn\"\r\n ></abp-lookup-typeahead>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label> {{ 'AbpAccount::DelegationDateRange' | abpLocalization }} </label>\r\n <abp-date-range-picker startDateProp=\"startTime\" endDateProp=\"endTime\" formControlName=\"times\">\r\n </abp-date-range-picker>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end align-items-center mb-2 gap-2\">\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpAccount::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" buttonType=\"submit\" formName=\"DelegateNewUser\">\r\n {{ 'AbpAccount::Save' | abpLocalization }}\r\n </abp-button>\r\n </div>\r\n</form>\r\n" }]
|
|
533
|
+
}], propDecorators: { save: [{
|
|
534
|
+
type: Output
|
|
535
535
|
}] } });
|
|
536
536
|
|
|
537
|
-
class ListAuthorityDelegationComponent {
|
|
538
|
-
constructor() {
|
|
539
|
-
this.identityUserDelegationService = inject(IdentityUserDelegationService);
|
|
540
|
-
this.confirmation = inject(ConfirmationService);
|
|
541
|
-
this.service = inject(AbpAuthorityDelegationService);
|
|
542
|
-
this.list = inject(ListService);
|
|
543
|
-
this.filterText = '';
|
|
544
|
-
this.isNewUserDelegateModalOpen = false;
|
|
545
|
-
}
|
|
546
|
-
get pageStartIndex() {
|
|
547
|
-
return this.list.page * this.list.maxResultCount;
|
|
548
|
-
}
|
|
549
|
-
get pageEndIndex() {
|
|
550
|
-
return this.pageStartIndex + this.list.maxResultCount;
|
|
551
|
-
}
|
|
552
|
-
ngOnInit() {
|
|
553
|
-
this.list.maxResultCount = 5;
|
|
554
|
-
this.getAllList();
|
|
555
|
-
}
|
|
556
|
-
filterByText() {
|
|
557
|
-
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
558
|
-
}
|
|
559
|
-
getFilteredData() {
|
|
560
|
-
const list = this.data.filter(user => user.userName.toLowerCase().includes(this.filterText.toLowerCase()));
|
|
561
|
-
this.resultCount = list.length;
|
|
562
|
-
return list;
|
|
563
|
-
}
|
|
564
|
-
getPageData(start, end) {
|
|
565
|
-
return this.getFilteredData().slice(start, end);
|
|
566
|
-
}
|
|
567
|
-
getAllList() {
|
|
568
|
-
this.identityUserDelegationService.getDelegatedUsers().subscribe(res => {
|
|
569
|
-
this.data = res.items;
|
|
570
|
-
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
571
|
-
});
|
|
572
|
-
this.list
|
|
573
|
-
.hookToQuery(query => of({ items: this.getPageData(query.skipCount, query.skipCount + query.maxResultCount) }))
|
|
574
|
-
.subscribe(res => (this.filteredData = res.items));
|
|
575
|
-
}
|
|
576
|
-
create() {
|
|
577
|
-
this.isNewUserDelegateModalOpen = true;
|
|
578
|
-
}
|
|
579
|
-
refreshData() {
|
|
580
|
-
this.getAllList();
|
|
581
|
-
this.isNewUserDelegateModalOpen = false;
|
|
582
|
-
}
|
|
583
|
-
delete(row) {
|
|
584
|
-
const id = row.id;
|
|
585
|
-
this.confirmation
|
|
586
|
-
.warn(`AbpAccount::DeleteUserDelegationConfirmationMessage`, 'AbpAccount::AreYouSure', {
|
|
587
|
-
messageLocalizationParams: [row.userName],
|
|
588
|
-
})
|
|
589
|
-
.pipe(filter(res => res === Confirmation.Status.confirm), switchMap$1(() => this.identityUserDelegationService.deleteDelegation(id)))
|
|
590
|
-
.subscribe(() => {
|
|
591
|
-
this.refreshData();
|
|
592
|
-
});
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
598
|
-
type: Component,
|
|
599
|
-
args: [{ selector: 'abp-list-authority-delegation', providers: [ListService], template: "<div class=\"text-end mb-2\">\r\n <button id=\"create-delegate-user\" class=\"btn btn-primary\" type=\"button\" (click)=\"create()\">\r\n {{ 'AbpAccount::DelegateNewUser' | abpLocalization }}\r\n </button>\r\n\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"DelegatedUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n</div>\r\n\r\n<ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"100\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <button class=\"btn btn-danger btn-sm\" (click)=\"delete(row)\">\r\n {{ 'AbpAccount::Delete' | abpLocalization }}\r\n </button>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpUi::Status' | abpLocalization\" [maxWidth]=\"125\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <span class=\"badge bg-{{ service.statusClass(row) }}\">\r\n {{ 'AbpAccount::Status' + service.getStatus(row) | abpLocalization }}\r\n </span>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column\r\n [sortable]=\"true\"\r\n [name]=\"'AbpAccount::UserName' | abpLocalization\"\r\n prop=\"userName\"\r\n >\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::StartTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.startTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::EndTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.endTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n</ngx-datatable>\r\n\r\n<abp-modal [(visible)]=\"isNewUserDelegateModalOpen\" [suppressUnsavedChangesWarning]=\"true\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::DelegateNewUser' | abpLocalization }}</h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <abp-create-user-delegate (save)=\"refreshData()\"> </abp-create-user-delegate>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
537
|
+
class ListAuthorityDelegationComponent {
|
|
538
|
+
constructor() {
|
|
539
|
+
this.identityUserDelegationService = inject(IdentityUserDelegationService);
|
|
540
|
+
this.confirmation = inject(ConfirmationService);
|
|
541
|
+
this.service = inject(AbpAuthorityDelegationService);
|
|
542
|
+
this.list = inject(ListService);
|
|
543
|
+
this.filterText = '';
|
|
544
|
+
this.isNewUserDelegateModalOpen = false;
|
|
545
|
+
}
|
|
546
|
+
get pageStartIndex() {
|
|
547
|
+
return this.list.page * this.list.maxResultCount;
|
|
548
|
+
}
|
|
549
|
+
get pageEndIndex() {
|
|
550
|
+
return this.pageStartIndex + this.list.maxResultCount;
|
|
551
|
+
}
|
|
552
|
+
ngOnInit() {
|
|
553
|
+
this.list.maxResultCount = 5;
|
|
554
|
+
this.getAllList();
|
|
555
|
+
}
|
|
556
|
+
filterByText() {
|
|
557
|
+
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
558
|
+
}
|
|
559
|
+
getFilteredData() {
|
|
560
|
+
const list = this.data.filter(user => user.userName.toLowerCase().includes(this.filterText.toLowerCase()));
|
|
561
|
+
this.resultCount = list.length;
|
|
562
|
+
return list;
|
|
563
|
+
}
|
|
564
|
+
getPageData(start, end) {
|
|
565
|
+
return this.getFilteredData().slice(start, end);
|
|
566
|
+
}
|
|
567
|
+
getAllList() {
|
|
568
|
+
this.identityUserDelegationService.getDelegatedUsers().subscribe(res => {
|
|
569
|
+
this.data = res.items;
|
|
570
|
+
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
571
|
+
});
|
|
572
|
+
this.list
|
|
573
|
+
.hookToQuery(query => of({ items: this.getPageData(query.skipCount, query.skipCount + query.maxResultCount) }))
|
|
574
|
+
.subscribe(res => (this.filteredData = res.items));
|
|
575
|
+
}
|
|
576
|
+
create() {
|
|
577
|
+
this.isNewUserDelegateModalOpen = true;
|
|
578
|
+
}
|
|
579
|
+
refreshData() {
|
|
580
|
+
this.getAllList();
|
|
581
|
+
this.isNewUserDelegateModalOpen = false;
|
|
582
|
+
}
|
|
583
|
+
delete(row) {
|
|
584
|
+
const id = row.id;
|
|
585
|
+
this.confirmation
|
|
586
|
+
.warn(`AbpAccount::DeleteUserDelegationConfirmationMessage`, 'AbpAccount::AreYouSure', {
|
|
587
|
+
messageLocalizationParams: [row.userName],
|
|
588
|
+
})
|
|
589
|
+
.pipe(filter(res => res === Confirmation.Status.confirm), switchMap$1(() => this.identityUserDelegationService.deleteDelegation(id)))
|
|
590
|
+
.subscribe(() => {
|
|
591
|
+
this.refreshData();
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ListAuthorityDelegationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
595
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: ListAuthorityDelegationComponent, selector: "abp-list-authority-delegation", providers: [ListService], ngImport: i0, template: "<div class=\"text-end mb-2\">\r\n <button id=\"create-delegate-user\" class=\"btn btn-primary\" type=\"button\" (click)=\"create()\">\r\n {{ 'AbpAccount::DelegateNewUser' | abpLocalization }}\r\n </button>\r\n\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"DelegatedUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n</div>\r\n\r\n<ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"100\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <button class=\"btn btn-danger btn-sm\" (click)=\"delete(row)\">\r\n {{ 'AbpAccount::Delete' | abpLocalization }}\r\n </button>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpUi::Status' | abpLocalization\" [maxWidth]=\"125\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <span class=\"badge bg-{{ service.statusClass(row) }}\">\r\n {{ 'AbpAccount::Status' + service.getStatus(row) | abpLocalization }}\r\n </span>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column\r\n [sortable]=\"true\"\r\n [name]=\"'AbpAccount::UserName' | abpLocalization\"\r\n prop=\"userName\"\r\n >\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::StartTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.startTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::EndTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.endTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n</ngx-datatable>\r\n\r\n<abp-modal [(visible)]=\"isNewUserDelegateModalOpen\" [suppressUnsavedChangesWarning]=\"true\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::DelegateNewUser' | abpLocalization }}</h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <abp-create-user-delegate (save)=\"refreshData()\"> </abp-create-user-delegate>\r\n </ng-template>\r\n</abp-modal>\r\n", dependencies: [{ kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$2.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i2$2.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i2$2.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "component", type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2.NgxDatatableDefaultDirective, selector: "ngx-datatable[default]", inputs: ["class"], exportAs: ["ngxDatatableDefault"] }, { kind: "directive", type: i2.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "component", type: CreateUserDelegateComponent, selector: "abp-create-user-delegate", outputs: ["save"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }, { kind: "pipe", type: i3.ShortDateTimePipe, name: "shortDateTime" }] }); }
|
|
596
|
+
}
|
|
597
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ListAuthorityDelegationComponent, decorators: [{
|
|
598
|
+
type: Component,
|
|
599
|
+
args: [{ selector: 'abp-list-authority-delegation', providers: [ListService], template: "<div class=\"text-end mb-2\">\r\n <button id=\"create-delegate-user\" class=\"btn btn-primary\" type=\"button\" (click)=\"create()\">\r\n {{ 'AbpAccount::DelegateNewUser' | abpLocalization }}\r\n </button>\r\n\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"DelegatedUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n</div>\r\n\r\n<ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"100\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <button class=\"btn btn-danger btn-sm\" (click)=\"delete(row)\">\r\n {{ 'AbpAccount::Delete' | abpLocalization }}\r\n </button>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpUi::Status' | abpLocalization\" [maxWidth]=\"125\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <span class=\"badge bg-{{ service.statusClass(row) }}\">\r\n {{ 'AbpAccount::Status' + service.getStatus(row) | abpLocalization }}\r\n </span>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column\r\n [sortable]=\"true\"\r\n [name]=\"'AbpAccount::UserName' | abpLocalization\"\r\n prop=\"userName\"\r\n >\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::StartTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.startTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::EndTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.endTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n</ngx-datatable>\r\n\r\n<abp-modal [(visible)]=\"isNewUserDelegateModalOpen\" [suppressUnsavedChangesWarning]=\"true\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::DelegateNewUser' | abpLocalization }}</h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <abp-create-user-delegate (save)=\"refreshData()\"> </abp-create-user-delegate>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
600
600
|
}] });
|
|
601
601
|
|
|
602
|
-
class MyDelegatedUsersComponent {
|
|
603
|
-
constructor() {
|
|
604
|
-
this.subscription = inject(SubscriptionService);
|
|
605
|
-
this.identityUserDelegationService = inject(IdentityUserDelegationService);
|
|
606
|
-
this.service = inject(AbpAuthorityDelegationService);
|
|
607
|
-
this.list = inject(ListService);
|
|
608
|
-
this.filterText = '';
|
|
609
|
-
}
|
|
610
|
-
get pageStartIndex() {
|
|
611
|
-
return this.list.page * this.list.maxResultCount;
|
|
612
|
-
}
|
|
613
|
-
get pageEndIndex() {
|
|
614
|
-
return this.pageStartIndex + this.list.maxResultCount;
|
|
615
|
-
}
|
|
616
|
-
filterByText() {
|
|
617
|
-
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
618
|
-
}
|
|
619
|
-
getFilteredData() {
|
|
620
|
-
const list = this.data.filter(user => user.userName.toLowerCase().includes(this.filterText.toLowerCase()));
|
|
621
|
-
this.resultCount = list.length;
|
|
622
|
-
return list;
|
|
623
|
-
}
|
|
624
|
-
getPageData(start, end) {
|
|
625
|
-
return this.getFilteredData().slice(start, end);
|
|
626
|
-
}
|
|
627
|
-
getAllList() {
|
|
628
|
-
this.identityUserDelegationService.getMyDelegatedUsers().subscribe(res => {
|
|
629
|
-
this.data = res.items;
|
|
630
|
-
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
631
|
-
});
|
|
632
|
-
this.list
|
|
633
|
-
.hookToQuery(query => of({ items: this.getPageData(query.skipCount, query.skipCount + query.maxResultCount) }))
|
|
634
|
-
.subscribe(res => (this.filteredData = res.items));
|
|
635
|
-
}
|
|
636
|
-
ngOnInit() {
|
|
637
|
-
this.list.maxResultCount = 5;
|
|
638
|
-
this.getAllList();
|
|
639
|
-
}
|
|
640
|
-
login(row) {
|
|
641
|
-
const result$ = this.service.delegatedImpersonate(row.id);
|
|
642
|
-
this.subscription.addOne(result$, () => {
|
|
643
|
-
this.service.modalRef.instance.isModalOpen = false;
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
650
|
-
type: Component,
|
|
651
|
-
args: [{ selector: 'abp-my-delegated-users', providers: [ListService], template: "<div class=\"text-end mb-3\">\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"DelegatedUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n</div>\r\n\r\n<ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"100\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <button\r\n type=\"button\"\r\n class=\"btn btn-primary btn-sm\"\r\n [class.disabled]=\"service.getStatus(row) !== 'Active'\"\r\n (click)=\"login(row)\"\r\n >\r\n <span>{{ 'AbpAccount::Login' | abpLocalization }}</span>\r\n </button>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpUi::Status' | abpLocalization\" [maxWidth]=\"125\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <span class=\"badge bg-{{ service.statusClass(row) }}\">\r\n {{ 'AbpAccount::Status' + service.getStatus(row) | abpLocalization }}\r\n </span>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column\r\n [sortable]=\"true\"\r\n [name]=\"'AbpAccount::UserName' | abpLocalization\"\r\n prop=\"userName\"\r\n >\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::StartTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.startTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::EndTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.endTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n</ngx-datatable>\r\n" }]
|
|
602
|
+
class MyDelegatedUsersComponent {
|
|
603
|
+
constructor() {
|
|
604
|
+
this.subscription = inject(SubscriptionService);
|
|
605
|
+
this.identityUserDelegationService = inject(IdentityUserDelegationService);
|
|
606
|
+
this.service = inject(AbpAuthorityDelegationService);
|
|
607
|
+
this.list = inject(ListService);
|
|
608
|
+
this.filterText = '';
|
|
609
|
+
}
|
|
610
|
+
get pageStartIndex() {
|
|
611
|
+
return this.list.page * this.list.maxResultCount;
|
|
612
|
+
}
|
|
613
|
+
get pageEndIndex() {
|
|
614
|
+
return this.pageStartIndex + this.list.maxResultCount;
|
|
615
|
+
}
|
|
616
|
+
filterByText() {
|
|
617
|
+
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
618
|
+
}
|
|
619
|
+
getFilteredData() {
|
|
620
|
+
const list = this.data.filter(user => user.userName.toLowerCase().includes(this.filterText.toLowerCase()));
|
|
621
|
+
this.resultCount = list.length;
|
|
622
|
+
return list;
|
|
623
|
+
}
|
|
624
|
+
getPageData(start, end) {
|
|
625
|
+
return this.getFilteredData().slice(start, end);
|
|
626
|
+
}
|
|
627
|
+
getAllList() {
|
|
628
|
+
this.identityUserDelegationService.getMyDelegatedUsers().subscribe(res => {
|
|
629
|
+
this.data = res.items;
|
|
630
|
+
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
631
|
+
});
|
|
632
|
+
this.list
|
|
633
|
+
.hookToQuery(query => of({ items: this.getPageData(query.skipCount, query.skipCount + query.maxResultCount) }))
|
|
634
|
+
.subscribe(res => (this.filteredData = res.items));
|
|
635
|
+
}
|
|
636
|
+
ngOnInit() {
|
|
637
|
+
this.list.maxResultCount = 5;
|
|
638
|
+
this.getAllList();
|
|
639
|
+
}
|
|
640
|
+
login(row) {
|
|
641
|
+
const result$ = this.service.delegatedImpersonate(row.id);
|
|
642
|
+
this.subscription.addOne(result$, () => {
|
|
643
|
+
this.service.modalRef.instance.isModalOpen = false;
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MyDelegatedUsersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
647
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: MyDelegatedUsersComponent, selector: "abp-my-delegated-users", providers: [ListService], ngImport: i0, template: "<div class=\"text-end mb-3\">\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"DelegatedUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n</div>\r\n\r\n<ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"100\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <button\r\n type=\"button\"\r\n class=\"btn btn-primary btn-sm\"\r\n [class.disabled]=\"service.getStatus(row) !== 'Active'\"\r\n (click)=\"login(row)\"\r\n >\r\n <span>{{ 'AbpAccount::Login' | abpLocalization }}</span>\r\n </button>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpUi::Status' | abpLocalization\" [maxWidth]=\"125\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <span class=\"badge bg-{{ service.statusClass(row) }}\">\r\n {{ 'AbpAccount::Status' + service.getStatus(row) | abpLocalization }}\r\n </span>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column\r\n [sortable]=\"true\"\r\n [name]=\"'AbpAccount::UserName' | abpLocalization\"\r\n prop=\"userName\"\r\n >\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::StartTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.startTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::EndTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.endTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n</ngx-datatable>\r\n", dependencies: [{ kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$2.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i2$2.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i2$2.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "directive", type: i2.NgxDatatableDefaultDirective, selector: "ngx-datatable[default]", inputs: ["class"], exportAs: ["ngxDatatableDefault"] }, { kind: "directive", type: i2.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }, { kind: "pipe", type: i3.ShortDateTimePipe, name: "shortDateTime" }] }); }
|
|
648
|
+
}
|
|
649
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MyDelegatedUsersComponent, decorators: [{
|
|
650
|
+
type: Component,
|
|
651
|
+
args: [{ selector: 'abp-my-delegated-users', providers: [ListService], template: "<div class=\"text-end mb-3\">\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"DelegatedUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n</div>\r\n\r\n<ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"100\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <button\r\n type=\"button\"\r\n class=\"btn btn-primary btn-sm\"\r\n [class.disabled]=\"service.getStatus(row) !== 'Active'\"\r\n (click)=\"login(row)\"\r\n >\r\n <span>{{ 'AbpAccount::Login' | abpLocalization }}</span>\r\n </button>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpUi::Status' | abpLocalization\" [maxWidth]=\"125\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <span class=\"badge bg-{{ service.statusClass(row) }}\">\r\n {{ 'AbpAccount::Status' + service.getStatus(row) | abpLocalization }}\r\n </span>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column\r\n [sortable]=\"true\"\r\n [name]=\"'AbpAccount::UserName' | abpLocalization\"\r\n prop=\"userName\"\r\n >\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::StartTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.startTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::EndTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.endTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n</ngx-datatable>\r\n" }]
|
|
652
652
|
}] });
|
|
653
653
|
|
|
654
|
-
class AuthorityDelegationComponent {
|
|
655
|
-
constructor() {
|
|
656
|
-
this.isModalOpen = true;
|
|
657
|
-
this.option = { size: 'lg' };
|
|
658
|
-
this.tabs = [
|
|
659
|
-
{
|
|
660
|
-
name: 'AbpAccount::DelegatedUsers',
|
|
661
|
-
component: ListAuthorityDelegationComponent,
|
|
662
|
-
},
|
|
663
|
-
{
|
|
664
|
-
name: 'AbpAccount::MyDelegatedUsers',
|
|
665
|
-
component: MyDelegatedUsersComponent,
|
|
666
|
-
},
|
|
667
|
-
];
|
|
668
|
-
this.selected = this.tabs[0];
|
|
669
|
-
this.trackByFn = (_, item) => item.name;
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
675
|
-
type: Component,
|
|
676
|
-
args: [{ selector: 'abp-authority-delegation', template: "<abp-modal [(visible)]=\"isModalOpen\" [suppressUnsavedChangesWarning]=\"true\" [options]=\"option\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::AuthorityDelegation' | abpLocalization }}</h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <ul class=\"nav nav-tabs mb-0\">\r\n <li *abpFor=\"let tab of tabs; trackBy: trackByFn\" class=\"nav-item\">\r\n <a\r\n [id]=\"tab.name + '-tab'\"\r\n role=\"tab\"\r\n class=\"nav-link pointer\"\r\n [class.active]=\"selected.name === tab.name\"\r\n (click)=\"selected = tab\"\r\n >\r\n {{ tab.name | abpLocalization }}\r\n </a>\r\n </li>\r\n </ul>\r\n\r\n <div class=\"tab-content\">\r\n <div class=\"tab-pane active\">\r\n <div class=\"card mb-0\">\r\n <ng-container *ngComponentOutlet=\"selected.component\"></ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
654
|
+
class AuthorityDelegationComponent {
|
|
655
|
+
constructor() {
|
|
656
|
+
this.isModalOpen = true;
|
|
657
|
+
this.option = { size: 'lg' };
|
|
658
|
+
this.tabs = [
|
|
659
|
+
{
|
|
660
|
+
name: 'AbpAccount::DelegatedUsers',
|
|
661
|
+
component: ListAuthorityDelegationComponent,
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
name: 'AbpAccount::MyDelegatedUsers',
|
|
665
|
+
component: MyDelegatedUsersComponent,
|
|
666
|
+
},
|
|
667
|
+
];
|
|
668
|
+
this.selected = this.tabs[0];
|
|
669
|
+
this.trackByFn = (_, item) => item.name;
|
|
670
|
+
}
|
|
671
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: AuthorityDelegationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
672
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: AuthorityDelegationComponent, selector: "abp-authority-delegation", ngImport: i0, template: "<abp-modal [(visible)]=\"isModalOpen\" [suppressUnsavedChangesWarning]=\"true\" [options]=\"option\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::AuthorityDelegation' | abpLocalization }}</h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <ul class=\"nav nav-tabs mb-0\">\r\n <li *abpFor=\"let tab of tabs; trackBy: trackByFn\" class=\"nav-item\">\r\n <a\r\n [id]=\"tab.name + '-tab'\"\r\n role=\"tab\"\r\n class=\"nav-link pointer\"\r\n [class.active]=\"selected.name === tab.name\"\r\n (click)=\"selected = tab\"\r\n >\r\n {{ tab.name | abpLocalization }}\r\n </a>\r\n </li>\r\n </ul>\r\n\r\n <div class=\"tab-content\">\r\n <div class=\"tab-pane active\">\r\n <div class=\"card mb-0\">\r\n <ng-container *ngComponentOutlet=\"selected.component\"></ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</abp-modal>\r\n", dependencies: [{ kind: "directive", type: i2$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: i3.ForDirective, selector: "[abpFor]", inputs: ["abpForOf", "abpForOrderBy", "abpForOrderDir", "abpForFilterBy", "abpForFilterVal", "abpForTrackBy", "abpForCompareBy", "abpForEmptyRef"] }, { kind: "component", type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
673
|
+
}
|
|
674
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: AuthorityDelegationComponent, decorators: [{
|
|
675
|
+
type: Component,
|
|
676
|
+
args: [{ selector: 'abp-authority-delegation', template: "<abp-modal [(visible)]=\"isModalOpen\" [suppressUnsavedChangesWarning]=\"true\" [options]=\"option\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::AuthorityDelegation' | abpLocalization }}</h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <ul class=\"nav nav-tabs mb-0\">\r\n <li *abpFor=\"let tab of tabs; trackBy: trackByFn\" class=\"nav-item\">\r\n <a\r\n [id]=\"tab.name + '-tab'\"\r\n role=\"tab\"\r\n class=\"nav-link pointer\"\r\n [class.active]=\"selected.name === tab.name\"\r\n (click)=\"selected = tab\"\r\n >\r\n {{ tab.name | abpLocalization }}\r\n </a>\r\n </li>\r\n </ul>\r\n\r\n <div class=\"tab-content\">\r\n <div class=\"tab-pane active\">\r\n <div class=\"card mb-0\">\r\n <ng-container *ngComponentOutlet=\"selected.component\"></ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
677
677
|
}] });
|
|
678
678
|
|
|
679
|
-
const declarationsWithExports$1 = [
|
|
680
|
-
AuthorityDelegationComponent,
|
|
681
|
-
ListAuthorityDelegationComponent,
|
|
682
|
-
MyDelegatedUsersComponent,
|
|
683
|
-
CreateUserDelegateComponent,
|
|
684
|
-
];
|
|
685
|
-
class AuthorityDelegationModule {
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
707
|
-
type: NgModule,
|
|
708
|
-
args: [{
|
|
709
|
-
declarations: [...declarationsWithExports$1],
|
|
710
|
-
exports: [...declarationsWithExports$1],
|
|
711
|
-
imports: [
|
|
712
|
-
CoreModule,
|
|
713
|
-
ThemeSharedModule,
|
|
714
|
-
NgbDropdownModule,
|
|
715
|
-
NgbNavModule,
|
|
716
|
-
NgxValidateCoreModule,
|
|
717
|
-
CommercialUiModule,
|
|
718
|
-
],
|
|
719
|
-
}]
|
|
679
|
+
const declarationsWithExports$1 = [
|
|
680
|
+
AuthorityDelegationComponent,
|
|
681
|
+
ListAuthorityDelegationComponent,
|
|
682
|
+
MyDelegatedUsersComponent,
|
|
683
|
+
CreateUserDelegateComponent,
|
|
684
|
+
];
|
|
685
|
+
class AuthorityDelegationModule {
|
|
686
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: AuthorityDelegationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
687
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: AuthorityDelegationModule, declarations: [AuthorityDelegationComponent,
|
|
688
|
+
ListAuthorityDelegationComponent,
|
|
689
|
+
MyDelegatedUsersComponent,
|
|
690
|
+
CreateUserDelegateComponent], imports: [CoreModule,
|
|
691
|
+
ThemeSharedModule,
|
|
692
|
+
NgbDropdownModule,
|
|
693
|
+
NgbNavModule,
|
|
694
|
+
NgxValidateCoreModule,
|
|
695
|
+
CommercialUiModule], exports: [AuthorityDelegationComponent,
|
|
696
|
+
ListAuthorityDelegationComponent,
|
|
697
|
+
MyDelegatedUsersComponent,
|
|
698
|
+
CreateUserDelegateComponent] }); }
|
|
699
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: AuthorityDelegationModule, imports: [CoreModule,
|
|
700
|
+
ThemeSharedModule,
|
|
701
|
+
NgbDropdownModule,
|
|
702
|
+
NgbNavModule,
|
|
703
|
+
NgxValidateCoreModule,
|
|
704
|
+
CommercialUiModule] }); }
|
|
705
|
+
}
|
|
706
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: AuthorityDelegationModule, decorators: [{
|
|
707
|
+
type: NgModule,
|
|
708
|
+
args: [{
|
|
709
|
+
declarations: [...declarationsWithExports$1],
|
|
710
|
+
exports: [...declarationsWithExports$1],
|
|
711
|
+
imports: [
|
|
712
|
+
CoreModule,
|
|
713
|
+
ThemeSharedModule,
|
|
714
|
+
NgbDropdownModule,
|
|
715
|
+
NgbNavModule,
|
|
716
|
+
NgxValidateCoreModule,
|
|
717
|
+
CommercialUiModule,
|
|
718
|
+
],
|
|
719
|
+
}]
|
|
720
720
|
}] });
|
|
721
721
|
|
|
722
|
-
const IDENTITY_ROUTE_PROVIDERS = [
|
|
723
|
-
{ provide: APP_INITIALIZER, useFactory: configureRoutes, deps: [RoutesService], multi: true },
|
|
724
|
-
];
|
|
725
|
-
function configureRoutes(routes) {
|
|
726
|
-
return () => {
|
|
727
|
-
routes.add([
|
|
728
|
-
{
|
|
729
|
-
path: '/identity',
|
|
730
|
-
name: "AbpIdentity::Menu:IdentityManagement" /* eIdentityRouteNames.IdentityManagement */,
|
|
731
|
-
parentName: "AbpUiNavigation::Menu:Administration" /* eThemeSharedRouteNames.Administration */,
|
|
732
|
-
order: 2,
|
|
733
|
-
layout: "application" /* eLayoutType.application */,
|
|
734
|
-
iconClass: 'fa fa-id-card-o',
|
|
735
|
-
requiredPolicy: "AbpIdentity.Roles || AbpIdentity.Users || AbpIdentity.ClaimTypes || AbpIdentity.OrganizationUnits" /* eIdentityPolicyNames.IdentityManagement */,
|
|
736
|
-
},
|
|
737
|
-
{
|
|
738
|
-
path: '/identity/organization-units',
|
|
739
|
-
name: "AbpIdentity::OrganizationUnits" /* eIdentityRouteNames.OrganizationUnits */,
|
|
740
|
-
parentName: "AbpIdentity::Menu:IdentityManagement" /* eIdentityRouteNames.IdentityManagement */,
|
|
741
|
-
order: 1,
|
|
742
|
-
requiredPolicy: "AbpIdentity.OrganizationUnits" /* eIdentityPolicyNames.OrganizationUnits */,
|
|
743
|
-
},
|
|
744
|
-
{
|
|
745
|
-
path: '/identity/roles',
|
|
746
|
-
name: "AbpIdentity::Roles" /* eIdentityRouteNames.Roles */,
|
|
747
|
-
parentName: "AbpIdentity::Menu:IdentityManagement" /* eIdentityRouteNames.IdentityManagement */,
|
|
748
|
-
order: 2,
|
|
749
|
-
requiredPolicy: "AbpIdentity.Roles" /* eIdentityPolicyNames.Roles */,
|
|
750
|
-
},
|
|
751
|
-
{
|
|
752
|
-
path: '/identity/users',
|
|
753
|
-
name: "AbpIdentity::Users" /* eIdentityRouteNames.Users */,
|
|
754
|
-
parentName: "AbpIdentity::Menu:IdentityManagement" /* eIdentityRouteNames.IdentityManagement */,
|
|
755
|
-
order: 3,
|
|
756
|
-
requiredPolicy: "AbpIdentity.Users" /* eIdentityPolicyNames.Users */,
|
|
757
|
-
},
|
|
758
|
-
{
|
|
759
|
-
path: '/identity/claim-types',
|
|
760
|
-
name: "AbpIdentity::ClaimTypes" /* eIdentityRouteNames.ClaimTypes */,
|
|
761
|
-
parentName: "AbpIdentity::Menu:IdentityManagement" /* eIdentityRouteNames.IdentityManagement */,
|
|
762
|
-
order: 4,
|
|
763
|
-
requiredPolicy: "AbpIdentity.ClaimTypes" /* eIdentityPolicyNames.ClaimTypes */,
|
|
764
|
-
},
|
|
765
|
-
{
|
|
766
|
-
path: '/identity/security-logs',
|
|
767
|
-
name: "AbpIdentity::SecurityLogs" /* eIdentityRouteNames.SecurityLogs */,
|
|
768
|
-
parentName: "AbpIdentity::Menu:IdentityManagement" /* eIdentityRouteNames.IdentityManagement */,
|
|
769
|
-
order: 4,
|
|
770
|
-
requiredPolicy: "AbpIdentity.SecurityLogs" /* eIdentityPolicyNames.SecurityLogs */,
|
|
771
|
-
},
|
|
772
|
-
]);
|
|
773
|
-
};
|
|
722
|
+
const IDENTITY_ROUTE_PROVIDERS = [
|
|
723
|
+
{ provide: APP_INITIALIZER, useFactory: configureRoutes, deps: [RoutesService], multi: true },
|
|
724
|
+
];
|
|
725
|
+
function configureRoutes(routes) {
|
|
726
|
+
return () => {
|
|
727
|
+
routes.add([
|
|
728
|
+
{
|
|
729
|
+
path: '/identity',
|
|
730
|
+
name: "AbpIdentity::Menu:IdentityManagement" /* eIdentityRouteNames.IdentityManagement */,
|
|
731
|
+
parentName: "AbpUiNavigation::Menu:Administration" /* eThemeSharedRouteNames.Administration */,
|
|
732
|
+
order: 2,
|
|
733
|
+
layout: "application" /* eLayoutType.application */,
|
|
734
|
+
iconClass: 'fa fa-id-card-o',
|
|
735
|
+
requiredPolicy: "AbpIdentity.Roles || AbpIdentity.Users || AbpIdentity.ClaimTypes || AbpIdentity.OrganizationUnits" /* eIdentityPolicyNames.IdentityManagement */,
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
path: '/identity/organization-units',
|
|
739
|
+
name: "AbpIdentity::OrganizationUnits" /* eIdentityRouteNames.OrganizationUnits */,
|
|
740
|
+
parentName: "AbpIdentity::Menu:IdentityManagement" /* eIdentityRouteNames.IdentityManagement */,
|
|
741
|
+
order: 1,
|
|
742
|
+
requiredPolicy: "AbpIdentity.OrganizationUnits" /* eIdentityPolicyNames.OrganizationUnits */,
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
path: '/identity/roles',
|
|
746
|
+
name: "AbpIdentity::Roles" /* eIdentityRouteNames.Roles */,
|
|
747
|
+
parentName: "AbpIdentity::Menu:IdentityManagement" /* eIdentityRouteNames.IdentityManagement */,
|
|
748
|
+
order: 2,
|
|
749
|
+
requiredPolicy: "AbpIdentity.Roles" /* eIdentityPolicyNames.Roles */,
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
path: '/identity/users',
|
|
753
|
+
name: "AbpIdentity::Users" /* eIdentityRouteNames.Users */,
|
|
754
|
+
parentName: "AbpIdentity::Menu:IdentityManagement" /* eIdentityRouteNames.IdentityManagement */,
|
|
755
|
+
order: 3,
|
|
756
|
+
requiredPolicy: "AbpIdentity.Users" /* eIdentityPolicyNames.Users */,
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
path: '/identity/claim-types',
|
|
760
|
+
name: "AbpIdentity::ClaimTypes" /* eIdentityRouteNames.ClaimTypes */,
|
|
761
|
+
parentName: "AbpIdentity::Menu:IdentityManagement" /* eIdentityRouteNames.IdentityManagement */,
|
|
762
|
+
order: 4,
|
|
763
|
+
requiredPolicy: "AbpIdentity.ClaimTypes" /* eIdentityPolicyNames.ClaimTypes */,
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
path: '/identity/security-logs',
|
|
767
|
+
name: "AbpIdentity::SecurityLogs" /* eIdentityRouteNames.SecurityLogs */,
|
|
768
|
+
parentName: "AbpIdentity::Menu:IdentityManagement" /* eIdentityRouteNames.IdentityManagement */,
|
|
769
|
+
order: 4,
|
|
770
|
+
requiredPolicy: "AbpIdentity.SecurityLogs" /* eIdentityPolicyNames.SecurityLogs */,
|
|
771
|
+
},
|
|
772
|
+
]);
|
|
773
|
+
};
|
|
774
774
|
}
|
|
775
775
|
|
|
776
|
-
const IDENTITY_SETTING_TAB_PROVIDERS = [
|
|
777
|
-
{
|
|
778
|
-
provide: APP_INITIALIZER,
|
|
779
|
-
useFactory: configureSettingTabs,
|
|
780
|
-
deps: [SettingTabsService],
|
|
781
|
-
multi: true,
|
|
782
|
-
},
|
|
783
|
-
];
|
|
784
|
-
function configureSettingTabs(settingtabs) {
|
|
785
|
-
return () => {
|
|
786
|
-
settingtabs.add([
|
|
787
|
-
{
|
|
788
|
-
name: "AbpIdentity::Menu:IdentityManagement" /* eIdentitySettingTabNames.IdentityManagement */,
|
|
789
|
-
order: 101,
|
|
790
|
-
requiredPolicy: 'AbpIdentity.SettingManagement',
|
|
791
|
-
component: IdentitySettingsComponent,
|
|
792
|
-
},
|
|
793
|
-
]);
|
|
794
|
-
};
|
|
776
|
+
const IDENTITY_SETTING_TAB_PROVIDERS = [
|
|
777
|
+
{
|
|
778
|
+
provide: APP_INITIALIZER,
|
|
779
|
+
useFactory: configureSettingTabs,
|
|
780
|
+
deps: [SettingTabsService],
|
|
781
|
+
multi: true,
|
|
782
|
+
},
|
|
783
|
+
];
|
|
784
|
+
function configureSettingTabs(settingtabs) {
|
|
785
|
+
return () => {
|
|
786
|
+
settingtabs.add([
|
|
787
|
+
{
|
|
788
|
+
name: "AbpIdentity::Menu:IdentityManagement" /* eIdentitySettingTabNames.IdentityManagement */,
|
|
789
|
+
order: 101,
|
|
790
|
+
requiredPolicy: 'AbpIdentity.SettingManagement',
|
|
791
|
+
component: IdentitySettingsComponent,
|
|
792
|
+
},
|
|
793
|
+
]);
|
|
794
|
+
};
|
|
795
795
|
}
|
|
796
796
|
|
|
797
|
-
function openMyLinkUsersFactory(injector) {
|
|
798
|
-
const contentProjectionService = injector.get(ContentProjectionService);
|
|
799
|
-
let componentRef;
|
|
800
|
-
return () => {
|
|
801
|
-
if (componentRef) {
|
|
802
|
-
componentRef.instance.isModalOpen = true;
|
|
803
|
-
return;
|
|
804
|
-
}
|
|
805
|
-
componentRef = contentProjectionService.projectContent(PROJECTION_STRATEGY.AppendComponentToBody(MyLinkUsersModalComponent));
|
|
806
|
-
};
|
|
807
|
-
}
|
|
808
|
-
function openAuthorityDelegationFactory(injector) {
|
|
809
|
-
const contentProjectionService = injector.get(ContentProjectionService);
|
|
810
|
-
const delegationService = injector.get(AbpAuthorityDelegationService);
|
|
811
|
-
return () => {
|
|
812
|
-
if (delegationService.modalRef) {
|
|
813
|
-
delegationService.modalRef.instance.isModalOpen = true;
|
|
814
|
-
return;
|
|
815
|
-
}
|
|
816
|
-
delegationService.modalRef = contentProjectionService.projectContent(PROJECTION_STRATEGY.AppendComponentToBody(AuthorityDelegationComponent));
|
|
817
|
-
};
|
|
797
|
+
function openMyLinkUsersFactory(injector) {
|
|
798
|
+
const contentProjectionService = injector.get(ContentProjectionService);
|
|
799
|
+
let componentRef;
|
|
800
|
+
return () => {
|
|
801
|
+
if (componentRef) {
|
|
802
|
+
componentRef.instance.isModalOpen = true;
|
|
803
|
+
return;
|
|
804
|
+
}
|
|
805
|
+
componentRef = contentProjectionService.projectContent(PROJECTION_STRATEGY.AppendComponentToBody(MyLinkUsersModalComponent));
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
function openAuthorityDelegationFactory(injector) {
|
|
809
|
+
const contentProjectionService = injector.get(ContentProjectionService);
|
|
810
|
+
const delegationService = injector.get(AbpAuthorityDelegationService);
|
|
811
|
+
return () => {
|
|
812
|
+
if (delegationService.modalRef) {
|
|
813
|
+
delegationService.modalRef.instance.isModalOpen = true;
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
delegationService.modalRef = contentProjectionService.projectContent(PROJECTION_STRATEGY.AppendComponentToBody(AuthorityDelegationComponent));
|
|
817
|
+
};
|
|
818
818
|
}
|
|
819
819
|
|
|
820
|
-
const declarationsWithExports = [
|
|
821
|
-
IdentitySettingsComponent,
|
|
822
|
-
IdentitySettingComponent,
|
|
823
|
-
IdentityExternalLoginSettingsComponent,
|
|
824
|
-
IdentityLdapSettingsComponent,
|
|
825
|
-
MyLinkUsersModalComponent,
|
|
826
|
-
];
|
|
827
|
-
class IdentityConfigModule {
|
|
828
|
-
static forRoot() {
|
|
829
|
-
return {
|
|
830
|
-
ngModule: IdentityConfigModule,
|
|
831
|
-
providers: [
|
|
832
|
-
IDENTITY_ROUTE_PROVIDERS,
|
|
833
|
-
IDENTITY_SETTING_TAB_PROVIDERS,
|
|
834
|
-
{ provide: OPEN_MY_LINK_USERS_MODAL, useFactory: openMyLinkUsersFactory, deps: [Injector] },
|
|
835
|
-
{
|
|
836
|
-
provide: OPEN_AUTHORITY_DELEGATION_MODAL,
|
|
837
|
-
useFactory: openAuthorityDelegationFactory,
|
|
838
|
-
deps: [Injector],
|
|
839
|
-
},
|
|
840
|
-
{ provide: APP_INITIALIZER, multi: true, useFactory: noop, deps: [LinkLoginHandler] },
|
|
841
|
-
],
|
|
842
|
-
};
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
867
|
-
type: NgModule,
|
|
868
|
-
args: [{
|
|
869
|
-
imports: [
|
|
870
|
-
CoreModule,
|
|
871
|
-
ThemeSharedModule,
|
|
872
|
-
NgbDropdownModule,
|
|
873
|
-
NgbNavModule,
|
|
874
|
-
NgxValidateCoreModule,
|
|
875
|
-
AuthorityDelegationModule,
|
|
876
|
-
],
|
|
877
|
-
declarations: [...declarationsWithExports],
|
|
878
|
-
exports: [...declarationsWithExports],
|
|
879
|
-
}]
|
|
820
|
+
const declarationsWithExports = [
|
|
821
|
+
IdentitySettingsComponent,
|
|
822
|
+
IdentitySettingComponent,
|
|
823
|
+
IdentityExternalLoginSettingsComponent,
|
|
824
|
+
IdentityLdapSettingsComponent,
|
|
825
|
+
MyLinkUsersModalComponent,
|
|
826
|
+
];
|
|
827
|
+
class IdentityConfigModule {
|
|
828
|
+
static forRoot() {
|
|
829
|
+
return {
|
|
830
|
+
ngModule: IdentityConfigModule,
|
|
831
|
+
providers: [
|
|
832
|
+
IDENTITY_ROUTE_PROVIDERS,
|
|
833
|
+
IDENTITY_SETTING_TAB_PROVIDERS,
|
|
834
|
+
{ provide: OPEN_MY_LINK_USERS_MODAL, useFactory: openMyLinkUsersFactory, deps: [Injector] },
|
|
835
|
+
{
|
|
836
|
+
provide: OPEN_AUTHORITY_DELEGATION_MODAL,
|
|
837
|
+
useFactory: openAuthorityDelegationFactory,
|
|
838
|
+
deps: [Injector],
|
|
839
|
+
},
|
|
840
|
+
{ provide: APP_INITIALIZER, multi: true, useFactory: noop, deps: [LinkLoginHandler] },
|
|
841
|
+
],
|
|
842
|
+
};
|
|
843
|
+
}
|
|
844
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentityConfigModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
845
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: IdentityConfigModule, declarations: [IdentitySettingsComponent,
|
|
846
|
+
IdentitySettingComponent,
|
|
847
|
+
IdentityExternalLoginSettingsComponent,
|
|
848
|
+
IdentityLdapSettingsComponent,
|
|
849
|
+
MyLinkUsersModalComponent], imports: [CoreModule,
|
|
850
|
+
ThemeSharedModule,
|
|
851
|
+
NgbDropdownModule,
|
|
852
|
+
NgbNavModule,
|
|
853
|
+
NgxValidateCoreModule,
|
|
854
|
+
AuthorityDelegationModule], exports: [IdentitySettingsComponent,
|
|
855
|
+
IdentitySettingComponent,
|
|
856
|
+
IdentityExternalLoginSettingsComponent,
|
|
857
|
+
IdentityLdapSettingsComponent,
|
|
858
|
+
MyLinkUsersModalComponent] }); }
|
|
859
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentityConfigModule, imports: [CoreModule,
|
|
860
|
+
ThemeSharedModule,
|
|
861
|
+
NgbDropdownModule,
|
|
862
|
+
NgbNavModule,
|
|
863
|
+
NgxValidateCoreModule,
|
|
864
|
+
AuthorityDelegationModule] }); }
|
|
865
|
+
}
|
|
866
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: IdentityConfigModule, decorators: [{
|
|
867
|
+
type: NgModule,
|
|
868
|
+
args: [{
|
|
869
|
+
imports: [
|
|
870
|
+
CoreModule,
|
|
871
|
+
ThemeSharedModule,
|
|
872
|
+
NgbDropdownModule,
|
|
873
|
+
NgbNavModule,
|
|
874
|
+
NgxValidateCoreModule,
|
|
875
|
+
AuthorityDelegationModule,
|
|
876
|
+
],
|
|
877
|
+
declarations: [...declarationsWithExports],
|
|
878
|
+
exports: [...declarationsWithExports],
|
|
879
|
+
}]
|
|
880
880
|
}] });
|
|
881
881
|
|
|
882
|
-
/**
|
|
883
|
-
* Generated bundle index. Do not edit.
|
|
882
|
+
/**
|
|
883
|
+
* Generated bundle index. Do not edit.
|
|
884
884
|
*/
|
|
885
885
|
|
|
886
886
|
export { AbpAuthorityDelegationService, AuthorityDelegationComponent, AuthorityDelegationModule, CreateUserDelegateComponent, IDENTITY_ROUTE_PROVIDERS, IDENTITY_SETTING_TAB_PROVIDERS, IdentityConfigModule, IdentityConfigService, IdentityExternalLoginSettingsComponent, IdentityLdapSettingsComponent, IdentityLinkLoginService, IdentitySettingComponent, IdentitySettingsComponent, LinkLoginHandler, ListAuthorityDelegationComponent, MyDelegatedUsersComponent, MyLinkUsersModalComponent, configureRoutes, configureSettingTabs };
|