feat: update volume action menu

1. Update the volume action menu: classified as 'data protection', 'instance related', 'capacity & type'
2. Update the volume action menu in the volume tab in the  instance detail page
3. Update the volume/snapshot e2e cases according the new action menu

Change-Id: Ib479efcdcd0f72789b1278716c7b9f06f9d87d3b
This commit is contained in:
Jingwei.Zhang 2022-08-04 17:38:52 +08:00
parent a6820a4ca8
commit dda85bbf26
5 changed files with 45 additions and 75 deletions

View File

@ -293,6 +293,7 @@
"Cancel Select": "Cancel Select", "Cancel Select": "Cancel Select",
"Cancel Transfer": "Cancel Transfer", "Cancel Transfer": "Cancel Transfer",
"Cancel upload successfully.": "Cancel upload successfully.", "Cancel upload successfully.": "Cancel upload successfully.",
"Capacity & Type": "Capacity & Type",
"Capacity (GiB)": "Capacity (GiB)", "Capacity (GiB)": "Capacity (GiB)",
"Cape Verde": "Cape Verde", "Cape Verde": "Cape Verde",
"Capsule Detail": "Capsule Detail", "Capsule Detail": "Capsule Detail",
@ -588,6 +589,7 @@
"Danger": "Danger", "Danger": "Danger",
"Data Disk": "Data Disk", "Data Disk": "Data Disk",
"Data Disks": "Data Disks", "Data Disks": "Data Disks",
"Data Protection": "Data Protection",
"Data Source Type": "Data Source Type", "Data Source Type": "Data Source Type",
"Database": "Database", "Database": "Database",
"Database Backup Detail": "Database Backup Detail", "Database Backup Detail": "Database Backup Detail",
@ -1201,6 +1203,7 @@
"Instance ID": "Instance ID", "Instance ID": "Instance ID",
"Instance IP": "Instance IP", "Instance IP": "Instance IP",
"Instance Info": "Instance Info", "Instance Info": "Instance Info",
"Instance Related": "Instance Related",
"Instance Snapshot": "Instance Snapshot", "Instance Snapshot": "Instance Snapshot",
"Instance Snapshot Detail": "Instance Snapshot Detail", "Instance Snapshot Detail": "Instance Snapshot Detail",
"Instance Snapshot Name": "Instance Snapshot Name", "Instance Snapshot Name": "Instance Snapshot Name",

View File

@ -293,6 +293,7 @@
"Cancel Select": "取消选择", "Cancel Select": "取消选择",
"Cancel Transfer": "取消云硬盘转让", "Cancel Transfer": "取消云硬盘转让",
"Cancel upload successfully.": "取消上传成功。", "Cancel upload successfully.": "取消上传成功。",
"Capacity & Type": "容量和类型",
"Capacity (GiB)": "容量(GiB)", "Capacity (GiB)": "容量(GiB)",
"Cape Verde": "佛得角", "Cape Verde": "佛得角",
"Capsule Detail": "集合详情", "Capsule Detail": "集合详情",
@ -588,6 +589,7 @@
"Danger": "危险", "Danger": "危险",
"Data Disk": "数据盘", "Data Disk": "数据盘",
"Data Disks": "块数据盘", "Data Disks": "块数据盘",
"Data Protection": "数据保护",
"Data Source Type": "数据源类型", "Data Source Type": "数据源类型",
"Database": "数据库", "Database": "数据库",
"Database Backup Detail": "数据库备份详情", "Database Backup Detail": "数据库备份详情",
@ -1201,6 +1203,7 @@
"Instance ID": "实例ID", "Instance ID": "实例ID",
"Instance IP": "云主机IP", "Instance IP": "云主机IP",
"Instance Info": "云主机信息", "Instance Info": "云主机信息",
"Instance Related": "云主机相关",
"Instance Snapshot": "云主机快照", "Instance Snapshot": "云主机快照",
"Instance Snapshot Detail": "云主机快照详情", "Instance Snapshot Detail": "云主机快照详情",
"Instance Snapshot Name": "云主机快照名称", "Instance Snapshot Name": "云主机快照名称",

