fix: useDesigner Designer should has default toolbar (#3365)

* fix: useDesigner Designer should has default toolbar

* test: e2e schemaSeting for linkage rule

* test: e2e schemaSeting for linkage rule

* test: e2e schemaSeting for linkage rule
This commit is contained in:
katherinehhh 2024-01-11 11:21:18 +08:00 committed by GitHub
parent 2f8b0e75f8
commit 4d44c6e24e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 8 deletions

View File

@ -85,7 +85,7 @@ export const useFormBlockType = () => {
export const useIsDetailBlock = () => { export const useIsDetailBlock = () => {
const ctx = useFormBlockContext(); const ctx = useFormBlockContext();
return ctx.type === 'update'; return ctx.type !== 'create';
}; };
export const FormBlockProvider = (props) => { export const FormBlockProvider = (props) => {

View File

@ -1164,7 +1164,7 @@ test.describe('actions schema settings', () => {
await page.getByRole('button', { name: 'Submit' }).hover(); await page.getByRole('button', { name: 'Submit' }).hover();
await page.getByRole('button', { name: 'designer-schema-settings-Action-Action.Designer-users' }).hover(); await page.getByRole('button', { name: 'designer-schema-settings-Action-Action.Designer-users' }).hover();
}, },
supportedOptions: ['Edit button', 'Linkage rules', 'Bind workflows', 'Delete'], supportedOptions: ['Edit button', 'Bind workflows', 'Delete'],
}); });
}); });
@ -1179,7 +1179,6 @@ test.describe('actions schema settings', () => {
}, },
supportedOptions: [ supportedOptions: [
'Edit button', 'Edit button',
'Linkage rules',
'Assign field values', 'Assign field values',
'Skip required validation', 'Skip required validation',
'After successful submission', 'After successful submission',

View File

@ -148,7 +148,7 @@ test.describe('actions schema settings', () => {
await page.getByRole('button', { name: 'Submit' }).hover(); await page.getByRole('button', { name: 'Submit' }).hover();
await page.getByRole('button', { name: 'designer-schema-settings-Action-Action.Designer-users' }).hover(); await page.getByRole('button', { name: 'designer-schema-settings-Action-Action.Designer-users' }).hover();
}, },
supportedOptions: ['Edit button', 'Linkage rules', 'Bind workflows', 'Delete'], supportedOptions: ['Edit button', 'Bind workflows', 'Delete'],
}); });
}); });
@ -163,7 +163,6 @@ test.describe('actions schema settings', () => {
}, },
supportedOptions: [ supportedOptions: [
'Edit button', 'Edit button',
'Linkage rules',
'Assign field values', 'Assign field values',
'Skip required validation', 'Skip required validation',
'After successful submission', 'After successful submission',

View File

@ -92,7 +92,7 @@ test.describe('actions schema settings', () => {
await page.getByLabel('action-Action-Filter-submit-general-filter-form').hover(); await page.getByLabel('action-Action-Filter-submit-general-filter-form').hover();
await page.getByRole('button', { name: 'designer-schema-settings-Action' }).hover(); await page.getByRole('button', { name: 'designer-schema-settings-Action' }).hover();
}, },
supportedOptions: ['Edit button', 'Linkage rules', 'Delete'], supportedOptions: ['Edit button', 'Delete'],
}); });
// Reset settings -------------------------------------------------------------------- // Reset settings --------------------------------------------------------------------
@ -102,7 +102,7 @@ test.describe('actions schema settings', () => {
await page.getByLabel('action-Action-Reset-general-filter-form').hover(); await page.getByLabel('action-Action-Reset-general-filter-form').hover();
await page.getByRole('button', { name: 'designer-schema-settings-Action' }).hover(); await page.getByRole('button', { name: 'designer-schema-settings-Action' }).hover();
}, },
supportedOptions: ['Edit button', 'Linkage rules', 'Delete'], supportedOptions: ['Edit button', 'Delete'],
}); });
}); });
}); });

View File

@ -20,5 +20,5 @@ export const useDesigner = () => {
}, [fieldSchema]); }, [fieldSchema]);
const component = useComponent(toolbar); const component = useComponent(toolbar);
return designable ? component : Def; return designable ? component || Def : Def;
}; };