refactor: gridCard:configureActions

This commit is contained in:
Zeke Zhang 2024-03-07 19:18:28 +08:00
parent 5fa51da5ec
commit 80746f0bfa
4 changed files with 8 additions and 8 deletions

View File

@ -85,7 +85,7 @@ export const gridCardActionInitializers_deprecated = new CompatibleSchemaInitial
export const gridCardActionInitializers = new CompatibleSchemaInitializer(
{
name: 'actionInitializers:gridCard',
name: 'gridCard:configureActions',
title: "{{t('Configure actions')}}",
icon: 'SettingOutlined',
style: {

View File

@ -16,7 +16,7 @@ test.describe('configure global actions', () => {
test('filter & add new & refresh', async ({ page, mockPage }) => {
await mockPage(oneEmptyGridCardBlock).goto();
await page.getByLabel('schema-initializer-ActionBar-actionInitializers:gridCard-general').hover();
await page.getByLabel('schema-initializer-ActionBar-gridCard:configureActions-general').hover();
await page.getByRole('menuitem', { name: 'Filter' }).click();
await page.getByRole('menuitem', { name: 'Add new' }).click();
await page.getByRole('menuitem', { name: 'Refresh' }).click();
@ -31,7 +31,7 @@ test.describe('configure global actions', () => {
await expect(page.getByRole('button', { name: 'Refresh' })).toBeVisible();
// delete buttons
await page.getByLabel('schema-initializer-ActionBar-actionInitializers:gridCard-general').hover();
await page.getByLabel('schema-initializer-ActionBar-gridCard:configureActions-general').hover();
await page.getByRole('menuitem', { name: 'Filter' }).click();
await page.getByRole('menuitem', { name: 'Add new' }).click();
await page.getByRole('menuitem', { name: 'Refresh' }).click();
@ -53,7 +53,7 @@ test.describe('configure item actions', () => {
await mockRecord('general');
await nocoPage.goto();
await page.getByLabel('schema-initializer-ActionBar-actionInitializers:gridCardItem-general').first().hover();
await page.getByLabel('schema-initializer-ActionBar-gridCard:configureActionsItem-general').first().hover();
await page.getByRole('menuitem', { name: 'View' }).click();
await page.getByRole('menuitem', { name: 'Edit' }).click();
await page.getByRole('menuitem', { name: 'Delete' }).click();
@ -68,7 +68,7 @@ test.describe('configure item actions', () => {
await expect(page.getByLabel('action-Action.Link-Delete-destroy-general-grid-card').first()).toBeVisible();
// delete buttons
await page.getByLabel('schema-initializer-ActionBar-actionInitializers:gridCardItem-general').first().hover();
await page.getByLabel('schema-initializer-ActionBar-gridCard:configureActionsItem-general').first().hover();
await page.getByRole('menuitem', { name: 'View' }).click();
await page.getByRole('menuitem', { name: 'Edit' }).click();
await page.getByRole('menuitem', { name: 'Delete' }).click();
@ -88,7 +88,7 @@ test.describe('configure item actions', () => {
await mockRecord('general');
await nocoPage.goto();
await page.getByLabel('schema-initializer-ActionBar-actionInitializers:gridCardItem-general').first().hover();
await page.getByLabel('schema-initializer-ActionBar-gridCard:configureActionsItem-general').first().hover();
await page.getByRole('menuitem', { name: 'Customize' }).hover();
await page.getByRole('menuitem', { name: 'Popup' }).click();
await page.getByRole('menuitem', { name: 'Update record' }).click();

View File

@ -1022,7 +1022,7 @@ export const createListBlockSchema = (options) => {
export const createGridCardBlockSchema = (options) => {
const {
formItemInitializers = 'details:configureFields',
actionInitializers = 'actionInitializers:gridCard',
actionInitializers = 'gridCard:configureActions',
itemActionInitializers = 'actionInitializers:gridCardItem',
collection,
association,

View File

@ -890,7 +890,7 @@ export const oneEmptyGridCardBlock: PageConfig = {
_isJSONSchemaObject: true,
version: '2.0',
type: 'void',
'x-initializer': 'actionInitializers:gridCard',
'x-initializer': 'gridCard:configureActions',
'x-component': 'ActionBar',
'x-component-props': {
style: {