Browse Source

[Feature][UI Next] Add e2e to security user manage page. (#8443)

3.0.0/version-upgrade
songjianet 3 years ago committed by GitHub
parent
commit
849fb75b3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 41
      dolphinscheduler-ui-next/docs/e2e/security.md
  2. 24
      dolphinscheduler-ui-next/src/views/security/user-manage/components/user-modal.tsx
  3. 9
      dolphinscheduler-ui-next/src/views/security/user-manage/index.tsx
  4. 5
      dolphinscheduler-ui-next/src/views/security/user-manage/use-table.tsx

41
dolphinscheduler-ui-next/docs/e2e/security.md

@ -28,28 +28,25 @@ class:
#### user manage #### user manage
class: | check | class |
| ------------------ |---------------------|
- [ ] items | :white_check_mark: | items |
- [ ] el-popconfirm | | el-popconfirm |
- [ ] el-button--primary | | el-button--primary |
- [ ] name | :white_check_mark: | name |
- [ ] edit | :white_check_mark: | edit |
- [ ] delete | :white_check_mark: | delete |
| :white_check_mark: | btn-create-user |
id: | :white_check_mark: | input-username |
| :white_check_mark: | input-password |
- [ ] btnCreateUser | :white_check_mark: | select-tenant |
- [ ] inputUserName | :white_check_mark: | select-queue |
- [ ] inputUserPassword | :white_check_mark: | input-email |
- [ ] selectTenant | :white_check_mark: | input-phone |
- [ ] selectQueue | :white_check_mark: | radio-state-enable |
- [ ] inputEmail | :white_check_mark: | radio=state-disable |
- [ ] inputPhone | :white_check_mark: | btn-submit |
- [ ] radioStateEnable | :white_check_mark: | btn-cancel |
- [ ] radioStateDisable
- [ ] btnSubmit
- [ ] btnCancel
#### worker group manage #### worker group manage

24
dolphinscheduler-ui-next/src/views/security/user-manage/components/user-modal.tsx

@ -57,6 +57,8 @@ export const UserModal = defineComponent({
onCancel={this.onModalCancel} onCancel={this.onModalCancel}
confirmLoading={this.confirmLoading} confirmLoading={this.confirmLoading}
onConfirm={this.onConfirm} onConfirm={this.onConfirm}
confirmClassName='btn-submit'
cancelClassName='btn-cancel'
> >
{{ {{
default: () => { default: () => {
@ -78,6 +80,7 @@ export const UserModal = defineComponent({
> >
<NFormItem label={t('security.user.username')} path='userName'> <NFormItem label={t('security.user.username')} path='userName'>
<NInput <NInput
class='input-username'
inputProps={{ autocomplete: 'off' }} inputProps={{ autocomplete: 'off' }}
v-model:value={this.formValues.userName} v-model:value={this.formValues.userName}
/> />
@ -87,6 +90,7 @@ export const UserModal = defineComponent({
path='userPassword' path='userPassword'
> >
<NInput <NInput
class='input-password'
inputProps={{ autocomplete: 'off' }} inputProps={{ autocomplete: 'off' }}
type='password' type='password'
v-model:value={this.formValues.userPassword} v-model:value={this.formValues.userPassword}
@ -97,27 +101,39 @@ export const UserModal = defineComponent({
path='tenantId' path='tenantId'
> >
<NSelect <NSelect
class='select-tenant'
options={this.tenants} options={this.tenants}
v-model:value={this.formValues.tenantId} v-model:value={this.formValues.tenantId}
/> />
</NFormItem> </NFormItem>
<NFormItem label={t('security.user.queue')} path='queue'> <NFormItem label={t('security.user.queue')} path='queue'>
<NSelect <NSelect
class='select-queue'
options={this.queues} options={this.queues}
v-model:value={this.formValues.queue} v-model:value={this.formValues.queue}
/> />
</NFormItem> </NFormItem>
<NFormItem label={t('security.user.email')} path='email'> <NFormItem label={t('security.user.email')} path='email'>
<NInput v-model:value={this.formValues.email} /> <NInput
class='input-email'
v-model:value={this.formValues.email}
/>
</NFormItem> </NFormItem>
<NFormItem label={t('security.user.phone')} path='phone'> <NFormItem label={t('security.user.phone')} path='phone'>
<NInput v-model:value={this.formValues.phone} /> <NInput
class='input-phone'
v-model:value={this.formValues.phone}
/>
</NFormItem> </NFormItem>
<NFormItem label={t('security.user.state')} path='state'> <NFormItem label={t('security.user.state')} path='state'>
<NRadioGroup v-model:value={this.formValues.state}> <NRadioGroup v-model:value={this.formValues.state}>
<NSpace> <NSpace>
<NRadio value={1}></NRadio> <NRadio value={1} class='radio-state-enable'>
<NRadio value={0}></NRadio>
</NRadio>
<NRadio value={0} class='radio-state-disable'>
</NRadio>
</NSpace> </NSpace>
</NRadioGroup> </NRadioGroup>
</NFormItem> </NFormItem>

9
dolphinscheduler-ui-next/src/views/security/user-manage/index.tsx

@ -86,7 +86,11 @@ const UsersManage = defineComponent({
<NGridItem> <NGridItem>
<NCard> <NCard>
<NSpace justify='space-between'> <NSpace justify='space-between'>
<NButton onClick={this.onAddUser} type='primary'> <NButton
onClick={this.onAddUser}
type='primary'
class='btn-create-user'
>
{t('security.user.create_user')} {t('security.user.create_user')}
</NButton> </NButton>
<NInputGroup> <NInputGroup>
@ -112,10 +116,11 @@ const UsersManage = defineComponent({
<NGridItem> <NGridItem>
<NCard> <NCard>
{userListLoading ? ( {userListLoading ? (
<NSkeleton text repeat={6}></NSkeleton> <NSkeleton text repeat={6} />
) : ( ) : (
<NSpace v-show={!userListLoading} vertical size={20}> <NSpace v-show={!userListLoading} vertical size={20}>
<NDataTable <NDataTable
row-class-name='items'
columns={this.columns} columns={this.columns}
data={this.userList} data={this.userList}
scrollX={this.scrollX} scrollX={this.scrollX}

5
dolphinscheduler-ui-next/src/views/security/user-manage/use-table.tsx

@ -38,7 +38,8 @@ function useColumns({ onEdit, onDelete }: UseTableProps) {
}, },
{ {
title: t('security.user.username'), title: t('security.user.username'),
key: 'userName' key: 'userName',
className: 'name'
}, },
{ {
title: t('security.user.tenant_code'), title: t('security.user.tenant_code'),
@ -92,6 +93,7 @@ function useColumns({ onEdit, onDelete }: UseTableProps) {
circle circle
type='info' type='info'
size='small' size='small'
class='edit'
onClick={() => { onClick={() => {
onEdit(rowData) onEdit(rowData)
}} }}
@ -115,6 +117,7 @@ function useColumns({ onEdit, onDelete }: UseTableProps) {
circle circle
type='error' type='error'
size='small' size='small'
class='delete'
onClick={() => { onClick={() => {
onDelete(rowData) onDelete(rowData)
}} }}

Loading…
Cancel
Save