refactor: batch updated and batch edit, change 'All' to 'Entire collection" (#5200)

* refactor: batch updated and batch edit, change 'All' to 'Entire collection'

* fix: test
This commit is contained in:
Katherine 2024-09-05 20:46:26 +08:00 committed by GitHub
parent a726cab92c
commit 9d0602ea23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 7 additions and 5 deletions

View File

@ -33,7 +33,7 @@ function UpdateMode() {
title={t('Data will be updated')} title={t('Data will be updated')}
options={[ options={[
{ label: t('Selected'), value: 'selected' }, { label: t('Selected'), value: 'selected' },
{ label: t('All'), value: 'all' }, { label: t('Entire collection', { ns: 'action-bulk-edit' }), value: 'all' },
]} ]}
value={fieldSchema?.['x-action-settings']?.['updateMode']} value={fieldSchema?.['x-action-settings']?.['updateMode']}
onChange={(value) => { onChange={(value) => {

View File

@ -21,7 +21,7 @@ test.describe('bulk edit action setting', () => {
await expect(page.getByTitle('Data will be updated').getByText('Selected')).toBeVisible(); await expect(page.getByTitle('Data will be updated').getByText('Selected')).toBeVisible();
await page.getByRole('menuitem', { name: 'Data will be updated' }).click(); await page.getByRole('menuitem', { name: 'Data will be updated' }).click();
//切换为全部数据 //切换为全部数据
await page.getByRole('option', { name: 'All' }).click(); await page.getByRole('option', { name: 'Entire collection' }).click();
//配置更新规则 //配置更新规则
await page.getByLabel('Bulk edit').click(); await page.getByLabel('Bulk edit').click();
await page.getByLabel('schema-initializer-Grid-popup:bulkEdit:addBlock-general').hover(); await page.getByLabel('schema-initializer-Grid-popup:bulkEdit:addBlock-general').hover();

View File

@ -1,4 +1,5 @@
{ {
"Bulk edit": "批量编辑", "Bulk edit": "批量编辑",
"Data will be updated": "更新的数据" "Data will be updated": "更新的数据",
"Entire collection":"全表"
} }

View File

@ -33,7 +33,7 @@ function UpdateMode() {
title={t('Data will be updated')} title={t('Data will be updated')}
options={[ options={[
{ label: t('Selected'), value: 'selected' }, { label: t('Selected'), value: 'selected' },
{ label: t('All'), value: 'all' }, { label: t('Entire collection', { ns: 'action-bulk-edit' }), value: 'all' },
]} ]}
value={fieldSchema?.['x-action-settings']?.['updateMode']} value={fieldSchema?.['x-action-settings']?.['updateMode']}
onChange={(value) => { onChange={(value) => {

View File

@ -24,7 +24,7 @@ test.describe('data will be updated && Assign field values && after successful s
await expect(page.getByTitle('Data will be updated').getByText('Selected')).toBeVisible(); await expect(page.getByTitle('Data will be updated').getByText('Selected')).toBeVisible();
await page.getByRole('menuitem', { name: 'Data will be updated' }).click(); await page.getByRole('menuitem', { name: 'Data will be updated' }).click();
//切换为全部数据 //切换为全部数据
await page.getByRole('option', { name: 'All' }).click(); await page.getByRole('option', { name: 'Entire collection' }).click();
//字段赋值 //字段赋值
await page.getByRole('menuitem', { name: 'Assign field values' }).click(); await page.getByRole('menuitem', { name: 'Assign field values' }).click();
await page.getByLabel('schema-initializer-Grid-assignFieldValuesForm:configureFields-general').click(); await page.getByLabel('schema-initializer-Grid-assignFieldValuesForm:configureFields-general').click();

View File

@ -11,4 +11,5 @@ export default {
'Bulk update': '批量更新', 'Bulk update': '批量更新',
'After successful bulk update': '批量成功更新后', 'After successful bulk update': '批量成功更新后',
'Please select the records to be updated': '请选择要更新的记录', 'Please select the records to be updated': '请选择要更新的记录',
"Entire collection":"全表"
}; };