Browse Source

[Feature][UI Next] Add e2e to security token manage page. (#8392)

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

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

@ -102,17 +102,16 @@ id:
#### token manage #### token manage
class: | check | class |
- [ ] items |--------------------|---------------------|
- [ ] el-popconfirm | :white_check_mark: | items |
- [ ] el-button--primary | | el-popconfirm |
- [ ] userName | | el-button--primary |
- [ ] token | :white_check_mark: | username |
- [ ] edit | :white_check_mark: | token |
- [ ] delete | :white_check_mark: | edit |
| :white_check_mark: | delete |
id: | :white_check_mark: | btn-create-token |
- [ ] btnCreateToken | :white_check_mark: | btn-generate-token |
- [ ] btnGenerateToken | :white_check_mark: | btn-submit |
- [ ] btnSubmit | :white_check_mark: | btn-cancel |
- [ ] btnCancel

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

@ -139,6 +139,8 @@ const TokenModal = defineComponent({
confirmDisabled={ confirmDisabled={
!this.model.userId || !this.model.expireTime || !this.model.token !this.model.userId || !this.model.expireTime || !this.model.token
} }
confirmClassName='btn-submit'
cancelClassName='btn-cancel'
> >
{{ {{
default: () => ( default: () => (
@ -163,6 +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'
filterable filterable
placeholder={t('security.token.user_tips')} placeholder={t('security.token.user_tips')}
options={this.model.generalOptions} options={this.model.generalOptions}
@ -173,12 +176,14 @@ 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'
style={{ width: '504px' }} style={{ width: '504px' }}
disabled disabled
placeholder={t('security.token.token_tips')} placeholder={t('security.token.token_tips')}
v-model={[this.model.token, 'value']} v-model={[this.model.token, 'value']}
/> />
<NButton <NButton
class='btn-generate-token'
strong strong
secondary secondary
circle circle

13
dolphinscheduler-ui-next/src/views/security/token-manage/index.tsx

@ -105,7 +105,12 @@ const tokenManage = defineComponent({
<NCard> <NCard>
<div class={styles['search-card']}> <div class={styles['search-card']}>
<div> <div>
<NButton size='small' type='primary' onClick={handleModalChange}> <NButton
class='btn-create-token'
size='small'
type='primary'
onClick={handleModalChange}
>
{t('security.token.create_token')} {t('security.token.create_token')}
</NButton> </NButton>
</div> </div>
@ -129,7 +134,11 @@ const tokenManage = 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}

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

@ -81,6 +81,7 @@ export function useTable() {
circle: true, circle: true,
type: 'info', type: 'info',
size: 'small', size: 'small',
class: 'edit',
onClick: () => { onClick: () => {
handleEdit(row) handleEdit(row)
} }
@ -111,7 +112,8 @@ export function useTable() {
{ {
circle: true, circle: true,
type: 'error', type: 'error',
size: 'small' size: 'small',
class: 'delete'
}, },
{ {
icon: () => h(DeleteOutlined) icon: () => h(DeleteOutlined)

Loading…
Cancel
Save