Skip to content

Show correct label subscription action toggle icon

What does this MR do?

It fixes issue 19225 whereby the 'subscribe' button's icon, on the Labels subview of the Issues view in a repository, is now keyed according to the action that would take place should the user click on the button. If the click would result in subscription to that label, the 'fa-eye' icon is displayed. Otherwise, the 'fa-eye-slash' icon is displayed (per recommendation in the issue's comments).

Are there points in the code the reviewer needs to double check?

I noticed the Subscription JavaScript class is used in two places: Subscribing to labels as well as issues. Give special attention to use in both scenarios, as well as in small vs large view sizes.

What are the relevant issue numbers?

19225

Screenshots

The following screenshot shows the issue is fixed: The user is not currently subscribed to the 'bug' label, but is to the 'confirmed' label.

gitlab-ce-issue-19225-fixed.png

Tests

I couldn't find any existing unit tests for the label subscription feature. If there are, please point me to them so I can extend them to check for the new icon state. As it is, I've done manual/visual testing of page display and page DOM.

Does this MR meet the acceptance criteria?

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/18594

Merge request reports