Make "show labels" toggle persist with localStorage
What does this MR do?
The "Show Labels" toggle on boards is a javascript toggle that only works per-session. This MR stores the toggled state into localStorage so that it can persist while using the same browser.
This MR utilizes the existing isLocalStorageAccessSafe
check from the accessor utils. If localStorage is disabled, the behavior reverts to the old state and will still function per-session.
To test
Normal case
- On an issue board in a browser with localStorage enabled, toggle "Show Labels"
- Refresh the page
- Observe that your toggle setting persisted
localStorage disabled case
- In a browser with localStorage disabled (I've found Firefox is best for this, as it allows you to disable localStorage without disabling cookies)
In FireFox: Type “about:config” in your address bar and hit enter to view your internal browser settings. Scroll down to "dom.storage.enabled", right click on it and hit "Toggle" to disable the DOM Storage.
- On an issue board, toggle "Show Labels"
- Ensure that label visibility correctly toggled
- Refreshing the page will reset the toggle, which is the current behavior.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
N/A