View File

@ -32,39 +32,30 @@ import CancelTransfer from './CancelTransfer';
import CreateInstance from './CreateInstance'; import CreateInstance from './CreateInstance';
import Bootable from './Bootable'; import Bootable from './Bootable';
const dataProtectionActions = {
title: t('Data Protection'),
actions: [CreateSnapshot, CreateBackup, CreateImage, CloneVolume, Restore],
};
const instanceRelated = {
title: t('Instance Related'),
actions: [Bootable, CreateInstance, Attach, Detach],
};
const capacityAndSize = {
title: t('Capacity & Type'),
actions: [ExtendVolume, ChangeType],
};
const actionConfigs = { const actionConfigs = {
rowActions: { rowActions: {
firstAction: CreateSnapshot, firstAction: Edit,
moreActions: [ moreActions: [
dataProtectionActions,
instanceRelated,
capacityAndSize,
{ {
action: Edit, action: Delete,
},
{
action: Bootable,
},
{
action: CreateInstance,
},
{
action: CreateImage,
},
{
action: CreateBackup,
},
{
action: Attach,
},
{
action: Detach,
},
{
action: ExtendVolume,
},
{
action: ChangeType,
},
{
action: CloneVolume,
}, },
{ {
action: CreateTransfer, action: CreateTransfer,
@ -72,12 +63,6 @@ const actionConfigs = {
{ {
action: CancelTransfer, action: CancelTransfer,
}, },
{
action: Delete,
},
{
action: Restore,
},
], ],
}, },
batchActions: [Delete], batchActions: [Delete],
@ -86,34 +71,13 @@ const actionConfigs = {
const instanceDetailConfig = { const instanceDetailConfig = {
rowActions: { rowActions: {
firstAction: CreateSnapshot, firstAction: Edit,
moreActions: [ moreActions: [
dataProtectionActions,
instanceRelated,
capacityAndSize,
{ {
action: Edit, action: Delete,
},
{
action: CreateInstance,
},
{
action: CreateImage,
},
// {
// action: CreateBackup,
// },
{
action: Attach,
},
{
action: Detach,
},
{
action: ExtendVolume,
},
{
action: ChangeType,
},
{
action: CloneVolume,
}, },
{ {
action: CreateTransfer, action: CreateTransfer,
@ -121,9 +85,6 @@ const instanceDetailConfig = {
{ {
action: CancelTransfer, action: CancelTransfer,
}, },
{
action: Delete,
},
], ],
}, },
batchActions: [], batchActions: [],

View File

@ -36,7 +36,7 @@ describe('The Volume Snapshot Page', () => {
it('successfully create', () => { it('successfully create', () => {
cy.visitPage(volumeListUrl) cy.visitPage(volumeListUrl)
.tableSearchText(volumeName) .tableSearchText(volumeName)
.clickFirstActionButton() .clickActionInMoreSub('Create Snapshot', 'Data Protection')
.formInput('name', name) .formInput('name', name)
.clickModalActionSubmitButton(); .clickModalActionSubmitButton();

View File

@ -89,7 +89,10 @@ describe('The Volume Page', () => {
}); });
it('successfully create snapshot', () => { it('successfully create snapshot', () => {
cy.tableSearchText(name).clickFirstActionButton(); cy.tableSearchText(name).clickActionInMoreSub(
'Create Snapshot',
'Data Protection'
);
cy.wait(2000) cy.wait(2000)
.formInput('name', snapshotName) .formInput('name', snapshotName)
.clickModalActionSubmitButton() .clickModalActionSubmitButton()
@ -108,7 +111,7 @@ describe('The Volume Page', () => {
onlyOn(backupServiceEnabled, () => { onlyOn(backupServiceEnabled, () => {
it('successfully create backup', () => { it('successfully create backup', () => {
cy.tableSearchText(name) cy.tableSearchText(name)
.clickActionInMore('Create Backup') .clickActionInMoreSub('Create Backup', 'Data Protection')
.formInput('name', backupName) .formInput('name', backupName)
.clickModalActionSubmitButton() .clickModalActionSubmitButton()
.tableSearchText(name) .tableSearchText(name)
@ -117,7 +120,7 @@ describe('The Volume Page', () => {
it('successfully create backup inc', () => { it('successfully create backup inc', () => {
cy.tableSearchText(name) cy.tableSearchText(name)
.clickActionInMore('Create Backup') .clickActionInMoreSub('Create Backup', 'Data Protection')
.formInput('name', backupIncName) .formInput('name', backupIncName)
.formRadioChoose('incremental', 1) .formRadioChoose('incremental', 1)
.clickModalActionSubmitButton() .clickModalActionSubmitButton()
@ -130,7 +133,7 @@ describe('The Volume Page', () => {
it('successfully clone volume', () => { it('successfully clone volume', () => {
cy.tableSearchText(name) cy.tableSearchText(name)
.clickActionInMore('Clone Volume') .clickActionInMoreSub('Clone Volume', 'Data Protection')
.wait(10000) .wait(10000)
.formInput('name', cloneVolumeName) .formInput('name', cloneVolumeName)
.clickModalActionSubmitButton(); .clickModalActionSubmitButton();
@ -138,7 +141,7 @@ describe('The Volume Page', () => {
it('successfully attach', () => { it('successfully attach', () => {
cy.tableSearchText(name) cy.tableSearchText(name)
.clickActionInMore('Attach') .clickActionInMoreSub('Attach', 'Instance Related')
.wait(5000) .wait(5000)
.formTableSelectBySearch('instance', instanceName) .formTableSelectBySearch('instance', instanceName)
.clickModalActionSubmitButton() .clickModalActionSubmitButton()
@ -148,7 +151,7 @@ describe('The Volume Page', () => {
it('successfully detach', () => { it('successfully detach', () => {
cy.tableSearchText(name) cy.tableSearchText(name)
.clickActionInMore('Detach') .clickActionInMoreSub('Detach', 'Instance Related')
.wait(5000) .wait(5000)
.formTableSelect('instance') .formTableSelect('instance')
.clickModalActionSubmitButton(); .clickModalActionSubmitButton();
@ -157,7 +160,7 @@ describe('The Volume Page', () => {
it('successfully create image', () => { it('successfully create image', () => {
cy.tableSearchText(name) cy.tableSearchText(name)
.clickActionInMore('Create Image') .clickActionInMoreSub('Create Image', 'Data Protection')
.formInput('image_name', imageName) .formInput('image_name', imageName)
.clickModalActionSubmitButton(); .clickModalActionSubmitButton();
cy.tableSearchText(name).waitStatusActiveByRefresh(); cy.tableSearchText(name).waitStatusActiveByRefresh();
@ -168,14 +171,14 @@ describe('The Volume Page', () => {
it('successfully extend volume', () => { it('successfully extend volume', () => {
cy.tableSearchText(name) cy.tableSearchText(name)
.clickActionInMore('Extend Volume') .clickActionInMoreSub('Extend Volume', 'Capacity & Type')
.clickModalActionSubmitButton(); .clickModalActionSubmitButton();
cy.tableSearchText(name).waitStatusActiveByRefresh(); cy.tableSearchText(name).waitStatusActiveByRefresh();
}); });
it('successfully change type', () => { it('successfully change type', () => {
cy.tableSearchText(name) cy.tableSearchText(name)
.clickActionInMore('Change Type') .clickActionInMoreSub('Change Type', 'Capacity & Type')
.formSelect('new_type') .formSelect('new_type')
.clickModalActionSubmitButton(); .clickModalActionSubmitButton();
cy.tableSearchText(name).waitStatusActiveByRefresh(); cy.tableSearchText(name).waitStatusActiveByRefresh();
@ -183,7 +186,7 @@ describe('The Volume Page', () => {
it('successfully edit', () => { it('successfully edit', () => {
cy.tableSearchText(name) cy.tableSearchText(name)
.clickActionInMore('Edit') .clickFirstActionButton('Edit')
.formInput('name', newname) .formInput('name', newname)
.clickModalActionSubmitButton(); .clickModalActionSubmitButton();
}); });