|
|
|
|
@ -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 currentUser = configState.getOne('currentUser') as CurrentUserDto;
|
|
|
|
|
return currentUser.id !== data.record.id;
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
return prop;
|
|
|
|
|
});
|
|
|
|
|
|