Skip to content

Reset labels after issuables updates

euko requested to merge 357229-return-sorted-labels-in-mutation-responses into master

What does this MR do and why?

  • Updates issuable update services to reload associated labels to maintain the sort order (title asc.)

Labels are ordered by title in ascending order using a default scope and returned using the same order in the GraphQL APIs for consumption in the frontend. After labels get added to an issuable through an update service, either the issuable or its labels need to be reloaded so that the order is maintained.

Example.

An issue has two labels assigned: b and c.

After adding another label titled a to the issue, its labels should be listed in this order: a, b, c

Resolves #357229 (closed).

Screenshots or screen recordings

  1. Create two labels each titled a and b.

  2. Assign label b to an issue first then label a.

  3. Check that the labels are ordered correctly by title in ascending order in the mutation response.

(you can easily check this through the UI.)

master this branch
Screen_Recording_2022-03-31_at_8.24.19_AM Screen_Recording_2022-03-31_at_8.26.22_AM

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by euko

Merge request reports

Loading