Skip to content

Commit aebd0d1

Browse files
EnxDevsadpandajoe
authored andcommitted
chore(DatabaseModal): simplify collapsible logic for extra extension section (#36118)
(cherry picked from commit 53b9045)
1 parent 0e20437 commit aebd0d1

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

superset-frontend/src/features/databases/DatabaseModal/ExtraOptions.test.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,21 @@ describe('ExtraOptions Component', () => {
219219
);
220220
expect(sqlLabTab).toHaveAttribute('aria-expanded', 'false');
221221
});
222+
223+
test('all collapse panels should expand when clicking anywhere on the header', () => {
224+
renderComponent();
225+
const allPanelTabs = screen.getAllByRole('tab');
226+
expect(allPanelTabs.length).toBeGreaterThanOrEqual(4); // At least 4 main panels
227+
228+
allPanelTabs.forEach(panelTab => {
229+
// Initially should be collapsed
230+
expect(panelTab).toHaveAttribute('aria-expanded', 'false');
231+
// Click on the panel tab (entire header should be clickable)
232+
fireEvent.click(panelTab);
233+
expect(panelTab).toHaveAttribute('aria-expanded', 'true');
234+
fireEvent.click(panelTab);
235+
// Panel should collapse back
236+
expect(panelTab).toHaveAttribute('aria-expanded', 'false');
237+
});
238+
});
222239
});

superset-frontend/src/features/databases/DatabaseModal/ExtraOptions.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,9 @@ const ExtraOptions = ({
592592
? [
593593
{
594594
key: extraExtension?.title,
595-
collapsible: extraExtension.enabled?.()
596-
? ('icon' as const)
597-
: ('disabled' as const),
595+
...(extraExtension.enabled?.()
596+
? {}
597+
: { collapsible: 'disabled' as const }),
598598
label: (
599599
<CollapseLabelInModal
600600
key={extraExtension?.title}

0 commit comments

Comments
 (0)