-
Notifications
You must be signed in to change notification settings - Fork 788
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
Improve advanced multiselect #920
Improve advanced multiselect #920
Conversation
AdvancedMultiSelect can be broken up and composed of smaller, more focused components. This commit refactors AdvancedMultiSelect from a functional component to a class component.
…elect The AdvancedMultiSelect should adhere to some set of human interface guidelines. In the absence of a formal, agreed upon set of guidelines for Infection Monkey, this commit uses KDE's guidelines for checkboxes: https://hig.kde.org/components/editing/checkbox.html When child checkboxes are not all checked, the master checkbox displays a mixed-state icon, instead of a checked icon. Clicking the mixed-state icon checks all child checkboxes. Clicking an unchecked master checkbox also enables all child checkboxes. In the past, clicking an unchecked master checkbox checked only the *default* child checkboxes. While this may seem desirable so that unsafe exploits do not accidentally get selected by the user, it will confuse and frustrate users, as master/child checkboxes do not normally function this way. If there is concern that users may unknowingly select unsafe exploits/options, we should pop up a warning to inform the user when the config is saved/submitted. Issue guardicore#891
Codecov Report
@@ Coverage Diff @@
## develop #920 +/- ##
============================================
- Coverage 60.56% 19.07% -41.50%
============================================
Files 166 338 +172
Lines 4953 11482 +6529
============================================
- Hits 3000 2190 -810
- Misses 1953 9292 +7339
Continue to review full report at Codecov.
|
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice touch of adding mixed state to master checkbox component! Also, did some good refactoring, but there are some things that I don't like/understand.
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
Alphabetically sort options in AdvancedMultiSelect to improve usability. Float "unsafe" options to the bottom so they are grouped together.
Fix swimm units
ea08886
to
117678f
Compare
This PR is getting fairly long and I think it has accomplished it's mission:
This PR is missing a modal dialog that pops up and warns the user when they import or attempt to submit an unsafe config. #946 has been created to track that feature. Given that, now, when unsafe options are selected, users have more warning than they did before, I think this PR can proceed without the inclusion of the modal dialog. |
monkey/monkey_island/cc/services/config_schema/definitions/finger_classes.py
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/ChildCheckbox.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/InfoPane.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/ui-components/InfoPane.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preem quality stuff. But look at my suggestions before merging
What does this PR do?
Fixes #891.
Master checkboxes can now have a mixed state.
PR Checklist
Testing Checklist
Testing GIF
Explain Changes
The AdvancedMultiSelect should adhere to some set of human interface guidelines. In the absence of a formal, agreed upon set of guidelines for Infection Monkey, this commit uses KDE's guidelines for checkboxes: https://hig.kde.org/components/editing/checkbox.html
When child checkboxes are not all checked, the master checkbox displays a mixed-state icon, instead of a checked icon. Clicking the mixed-state icon checks all child checkboxes. Clicking an unchecked master checkbox also enables all child checkboxes.
In the past, clicking an unchecked master checkbox checked only the default child checkboxes. While this may seem desirable so that unsafe exploits do not accidentally get selected by the user, it will confuse and frustrate users, as master/child checkboxes do not normally function this way. If there is concern that users may unknowingly select unsafe exploits/options, we should pop up a warning to inform the user when the config is saved/submitted.