fix: Can't toggle off from the ad-hoc tools menu if you've toggled on in DetailsView #7431
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Details
Two ad-hoc tools (Automated Checks and Needs Review) have the ability to view issues in DetailsView. Unfortunately, if you try to toggle either of them off in ad-hoc tools while their corresponding DetailsView list of issues is open, the DetailsView toggle will overwrite the "off" state and force it to be "on". Additionally, toggling off in DetailsView does not turn the toggle off in ad-hoc tools.
This PR keeps these toggles in sync by:
componentDidMount
instead of on render.VisualizationActions.enableVisualization
/VisualizationActions.disabledVisualization
whenCardSelectionActions.toggleVisualHelper
is triggered, which involves:VisualizationActions
are accessible fromCardSelectionActionCreator
sVisualizationTogglePayload
instead ofBasePayload
with the enabled state (passed in from theVisualHelperToggle
'sonClick
)CardSelectionActions.toggleVisualHelper
whenVisualizationActions.enableVisualization
/VisualizationActions.disabledVisualization
are triggered, which involves:payload.test
and triggeringneedsReviewSelectionActions.toggleVisualHelper
orcardSelectionActions.toggleVisualHelper
if theVisualizationType
matches.Motivation
Addresses issue #6253
Context
Pull request checklist
yarn test
)<rootDir>/test-results/unit/coverage
fix:
,chore:
,feat(feature-name):
,refactor:
). SeeCONTRIBUTING.md
.