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: remove memoised Redux selectors #1892

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andogq
Copy link
Contributor

@andogq andogq commented Mar 14, 2025

Done

  • update all instances of useSelector to useAppSelector

  • update one test in ModelTableList.test.tsx which relied on spying on a memoised selector

QA

  • Launch dashboard, and navigate to ensure nothing is misbehaving

Details

  • WD20357

@andogq andogq self-assigned this Mar 14, 2025
@webteam-app
Copy link

@andogq andogq force-pushed the refactor/redux-selectors branch from c70c84e to ec58b2d Compare March 14, 2025 00:51
Copy link

github-actions bot commented Mar 14, 2025

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 97.98% (🎯 95%) 14508 / 14806
🟢 Statements 97.98% (🎯 95%) 14508 / 14806
🟢 Functions 98.32% (🎯 95%) 588 / 598
🟢 Branches 92.38% (🎯 90%) 3068 / 3321
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/AuditLogsTable/hooks.ts 100% 100% 100% 100%
src/components/InfoPanel/InfoPanel.tsx 100% 71.42% 100% 100%
src/components/LogIn/LogIn.tsx 100% 100% 100% 100%
src/components/LogIn/IdentityProviderForm/IdentityProviderForm.tsx 100% 100% 100% 100%
src/components/ModelTableList/CloudGroup/CloudGroup.tsx 97.58% 70% 100% 97.58% 53, 72, 126
src/components/ModelTableList/OwnerGroup/OwnerGroup.tsx 98.31% 77.77% 100% 98.31% 68, 117
src/components/ModelTableList/StatusGroup/StatusGroup.tsx 100% 100% 100% 100%
src/components/PrimaryNav/PrimaryNav.tsx 100% 93.1% 100% 100%
src/components/secrets/SecretForm/SecretForm.tsx 98.69% 88% 100% 98.69% 114-115
src/hooks/useAnalytics.tsx 100% 100% 100% 100%
src/hooks/useCanConfigureModel.ts 100% 100% 100% 100%
src/hooks/useCanManageSecrets.ts 100% 100% 100% 100%
src/hooks/useModelStatus.ts 100% 100% 100% 100%
src/juju/api-hooks/common.ts 100% 92.85% 100% 100%
src/juju/api-hooks/permissions.ts 100% 100% 100% 100%
src/juju/api-hooks/secrets.ts 100% 94.87% 100% 100%
src/layout/BaseLayout/BaseLayout.tsx 100% 100% 100% 100%
src/pages/ControllersIndex/ControllersIndex.tsx 97.28% 91.89% 100% 97.28% 144-152
src/pages/ControllersIndex/ControllerOverview/ControllerOverview.tsx 100% 100% 100% 100%
src/pages/EntityDetails/EntityDetails.tsx 100% 97.56% 100% 100%
src/pages/EntityDetails/App/App.tsx 96.84% 78.94% 85.71% 96.84% 81-82, 87-88, 136-137, 144, 315, 359, 373
src/pages/EntityDetails/Machine/Machine.tsx 95.78% 59.09% 100% 95.78% 46-47, 63-64
src/pages/EntityDetails/Model/Model.tsx 98.93% 95.55% 100% 98.93% 62-63
src/pages/EntityDetails/Model/ApplicationsTab/ApplicationsTab.tsx 99.01% 85.71% 100% 99.01% 116
src/pages/EntityDetails/Model/ApplicationsTab/LocalAppsTable/LocalAppsTable.tsx 100% 84.61% 100% 100%
src/pages/EntityDetails/Model/ApplicationsTab/LocalAppsTable/useTableSelect.tsx 97.29% 78.57% 100% 97.29% 42, 95-96
src/pages/EntityDetails/Model/ApplicationsTab/SearchResults/SearchResults.tsx 96.55% 90% 100% 96.55% 47-48
src/pages/EntityDetails/Model/Logs/Logs.tsx 100% 100% 100% 100%
src/pages/EntityDetails/Model/Logs/ActionLogs/ActionLogs.tsx 96.35% 86.41% 100% 96.35% 85-86, 94, 116-121, 225-226, 236-237
src/pages/EntityDetails/Model/ModelTabs/ModelTabs.tsx 100% 100% 100% 100%
src/pages/EntityDetails/Model/Secrets/Secrets.tsx 100% 100% 100% 100%
src/pages/EntityDetails/Model/Secrets/SecretContent/SecretContent.tsx 100% 95.45% 100% 100%
src/pages/EntityDetails/Model/Secrets/SecretsTable/SecretsTable.tsx 100% 100% 100% 100%
src/pages/EntityDetails/Unit/Unit.tsx 100% 73.33% 100% 100%
src/pages/ModelDetails/ModelDetails.tsx 100% 100% 100% 100%
src/pages/ModelsIndex/ModelsIndex.tsx 98.8% 90.9% 100% 98.8% 190-191
src/panels/ActionsPanel/ActionsPanel.tsx 99.44% 91.66% 100% 99.44% 131
src/panels/ActionsPanel/CharmActionsPanel/CharmActionsPanel.tsx 100% 84.21% 100% 100%
src/panels/AuditLogsFilterPanel/Fields/Fields.tsx 100% 100% 100% 100%
src/panels/CharmsAndActionsPanel/CharmsAndActionsPanel.tsx 100% 100% 100% 100%
src/panels/CharmsAndActionsPanel/CharmActionsPanelTitle/CharmActionsPanelTitle.tsx 100% 100% 100% 100%
src/panels/CharmsPanel/CharmsPanel.tsx 94.91% 100% 75% 94.91% 31-33
src/panels/CharmsPanel/CharmApplicationsDetails/CharmApplicationsDetails.tsx 100% 87.5% 100% 100%
src/panels/ConfigPanel/SecretsPicker/SecretsPicker.tsx 100% 96.77% 100% 100%
src/panels/GrantSecretPanel/GrantSecretPanel.tsx 100% 96.66% 100% 100%
src/panels/RemoveSecretPanel/RemoveSecretPanel.tsx 98.3% 81.25% 66.66% 98.3% 56-57
src/panels/RemoveSecretPanel/Fields/Fields.tsx 100% 100% 100% 100%
src/panels/ShareModelPanel/ShareModel.tsx 99.36% 96.92% 100% 99.36% 126-127
src/store/juju/selectors.ts 97.27% 93.59% 100% 97.27% 555-556, 585-586, 694, 718, 725, 731-732, 812-813, 838-839, 876-877, 902-903, 931-932
Generated in workflow #240 for commit 6122db8 by the Vitest Coverage Report Action

Copy link
Contributor

@huwshimi huwshimi left a comment

Choose a reason for hiding this comment

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

Thanks Tom. A few small suggestions.

- update all instances of `useSelector` to `useAppSelector`

- update one test in `ModelTableList.test.tsx` which relied on spying on
  a memoised selector
@andogq andogq force-pushed the refactor/redux-selectors branch from ec58b2d to 6122db8 Compare March 14, 2025 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants