Skip to content

Make "show labels" toggle persist with localStorage

Jake Lear requested to merge jl-sticky-label-toggle into master

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

  1. On an issue board in a browser with localStorage enabled, toggle "Show Labels"
  2. Refresh the page
  3. Observe that your toggle setting persisted

localStorage disabled case

  1. 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.

  1. On an issue board, toggle "Show Labels"
  2. Ensure that label visibility correctly toggled
  3. Refreshing the page will reset the toggle, which is the current behavior.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

N/A

Merge request reports