Skip to content

Commit 53b9045

Browse files
authored
chore(DatabaseModal): simplify collapsible logic for extra extension section (#36118)
1 parent a268232 commit 53b9045

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
@@ -220,4 +220,21 @@ describe('ExtraOptions Component', () => {
220220
);
221221
expect(sqlLabTab).toHaveAttribute('aria-expanded', 'false');
222222
});
223+
224+
test('all collapse panels should expand when clicking anywhere on the header', () => {
225+
renderComponent();
226+
const allPanelTabs = screen.getAllByRole('tab');
227+
expect(allPanelTabs.length).toBeGreaterThanOrEqual(4); // At least 4 main panels
228+
229+
allPanelTabs.forEach(panelTab => {
230+
// Initially should be collapsed
231+
expect(panelTab).toHaveAttribute('aria-expanded', 'false');
232+
// Click on the panel tab (entire header should be clickable)
233+
fireEvent.click(panelTab);
234+
expect(panelTab).toHaveAttribute('aria-expanded', 'true');
235+
fireEvent.click(panelTab);
236+
// Panel should collapse back
237+
expect(panelTab).toHaveAttribute('aria-expanded', 'false');
238+
});
239+
});
223240
});

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,9 @@ const ExtraOptions = ({
613613
? [
614614
{
615615
key: extraExtension?.title,
616-
collapsible: extraExtension.enabled?.()
617-
? ('icon' as const)
618-
: ('disabled' as const),
616+
...(extraExtension.enabled?.()
617+
? {}
618+
: { collapsible: 'disabled' as const }),
619619
label: (
620620
<CollapseLabelInModal
621621
key={extraExtension?.title}

0 commit comments

Comments
 (0)