mirror of https://github.com/abpframework/abp.git
4 changed files with 132 additions and 0 deletions
@ -0,0 +1,30 @@ |
|||||
|
import { EntityAction } from '@abp/ng.theme.shared/extensions'; |
||||
|
import { UsersComponent } from '../components/users/users.component'; |
||||
|
import { IdentityUserDto } from '../proxy/identity/models'; |
||||
|
|
||||
|
export const DEFAULT_USERS_ENTITY_ACTIONS = EntityAction.createMany<IdentityUserDto>([ |
||||
|
{ |
||||
|
text: 'AbpIdentity::Edit', |
||||
|
action: data => { |
||||
|
const component = data.getInjected(UsersComponent); |
||||
|
component.edit(data.record.id); |
||||
|
}, |
||||
|
permission: 'AbpIdentity.Users.Update', |
||||
|
}, |
||||
|
{ |
||||
|
text: 'AbpIdentity::Permissions', |
||||
|
action: data => { |
||||
|
const component = data.getInjected(UsersComponent); |
||||
|
component.openPermissionsModal(data.record.id); |
||||
|
}, |
||||
|
permission: 'AbpIdentity.Users.ManagePermissions', |
||||
|
}, |
||||
|
{ |
||||
|
text: 'AbpIdentity::Delete', |
||||
|
action: data => { |
||||
|
const component = data.getInjected(UsersComponent); |
||||
|
component.delete(data.record.id, data.record.name || data.record.userName); |
||||
|
}, |
||||
|
permission: 'AbpIdentity.Users.Delete', |
||||
|
}, |
||||
|
]); |
||||
@ -0,0 +1,26 @@ |
|||||
|
import { EntityProp, ePropType } from '@abp/ng.theme.shared/extensions'; |
||||
|
import { IdentityUserDto } from '../proxy/identity/models'; |
||||
|
|
||||
|
export const DEFAULT_USERS_ENTITY_PROPS = EntityProp.createMany<IdentityUserDto>([ |
||||
|
{ |
||||
|
type: ePropType.String, |
||||
|
name: 'userName', |
||||
|
displayName: 'AbpIdentity::UserName', |
||||
|
sortable: true, |
||||
|
columnWidth: 250, |
||||
|
}, |
||||
|
{ |
||||
|
type: ePropType.String, |
||||
|
name: 'email', |
||||
|
displayName: 'AbpIdentity::EmailAddress', |
||||
|
sortable: true, |
||||
|
columnWidth: 250, |
||||
|
}, |
||||
|
{ |
||||
|
type: ePropType.String, |
||||
|
name: 'phoneNumber', |
||||
|
displayName: 'AbpIdentity::PhoneNumber', |
||||
|
sortable: true, |
||||
|
columnWidth: 250, |
||||
|
}, |
||||
|
]); |
||||
@ -0,0 +1,61 @@ |
|||||
|
import { getPasswordValidators } from '@abp/ng.theme.shared'; |
||||
|
import { ePropType, FormProp } from '@abp/ng.theme.shared/extensions'; |
||||
|
import { Validators } from '@angular/forms'; |
||||
|
import { IdentityUserDto } from '../proxy/identity/models'; |
||||
|
|
||||
|
export const DEFAULT_USERS_CREATE_FORM_PROPS = FormProp.createMany<IdentityUserDto>([ |
||||
|
{ |
||||
|
type: ePropType.String, |
||||
|
name: 'userName', |
||||
|
displayName: 'AbpIdentity::UserName', |
||||
|
id: 'user-name', |
||||
|
validators: () => [Validators.required, Validators.maxLength(256)], |
||||
|
}, |
||||
|
{ |
||||
|
type: ePropType.Password, |
||||
|
name: 'password', |
||||
|
displayName: 'AbpIdentity::Password', |
||||
|
id: 'password', |
||||
|
autocomplete: 'new-password', |
||||
|
validators: data => [Validators.required, ...getPasswordValidators({ get: data.getInjected })], |
||||
|
}, |
||||
|
{ |
||||
|
type: ePropType.String, |
||||
|
name: 'name', |
||||
|
displayName: 'AbpIdentity::DisplayName:Name', |
||||
|
id: 'name', |
||||
|
validators: () => [Validators.maxLength(64)], |
||||
|
}, |
||||
|
{ |
||||
|
type: ePropType.String, |
||||
|
name: 'surname', |
||||
|
displayName: 'AbpIdentity::DisplayName:Surname', |
||||
|
id: 'surname', |
||||
|
validators: () => [Validators.maxLength(64)], |
||||
|
}, |
||||
|
{ |
||||
|
type: ePropType.Email, |
||||
|
name: 'email', |
||||
|
displayName: 'AbpIdentity::EmailAddress', |
||||
|
id: 'email', |
||||
|
validators: () => [Validators.required, Validators.maxLength(256), Validators.email], |
||||
|
}, |
||||
|
{ |
||||
|
type: ePropType.String, |
||||
|
name: 'phoneNumber', |
||||
|
displayName: 'AbpIdentity::PhoneNumber', |
||||
|
id: 'phone-number', |
||||
|
validators: () => [Validators.maxLength(16)], |
||||
|
}, |
||||
|
{ |
||||
|
type: ePropType.Boolean, |
||||
|
name: 'lockoutEnabled', |
||||
|
displayName: 'AbpIdentity::DisplayName:LockoutEnabled', |
||||
|
id: 'lockout-checkbox', |
||||
|
defaultValue: true, |
||||
|
}, |
||||
|
]); |
||||
|
|
||||
|
export const DEFAULT_USERS_EDIT_FORM_PROPS = DEFAULT_USERS_CREATE_FORM_PROPS.filter( |
||||
|
prop => prop.name !== 'password', |
||||
|
); |
||||
@ -0,0 +1,15 @@ |
|||||
|
import { ToolbarAction } from '@abp/ng.theme.shared/extensions'; |
||||
|
import { UsersComponent } from '../components/users/users.component'; |
||||
|
import { IdentityUserDto } from '../proxy/identity/models'; |
||||
|
|
||||
|
export const DEFAULT_USERS_TOOLBAR_ACTIONS = ToolbarAction.createMany<IdentityUserDto[]>([ |
||||
|
{ |
||||
|
text: 'AbpIdentity::NewUser', |
||||
|
action: data => { |
||||
|
const component = data.getInjected(UsersComponent); |
||||
|
component.add(); |
||||
|
}, |
||||
|
permission: 'AbpIdentity.Users.Create', |
||||
|
icon: 'fa fa-plus', |
||||
|
}, |
||||
|
]); |
||||
Loading…
Reference in new issue