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
class:
- [ ] items
- [ ] el-popconfirm
- [ ] el-button--primary
- [ ] environmentName
- [ ] edit
- [ ] delete
id:
- [ ] btnCreateEnvironment
- [ ] inputEnvironmentName
- [ ] inputEnvironmentConfig
- [ ] inputEnvironmentDesc
- [ ] inputEnvironmentWorkerGroup
- [ ] btnSubmit
- [ ] btnCancel
| check | class |
|--------------------|--------------------------------|
| :white_check_mark: | items |
| | el-popconfirm |
| | el-button--primary |
| :white_check_mark: | environment-name |
| :white_check_mark: | edit |
| :white_check_mark: | delete |
| :white_check_mark: | btn-create-environment |
| :white_check_mark: | input-environment-name |
| :white_check_mark: | input-environment-config |
| :white_check_mark: | input-environment-desc |
| :white_check_mark: | input-environment-worker-group |
| :white_check_mark: | btn-submit |
| :white_check_mark: | btn-cancel |
#### token manage
| check | class |
|--------------------|---------------------|
|--------------------|--------------------|
| :white_check_mark: | items |
| | el-popconfirm |
| | el-button--primary |
| :white_check_mark: | username |
| :white_check_mark: | token |
| :white_check_mark: | input-username |
| :white_check_mark: | input-token |
| :white_check_mark: | edit |
| :white_check_mark: | delete |
| :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={
!this.model.name || !this.model.config || !this.model.description
}
confirmClassName='btn-submit'
cancelClassName='btn-cancel'
>
{{
default: () => (
@ -136,6 +138,7 @@ const EnvironmentModal = defineComponent({
path='name'
>
<NInput
class='input-environment-name'
placeholder={t(
'security.environment.environment_name_tips'
)}
@ -147,6 +150,7 @@ const EnvironmentModal = defineComponent({
path='config'
>
<NInput
class='input-environment-config'
placeholder={envConfigPlaceholder}
type='textarea'
autosize={{ minRows: 16 }}
@ -158,6 +162,7 @@ const EnvironmentModal = defineComponent({
path='description'
>
<NInput
class='input-environment-desc'
placeholder={t(
'security.environment.environment_description_tips'
)}
@ -169,6 +174,7 @@ const EnvironmentModal = defineComponent({
path='workerGroups'
>
<NSelect
class='input-environment-worker-group'
multiple
placeholder={t('security.environment.worker_group_tips')}
options={this.model.generalOptions}

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

@ -105,7 +105,7 @@ const environmentManage = defineComponent({
<NCard>
<div class={styles['search-card']}>
<div>
<NButton size='small' type='primary' onClick={handleModalChange}>
<NButton size='small' type='primary' onClick={handleModalChange} class='btn-create-environment'>
{t('security.environment.create_environment')}
</NButton>
</div>
@ -129,7 +129,7 @@ const environmentManage = defineComponent({
</div>
</NCard>
<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}>
<NPagination
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'),
key: 'name'
key: 'name',
className: 'environment-name'
},
{
title: t('security.environment.environment_config'),
@ -97,6 +98,7 @@ export function useTable() {
circle: true,
type: 'info',
size: 'small',
class: 'edit',
onClick: () => {
handleEdit(row)
}
@ -127,7 +129,8 @@ export function useTable() {
{
circle: true,
type: 'error',
size: 'small'
size: 'small',
class: 'delete'
},
{
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' && (
<NFormItem label={t('security.token.user')} path='userId'>
<NSelect
class='username'
class='input-username'
filterable
placeholder={t('security.token.user_tips')}
options={this.model.generalOptions}
@ -176,7 +176,7 @@ const TokenModal = defineComponent({
<NFormItem label={t('security.token.token')} path='token'>
<NSpace>
<NInput
class='token'
class='input-token'
style={{ width: '504px' }}
disabled
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'),
key: 'userName'
key: 'userName',
className: 'username'
},
{
title: t('security.token.token'),
key: 'token'
key: 'token',
className: 'token'
},
{
title: t('security.token.expiration_time'),

Loading…
Cancel
Save