Skip to content

Commit

Permalink
fix(ui-editor): ActionButton and CustomButton as valid children for B…
Browse files Browse the repository at this point in the history
…uttonGroup (#13935)
  • Loading branch information
nkylstad authored Nov 4, 2024
1 parent fa2e2ef commit 5a3082b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions frontend/packages/ux-editor/src/data/formItemConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ export const formItemConfigs: FormItemConfigs = {
propertyPath: 'definitions/buttonGroupComponent',
icon: FingerButtonIcon,
validChildTypes: [
ComponentType.ActionButton,
ComponentType.Button,
ComponentType.CustomButton,
ComponentType.NavigationButtons,
ComponentType.PrintButton,
ComponentType.InstantiationButton,
Expand Down
13 changes: 9 additions & 4 deletions frontend/packages/ux-editor/src/utils/formLayoutUtils.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,15 @@ describe('formLayoutUtils', () => {
});

describe('isComponentTypeValidChild', () => {
it('Returns true if the child is valid to given container', () => {
expect(isComponentTypeValidChild(mockInternal, buttonGroupId, ComponentType.Button)).toBe(
true,
);
it.each([
ComponentType.ActionButton,
ComponentType.Button,
ComponentType.CustomButton,
ComponentType.NavigationButtons,
ComponentType.PrintButton,
ComponentType.InstantiationButton,
])('Returns true if the child is valid to given container', (buttonType: ComponentType) => {
expect(isComponentTypeValidChild(mockInternal, buttonGroupId, buttonType)).toBe(true);
});

it('Returns true if the component is not dropped inside a container', () => {
Expand Down

0 comments on commit 5a3082b

Please sign in to comment.