Commit 8b1c959
authored
RI-8208: Adopt typed Redux hooks (useAppDispatch / useAppSelector) (#5993)
* adopt typed Redux hooks
Replace direct `useDispatch`/`useSelector` from `react-redux` with the
typed `useAppDispatch`/`useAppSelector` wrappers from `uiSrc/slices/hooks`
across all production source files (including Storybook stories).
Functionally identical at runtime — the typed hooks resolve through the
same react-redux Provider context — but the typed signatures carry
`AppDispatch` and `RootState` so callers no longer need to cast or rely
on the `redux-thunk` v2 implicit thunk acceptance. This is a prerequisite
for the upcoming Redux / RTK upgrade so that the upgrade itself becomes a
small, reviewable change rather than a 350-file refactor mixed with a
dependency bump.
* update Redux hook mocks to target typed hooks module
Migrate spec files from mocking `react-redux` (`useDispatch`/`useSelector`)
to mocking `uiSrc/slices/hooks` (`useAppDispatch`/`useAppSelector`), which
is what production code now imports after the typed-hooks adoption. Each
factory keeps `...jest.requireActual('uiSrc/slices/hooks')` so any hook
not explicitly stubbed falls through to the real implementation, matching
the previous `...jest.requireActual('react-redux')` semantics and avoiding
`is not a function` errors when only one hook is overridden.
Mostly mechanical (codemod-driven); a couple of files using namespace
imports of `react-redux` were updated by hand to keep the same test
behavior. The broader mocking pattern (jest.mock of the hooks layer
itself) is preserved intentionally — moving to a real `<Provider>` +
real store style is out of scope here and will be tracked separately.
* fix lint
* add eslint rule1 parent 07a0969 commit 8b1c959
384 files changed
Lines changed: 1551 additions & 1455 deletions
File tree
- redisinsight/ui/src
- components
- analytics-tabs
- bottom-group-components
- components/bottom-group-minimized
- bulk-actions-config
- cli/components
- cli-body
- CliBody
- cli-header
- cli-input
- CliAutocomplete
- command-helper
- CommandHelperHeader
- CommandHelper
- components
- command-helper-search-output
- command-helper-search
- CHSearchFilter
- CHSearchInput
- config
- consents-settings
- ConsentsNotifications
- ConsentsPrivacy
- ConsentsSettingsPopup
- database-overview/hooks
- environment-badge
- explore-guides
- feature-flag-component
- formated-date
- global-azure-auth
- global-subscriptions/CommonAppSubscription
- global-url-handler
- home-tabs
- hooks
- init
- instance-header
- components
- user-profile
- keys-summary
- main-router
- components
- markdown/RedisUploadButton
- messages
- feature-not-available
- module-not-loaded-minimalized
- module-not-loaded
- monaco-laguages
- monitor-config
- monitor
- MonitorHeader
- MonitorLog
- notifications
- components
- cloud-capi-unauthorized
- encryption-error-content
- hooks
- oauth
- oauth-connect-free-db
- oauth-jobs
- oauth-select-account-dialog
- oauth-select-plan
- oauth-sso-dialog
- oauth-sso-handler-dialog
- oauth-sso
- oauth-autodiscovery
- oauth-create-db
- oauth-sign-in
- oauth-user-profile
- onboarding-features
- onboarding-tour
- page-header
- production-write-confirmation
- pub-sub-config
- query
- hooks
- query-card
- QueryCardCliPlugin
- QueryCardCommonResult/components/CommonErrorResponse
- QueryCardHeader
- query-tutorials
- rdi-instance-header
- recommendation/recommendation-voting
- components/vote-option
- shortcuts-flyout
- side-panels
- components/insights-panel
- panels
- ai-assistant
- components
- assistance-chat
- chats-wrapper
- expert-chat
- components/expert-chat-header
- welcome-ai-assistant
- enablement-area
- EnablementArea
- components
- Code
- Group
- InternalPage
- LazyInternalPage
- live-time-recommendations
- components
- recommendation
- welcome-screen
- triggers
- copilot-trigger
- insights-trigger
- electron/components
- ConfigAzureAuth
- ConfigElectron
- ConfigOAuth
- pages
- analytics
- autodiscover-azure
- azure-databases
- azure-manual-connection
- azure-subscriptions
- AzureSubscriptions
- autodiscover-cloud
- redis-cloud-databases-result/hooks
- redis-cloud-databases/hooks
- redis-cloud-subscriptions/hooks
- autodiscover-sentinel
- sentinel-databases-result
- components/SentinelDatabasesResult
- sentinel-databases
- components/SentinelDatabases
- browser
- components
- actions
- add-key
- AddKeyHash
- AddKeyList
- AddKeyReJSON
- AddKeySet
- AddKeyStream
- AddKeyString
- AddKeyVectorSet
- AddKeyZset
- browser-left-panel
- browser-right-panel
- browser-search-panel
- bulk-actions
- BulkActionsTabs
- BulkDelete
- BulkDeleteContent
- BulkDeleteSummary
- BulkUpload
- filter-key-type
- key-list
- key-tree
- KeyTreeSettings
- keys-browser-panel/contexts
- keys-header
- load-sample-data
- make-searchable-button
- make-searchable-modal
- no-keys-found
- no-keys-message
- onboarding-start-popover
- redisearch-key-list
- search-key-list
- use-key-format
- virtual-tree
- components/Node
- modules
- key-details-header
- components
- key-details-header-delete
- key-details-header-formatter
- key-details-header-name
- key-details-header-size-length
- key-details-header-ttl
- key-details
- components
- change-editor-type-button
- dynamic-type-details
- hash-details
- add-hash-fields
- hash-details-table
- list-details
- add-list-elements
- list-details-table
- remove-list-elements
- modules-type-details
- no-key-selected
- rejson-details
- components/add-item
- monaco-editor
- rejson-details
- rejson-object
- rejson-scalar
- set-details
- add-set-members
- set-details-table
- stream-details
- add-stream-entity
- add-stream-group
- consumers-view
- ConsumersView
- groups-view
- GroupsView
- messages-view
- MessageClaimPopover
- MessagesView
- stream-data-view
- StreamDataView
- stream-details-body
- stream-tabs
- string-details
- string-details-value
- vector-set-details
- element-details
- hooks
- useAddElementPanel
- useAddElements
- useElementAttributeEditor
- useElementDetails
- useSimilaritySearchResults
- useSimilaritySearch
- useVectorSetActionsConfig
- useVectorSetElementListData
- similarity-search-form
- filter-syntax-help-popover
- similarity-search-form
- similarity-search-results
- components/SimilarityColumnsPopover
- zset-details
- add-zset-members
- zset-details-table
- cluster-details
- components/cluster-details-header
- database-analysis
- components
- analysis-data-view
- analysis-ttl-view
- header
- recommendations-view
- top-keys
- top-namespace
- home
- components
- add-database-screen
- hooks
- cloud-connection
- cloud-connection-form
- cluster-connection
- database-list-header
- database-manage-tags-modal
- database-panel-dialog
- databases-list/hooks
- db-status
- form
- import-database
- manual-connection
- manual-connection-form
- search-databases-list
- sentinel-connection
- tags-cell
- instance
- not-found-error
- pub-sub
- components
- messages-list/MessagesListTable
- publish-message
- subscribe-form
- rdi
- home
- components/rdi-instances-list/hooks
- header
- search
- instance
- components
- download
- header
- components
- buttons/deploy-pipeline-button
- pipeline-actions
- pipeline-management
- components
- download-from-server-modal
- dry-run-job-commands
- dry-run-job-transformations
- jobs-panel
- source-pipeline-dialog
- template-button
- template-form
- template-popover
- test-connections-panel
- upload-modal
- pages
- config
- job
- statistics
- redis-cluster
- redis-stack/components
- edit-connection
- protected-route
- settings
- components
- advanced-settings
- app-version
- cloud-settings
- components/user-api-keys-table
- general-settings/datetime-formatter
- components
- datetime-form
- timezone-form
- theme-settings
- workbench-settings
- slow-log
- components
- Actions
- SlowLogConfig
- vector-search
- components
- command-view
- field-type-modal/hooks
- keys-browser
- __stories__
- contexts
- query-editor
- query-library-item
- query-library-view/hooks
- search-page-fallback
- select-key-onboarding-popover
- upgrade-redis-banner
- context/create-index-page
- hooks
- useCreateIndexFlow
- useHasExistingKeys
- useIndexInfo
- useIndexListData
- useIsKeyIndexed
- useListContent
- useLoadKeyData
- useRedisInstanceCompatibility
- useRedisearchListData
- pages/VectorSearchPage
- workbench
- components
- query
- Query
- wb-no-results-message
- wb-view
- WBView
- services/hooks
- slices
- telemetry
- tests
- templates
- explore-panel
- home-page-template
- instance-page-template
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
197 | 215 | | |
198 | 216 | | |
199 | 217 | | |
| |||
223 | 241 | | |
224 | 242 | | |
225 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
226 | 252 | | |
227 | 253 | | |
228 | 254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
| 71 | + | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
0 commit comments