Skip to content

Fixed reload issue in select-options#3320

Open
Corepex wants to merge 2 commits into2025.4from
3163-select-options---refresh-button-has-no-effect
Open

Fixed reload issue in select-options#3320
Corepex wants to merge 2 commits into2025.4from
3163-select-options---refresh-button-has-no-effect

Conversation

@Corepex
Copy link
Copy Markdown
Contributor

@Corepex Corepex commented Apr 8, 2026

Changes in this pull request

Resolves #3163

Additional info

This pull request refactors how the Select Option tree is refreshed and reloaded throughout the UI. The main change is replacing direct query refetching with Redux tag invalidation, which better integrates with the application's state management and cache system. Several callbacks and prop types are updated to reflect this new approach, and related code is simplified to remove unnecessary async/await usage.

Tree reload and refresh logic refactor:

  • Changed the tree reload mechanism from directly calling the query's refetch method to dispatching a Redux action that invalidates the relevant cache tags, using dispatch(api.util.invalidateTags(invalidatingTags.SELECT_OPTION_COLLECTION())) in select-option-widget.tsx. This ensures a more consistent and scalable cache update strategy.
  • Updated the onReloadTree prop type in tree-container.tsx from () => Promise<void> to () => void, and removed all async/await usage associated with tree reloading, simplifying the code and aligning with the new invalidation-based approach. [1] [2] [3] [4]

Dependency and hook updates:

  • Added imports for api, invalidatingTags, and useAppDispatch in select-option-widget.tsx to support the new Redux-based invalidation logic.
  • Removed the now-unused refetch variable from the query hook in select-option-widget.tsx.

Select Option refresh button behavior:

  • Updated the refresh button in select-option-form.tsx to fetch the latest option data from the backend and update the local state and form values only if new data is available, improving data consistency.

@Corepex Corepex self-assigned this Apr 8, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

@Corepex Corepex changed the base branch from 2026.x to 2025.4 April 8, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Select options] - refresh button has no effect

1 participant