Loading
Make columns in security inventory toggle-able
What does this MR do and why?
Make columns in security inventory toggle-able
Add a display options button above the table that opens a drawer
where each column's visibility can be toggled
Only show security attributes toggle when user has read permission
Always show name and actions columns, and checkbox column if available
Persist the list of hidden columns in localStorageReferences
- epic: Security Inventory: UX and Usability Improvements (gitlab-org#22124)
- the security attributes column this can now hide was added in Add security attributes column to inventory (!199973 - merged)
There is no issue for this - it came out of a conversation at the R&D Summit
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
expand for previous screen recordings
How to set up and validate locally
-
git checkout mfluharty-inventory-toggleable-columns echo "Feature.enable(:security_inventory_toggleable_columns)" | gdk rails c - have a GitLab Ultimate licence
- go to a group =>
Secure=>Security inventory
toggling a column off and on
- check that there is a
Displaybutton above the table - select
Displayand check the drawer:- it should be titled
Display - under
Columnsthere should be a toggle forVulnerabilities,Tool CoverageandSecurity attributes - there should be no toggle for
Nameor for the actions column
- it should be titled
- toggle
Vulnerabilitiesoff - check the table:
- the
Vulnerabilitiescolumn should disappear Nameand the actions column should still be there- the remaining columns should spread to fill the width rather than leaving a gap
- the
- toggle it back on and check the column returns in its original position
hiding everything that can be hidden
- toggle all three columns off
- check that the table is still usable:
Nameshould still be shown- the actions column should still be shown
- the checkbox column should still be shown, if it was there to begin with (permission-dependent)
the hidden columns are persisted to localStorage
- toggle
Tool Coverageoff - reload the page
- check that
Tool Coverageis still hidden - navigate to a different group and back, and check it is still hidden
- clear the setting and check the default returns
then reload - all columns should be visible again
localStorage.removeItem('security_inventory_hidden_columns')
without permission to read security attributes
- sign in as a user who can see the security inventory but cannot read security attributes
- open the
Displaydrawer - check that the
Security attributestoggle is absent:- the
VulnerabilitiesandTool Coveragetoggles should still be there - the
Security attributescolumn should not be in the table either - this is the
canReadAttributesbranch, so it gates the toggle and the column together
- the
with the flag off
- disable the flag
echo "Feature.disable(:security_inventory_toggleable_columns, Group.find(ID))" | gdk rails c - reload the security inventory
- check that the table is back to how it was before this MR:
- there should be no
Displaybutton - every column should be visible, including any you had hidden while the flag was on
- the hidden column set is not read from local storage while the flag is off, so a stale setting cannot leave a column hidden with no drawer to restore it
- there should be no
to run tests
yarn jest ee/spec/frontend/security_inventory/components/display_options_spec.js ee/spec/frontend/security_inventory/components/security_inventory_table_spec.js ee/spec/frontend/security_inventory/components/inventory_dashboard_spec.jsMR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Miranda Fluharty
