Skip to content

fix: database model Collapse state #34126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jul 22, 2025
Merged

Conversation

SBIN2010
Copy link
Contributor

@SBIN2010 SBIN2010 commented Jul 10, 2025

SUMMARY

The problem is that the Collapse component from the Ant Design library retains its state (such as an open panel) even after closing and reopening the modal window. This is because React does not destroy the component when the modal window is closed, but simply hides it. As a result, the Collapse state is preserved.

To solve this problem, you need to reset the Collapse state every time you open the modal window, which is what this PR solves

continuation of PR #32734

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added the change:frontend Requires changing the frontend label Jul 10, 2025
@github-actions github-actions bot removed the plugins label Jul 10, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Performance Unnecessary State Updates in useEffect ▹ view ✅ Fix detected
Files scanned
File Path Reviewed
superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx
superset-frontend/src/features/databases/DatabaseModal/ExtraOptions.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Comment on lines 91 to 97
const [activeKey, setActiveKey] = useState<string[] | undefined>();

useEffect(() => {
if (!expandableModalIsOpen) {
setActiveKey(undefined);
}
}, [expandableModalIsOpen]);

This comment was marked as resolved.

@rusackas rusackas requested review from geido and msyavuz July 11, 2025 14:39
Copy link
Member

@msyavuz msyavuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@msyavuz msyavuz merged commit aff847b into apache:master Jul 22, 2025
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:frontend Requires changing the frontend size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants