Skip to content
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

refactor(dashboard): Migrate ResizableContainer to TypeScript and functional component #31452

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

EnxDev
Copy link
Contributor

@EnxDev EnxDev commented Dec 14, 2024

SUMMARY

  • Refactoring the component to use React functional component syntax
  • Defining TypeScript interfaces for props and state
  • Adding type safety throughout the component
  • Performance improving

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

  • Before
    Screenshot 2025-01-09 143325
before.mp4
  • After
    Screenshot 2025-01-09 115936
after.mp4

TESTING INSTRUCTIONS

  1. Navigate to superset-frontend/src/dashboard/components/resizable.
  2. Run the command: npm run test ResizableContainer.test.tsx.
  3. Verify that all tests pass successfully.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • [x ] 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

- Refactoring the component to use React functional component syntax
- Defining TypeScript interfaces for props and state
- Adding type safety throughout the component
@dosubot dosubot bot added the dashboard:component Related to the drag&drop components of the Dashboard label Dec 14, 2024
@geido geido added the hold:testing! On hold for testing label Jan 3, 2025
Copy link
Member

@geido geido left a comment

Choose a reason for hiding this comment

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

LGTM. I'd love a feedback from @kgabryje too before merging

width: adjustableWidth ? nextWidthMultiple : 0,
height: adjustableHeight ? nextHeightMultiple : 0,
},
// @ts-ignore
Copy link
Contributor Author

@EnxDev EnxDev Jan 8, 2025

Choose a reason for hiding this comment

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

ResizeCallback type does not expect the id, but in our case it is required until it is modified in handleResizeStop.

Instead of using ResizeCallback, I can create a custom type if we think it might be useful.

Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

lgtm

@EnxDev EnxDev removed the hold:testing! On hold for testing label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard:component Related to the drag&drop components of the Dashboard size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants