Repository navigation
chore(version-history): use typed app dispatch - #44438
Conversation
Code Review Agent Run #33642fActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #44438 +/- ##
==========================================
- Coverage 66.29% 66.28% -0.01%
==========================================
Files 2942 2942
Lines 175692 175692
Branches 40788 40788
==========================================
- Hits 116467 116460 -7
- Misses 56770 56777 +7
Partials 2455 2455
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rusackas
left a comment
There was a problem hiding this comment.
LGTM, clean swap to the typed dispatch hook.
Co-authored-by: Vardhman Bengani <[email protected]> (cherry picked from commit 86fb8db)
…403 as a page Enzo's review at 8fc5271. Most of this is deletion: the published surface described locations, types and constants that no code on this branch reads, so an author following the docs got nothing and no error. - The view-location table listed `navbar.right`, the home, dashboard, explore and listView locations. Only `sqllab.*` has anything behind it; `navbar.right` is the legacy `extensionsRegistry` slot, not a views location. Those rows, the three sections under them and `views.ListViewItemProps` go with the locations, in the change that renders them. - `menus.NAVBAR_LOCATION`, `SETTINGS_MENU_LOCATION` and `PageMenuItem` were the SIP-235 shape authors would reach for, and nothing reads either location: `Menu.tsx` builds the navbar from the manifest's `nav` block. The whole menu half is out, including the exactly-one-of validation and the `PanelToolbar` guards that only existed because `command` had become optional. `order` stays -- it sorts the sqllab menus that are rendered today. - `getPageViews`/`usePageViews` returned `[]` everywhere outside their own test, because the loader routes a `PAGE_LOCATION` registration to `registerPageFor` and a page never reaches `viewRegistry`. Gone, with the five tests that exercised the impossible path, and `PAGE_LOCATION` now says on both sides that pages are read through `pages`. - A gated page returned raw JSON again: `show_http_exception` renders HTML for 404 and 500 only, so `Forbidden` answered a refresh or a bookmark with `GENERIC_BACKEND_ERROR` instead of the Not authorized screen the client already has. It serves the shell with a 403 now, and three test-client cases cover the 403, the flag-off 404 and the plain shell -- nothing called the route before. - `test_views_are_secured` was red on all three DB jobs: `@signed_in` sets no `_permission_name`, so `ExtensionsView.page` needs the allowlist entry next to `language_pack_script`. - The `useDashboardVersionPreview` change undid #44438 to patch one caller, and the import edge that tripped it went out with the earlier scope cut: reverted, `resolveSnapshotTheme` private again. SliceHeaderControls, versionHistory and DashboardBuilder pass without it. - Two `messages.pot` msgids went stale when the `ExtensionPage` copy changed, which is what failed babel-extract and `check_pot_drift_test`. Also the pre-commit leftovers: auto-walrus on `view.py`, oxfmt on `superset-core/package.json` and `core/http/index.ts`, and the comment in `routes.tsx` and the docblock in `routes.test.tsx` that still began mid-sentence from the deleted catch-all.
SUMMARY
Migrates the version history feature from raw
react-reduxuseDispatchto the shared typeduseAppDispatchhook introduced for the React Redux v8 migration.This covers all six production consumers under
features/versionHistory. The existing hook test now mockssrc/views/store.useAppDispatch, so its dispatch assertions still exercise the same calls. There are no behavior, selector, callback, or action-order changes.Closes #39927 (version history slice).
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable - no UI change.
TESTING INSTRUCTIONS
Run:
Observed locally:
set-state-in-effectwarnings in unchanged code.npm run typewas attempted but did not finish within the runner window. The focused React Redux v8 compatibility check foruseAppDispatchpassed during review.ADDITIONAL INFORMATION