Browse Source

[Feature][UI Next] Add e2e to security environment manage page. (#8404)

3.0.0/version-upgrade
songjianet 3 years ago committed by GitHub
parent
commit
bc5f8b3b34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 35
      dolphinscheduler-ui-next/docs/e2e/security.md
  2. 6
      dolphinscheduler-ui-next/src/views/security/environment-manage/components/environment-modal.tsx
  3. 4
      dolphinscheduler-ui-next/src/views/security/environment-manage/index.tsx
  4. 7
      dolphinscheduler-ui-next/src/views/security/environment-manage/use-table.ts
  5. 4
      dolphinscheduler-ui-next/src/views/security/token-manage/components/token-modal.tsx
  6. 6
      dolphinscheduler-ui-next/src/views/security/token-manage/use-table.ts

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

@ -83,32 +83,33 @@ id:
#### environment manage #### environment manage
class: | check | class |
- [ ] items |--------------------|--------------------------------|
- [ ] el-popconfirm | :white_check_mark: | items |
- [ ] el-button--primary | | el-popconfirm |
- [ ] environmentName | | el-button--primary |
- [ ] edit | :white_check_mark: | environment-name |
- [ ] delete | :white_check_mark: | edit |
| :white_check_mark: | delete |
id: | :white_check_mark: | btn-create-environment |
- [ ] btnCreateEnvironment | :white_check_mark: | input-environment-name |
- [ ] inputEnvironmentName | :white_check_mark: | input-environment-config |
- [ ] inputEnvironmentConfig | :white_check_mark: | input-environment-desc |
- [ ] inputEnvironmentDesc | :white_check_mark: | input-environment-worker-group |
- [ ] inputEnvironmentWorkerGroup | :white_check_mark: | btn-submit |
- [ ] btnSubmit | :white_check_mark: | btn-cancel |
- [ ] btnCancel
#### token manage #### token manage
| check | class | | check | class |
|--------------------|---------------------| |--------------------|--------------------|
| :white_check_mark: | items | | :white_check_mark: | items |
| | el-popconfirm | | | el-popconfirm |
| | el-button--primary | | | el-button--primary |
| :white_check_mark: | username | | :white_check_mark: | username |
| :white_check_mark: | token | | :white_check_mark: | token |
| :white_check_mark: | input-username |
| :white_check_mark: | input-token |
| :white_check_mark: | edit | | :white_check_mark: | edit |
| :white_check_mark: | delete | | :white_check_mark: | delete |
| :white_check_mark: | btn-create-token | | :white_check_mark: | btn-create-token |

6
dolphinscheduler-ui-next/src/views/security/environment-manage/components/environment-modal.tsx

@ -123,6 +123,8 @@ const EnvironmentModal = defineComponent({
confirmDisabled={ confirmDisabled={
!this.model.name || !this.model.config || !this.model.description !this.model.name || !this.model.config || !this.model.description
} }
confirmClassName='btn-submit'
cancelClassName='btn-cancel'
> >
{{ {{
default: () => ( default: () => (
@ -136,6 +138,7 @@ const EnvironmentModal = defineComponent({
path='name' path='name'
> >
<NInput <NInput
class='input-environment-name'
placeholder={t( placeholder={t(
'security.environment.environment_name_tips' 'security.environment.environment_name_tips'
)} )}
@ -147,6 +150,7 @@ const EnvironmentModal = defineComponent({
path='config' path='config'
> >
<NInput <NInput
class='input-environment-config'
placeholder={envConfigPlaceholder} placeholder={envConfigPlaceholder}
type='textarea' type='textarea'
autosize={{ minRows: 16 }} autosize={{ minRows: 16 }}
@ -158,6 +162,7 @@ const EnvironmentModal = defineComponent({
path='description' path='description'
> >
<NInput <NInput
class='input-environment-desc'
placeholder={t( placeholder={t(
'security.environment.environment_description_tips' 'security.environment.environment_description_tips'
)} )}
@ -169,6 +174,7 @@ const EnvironmentModal = defineComponent({
path='workerGroups' path='workerGroups'
> >
<NSelect <NSelect
class='input-environment-worker-group'
multiple multiple
placeholder={t('security.environment.worker_group_tips')} placeholder={t('security.environment.worker_group_tips')}
options={this.model.generalOptions} options={this.model.generalOptions}

4
dolphinscheduler-ui-next/src/views/security/environment-manage/index.tsx

@ -105,7 +105,7 @@ const environmentManage = defineComponent({
<NCard> <NCard>
<div class={styles['search-card']}> <div class={styles['search-card']}>
<div> <div>
<NButton size='small' type='primary' onClick={handleModalChange}> <NButton size='small' type='primary' onClick={handleModalChange} class='btn-create-environment'>
{t('security.environment.create_environment')} {t('security.environment.create_environment')}
</NButton> </NButton>
</div> </div>
@ -129,7 +129,7 @@ const environmentManage = defineComponent({
</div> </div>
</NCard> </NCard>
<Card class={styles['table-card']}> <Card class={styles['table-card']}>
<NDataTable columns={this.columns} data={this.tableData} /> <NDataTable row-class-name='items' columns={this.columns} data={this.tableData} />
<div class={styles.pagination}> <div class={styles.pagination}>
<NPagination <NPagination
v-model:page={this.page} v-model:page={this.page}

7
dolphinscheduler-ui-next/src/views/security/environment-manage/use-table.ts

@ -47,7 +47,8 @@ export function useTable() {
}, },
{ {
title: t('security.environment.environment_name'), title: t('security.environment.environment_name'),
key: 'name' key: 'name',
className: 'environment-name'
}, },
{ {
title: t('security.environment.environment_config'), title: t('security.environment.environment_config'),
@ -97,6 +98,7 @@ export function useTable() {
circle: true, circle: true,
type: 'info', type: 'info',
size: 'small', size: 'small',
class: 'edit',
onClick: () => { onClick: () => {
handleEdit(row) handleEdit(row)
} }
@ -127,7 +129,8 @@ export function useTable() {
{ {
circle: true, circle: true,
type: 'error', type: 'error',
size: 'small' size: 'small',
class: 'delete'
}, },
{ {
icon: () => h(DeleteOutlined) icon: () => h(DeleteOutlined)

4
dolphinscheduler-ui-next/src/views/security/token-manage/components/token-modal.tsx

@ -165,7 +165,7 @@ const TokenModal = defineComponent({
'GENERAL_USER' && ( 'GENERAL_USER' && (
<NFormItem label={t('security.token.user')} path='userId'> <NFormItem label={t('security.token.user')} path='userId'>
<NSelect <NSelect
class='username' class='input-username'
filterable filterable
placeholder={t('security.token.user_tips')} placeholder={t('security.token.user_tips')}
options={this.model.generalOptions} options={this.model.generalOptions}
@ -176,7 +176,7 @@ const TokenModal = defineComponent({
<NFormItem label={t('security.token.token')} path='token'> <NFormItem label={t('security.token.token')} path='token'>
<NSpace> <NSpace>
<NInput <NInput
class='token' class='input-token'
style={{ width: '504px' }} style={{ width: '504px' }}
disabled disabled
placeholder={t('security.token.token_tips')} placeholder={t('security.token.token_tips')}

6
dolphinscheduler-ui-next/src/views/security/token-manage/use-table.ts

@ -46,11 +46,13 @@ export function useTable() {
}, },
{ {
title: t('security.token.user'), title: t('security.token.user'),
key: 'userName' key: 'userName',
className: 'username'
}, },
{ {
title: t('security.token.token'), title: t('security.token.token'),
key: 'token' key: 'token',
className: 'token'
}, },
{ {
title: t('security.token.expiration_time'), title: t('security.token.expiration_time'),

Loading…
Cancel
Save