-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Can't toggle off from the ad-hoc tools menu if you've toggled on…
… in DetailsView (#7431) #### 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: * moving the code that determines if a scan needs to be run based on state to `componentDidMount` instead of on render. * triggering `VisualizationActions.enableVisualization`/`VisualizationActions.disabledVisualization` when `CardSelectionActions.toggleVisualHelper` is triggered, which involves: * making sure `VisualizationActions` are accessible from `CardSelectionActionCreator`s * sending a `VisualizationTogglePayload` instead of `BasePayload` with the enabled state (passed in from the `VisualHelperToggle`'s `onClick`) * triggering `CardSelectionActions.toggleVisualHelper` when `VisualizationActions.enableVisualization`/`VisualizationActions.disabledVisualization` are triggered, which involves: * checking the value of `payload.test` and triggering `needsReviewSelectionActions.toggleVisualHelper` or `cardSelectionActions.toggleVisualHelper` if the `VisualizationType` matches. ##### Motivation Addresses issue #6253 ##### Context <!-- Are there any parts that you've intentionally left out-of-scope for a later PR to handle? --> <!-- Were there any alternative approaches you considered? What tradeoffs did you consider? --> #### Pull request checklist <!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox --> - [x] Addresses an existing issue: #6253 - [x] Added/updated relevant unit test(s) (and ran `yarn test`) - [x] Verified code coverage for the changes made. Check coverage report at: `<rootDir>/test-results/unit/coverage` - [x] PR title *AND* final merge commit title both start with a semantic tag (`fix:`, `chore:`, `feat(feature-name):`, `refactor:`). See `CONTRIBUTING.md`. --------- Co-authored-by: Madalyn Parker <[email protected]>
- Loading branch information
1 parent
b4de539
commit 9c0dafa
Showing
15 changed files
with
228 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.