Browse Source
Merge pull request #17518 from abpframework/issue-17506
Fix user self disable issue
pull/17554/head
Mahmut Gundogdu
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
13 additions and
2 deletions
-
npm/ng-packs/packages/identity/src/lib/defaults/default-users-form-props.ts
|
|
|
@ -1,7 +1,8 @@ |
|
|
|
import { IdentityUserDto } from '@abp/ng.identity/proxy'; |
|
|
|
import { Validators } from '@angular/forms'; |
|
|
|
import { ConfigStateService, CurrentUserDto } from '@abp/ng.core'; |
|
|
|
import { getPasswordValidators } from '@abp/ng.theme.shared'; |
|
|
|
import { ePropType, FormProp } from '@abp/ng.theme.shared/extensions'; |
|
|
|
import { Validators } from '@angular/forms'; |
|
|
|
import { IdentityUserDto } from '@abp/ng.identity/proxy'; |
|
|
|
|
|
|
|
export const DEFAULT_USERS_CREATE_FORM_PROPS = FormProp.createMany<IdentityUserDto>([ |
|
|
|
{ |
|
|
|
@ -70,5 +71,15 @@ export const DEFAULT_USERS_EDIT_FORM_PROPS = DEFAULT_USERS_CREATE_FORM_PROPS.map |
|
|
|
validators: (data: any) => [...getPasswordValidators({ get: data.getInjected })], |
|
|
|
}; |
|
|
|
} |
|
|
|
if (prop.name === 'isActive') { |
|
|
|
return { |
|
|
|
...prop, |
|
|
|
visible: data => { |
|
|
|
const configState = data.getInjected(ConfigStateService); |
|
|
|
const currentUserId = configState.getDeep('currentUser.id'); |
|
|
|
return currentUserId !== data.record.id; |
|
|
|
}, |
|
|
|
}; |
|
|
|
} |
|
|
|
return prop; |
|
|
|
}); |
|
|
|
|