MoadAbdel opened a new pull request, #46078:
URL: https://github.com/apache/superset/pull/46078

   ### SUMMARY
   
   Part of #45312. Fixes the 5 `react/no-unstable-nested-components` warnings 
under `superset-frontend/src/dashboard`.
   
   All 5 are antd render props (`popupRender`, `optionRender`, 
`dropdownContent`) defined inline in JSX:
   
   - `FilterBarSettings`: the `popupRender` wrapper doesn't depend on component 
state, so it moves to module scope (`renderSettingsPopup`).
   - `FiltersConfigForm`: both `optionRender` callbacks only use the 
module-level `getOptionDataTest`, so they move to module scope 
(`renderFilterTypeOption`, `renderCustomizationTypeOption`).
   - `FilterControls`: the `dropdownContent` callback becomes a memoized 
`renderDropdownContent` (`useCallback`). `renderHorizontalContent` now depends 
on it and no longer lists the values it moved out.
   - `SliceHeaderControls`: the menu element is built once per render and 
returned from `popupRender={() => sliceMenu}`, the same pattern as 
`AddDataset/Footer`. `handleMenuClick` and the menu items are rebuilt every 
render, so a `useCallback` here would not memoize anything.
   
   No behavior change. Running oxlint on the changed files gives the same 
warnings as before minus these 5; no new warnings.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A, no visual change.
   
   ### TESTING INSTRUCTIONS
   
   1. `cd superset-frontend && npx oxlint --config oxlint.json src/dashboard`: 
no `react/no-unstable-nested-components` warnings.
   2. `npm run test -- src/dashboard/components/SliceHeaderControls 
src/dashboard/components/nativeFilters/FilterBar 
src/dashboard/components/nativeFilters/FiltersConfigModal`
   3. Manual check on a dashboard:
      - open a chart's "..." menu;
      - open the filter bar settings (gear) and switch orientation;
      - in horizontal mode, open "More filters" when filters overflow;
      - in the filter config modal, open the Filter Type select.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: #45312
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

  • [PR] chore(... MoadAbdel (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications
    • Re: [P... netlify[bot] (via GitHub) via notifications
    • Re: [P... codecov[bot] (via GitHub) via notifications

Reply via email to