Hide child items and linked items widgets when empty and can't edit

What does this MR do and why?

Update both the Child items widget and the Linked items widget so that if the user does not have permission to update their contents and they are empty, they are not shown.

References

Screenshots or screen recordings

User's permission State Before After
allowed to edit has content (no change) gdk.test_3000_flightjs_Flight_-issues_43__15 gdk.test_3000_flightjs_Flight_-issues_43__15
allowed to edit empty (no change) gdk.test_3000_flightjs_Flight_-_issues_126 gdk.test_3000_flightjs_Flight_-_issues_126
not allowed to edit has content (no change) gdk.test_3000_flightjs_Flight_-issues_43__16 gdk.test_3000_flightjs_Flight_-issues_43__16
not allowed to edit empty (widgets are not rendered) gdk.test_3000_flightjs_Flight_-issues_126__2 gdk.test_3000_flightjs_Flight_-issues_126__1

How to set up and validate locally

  1. Check out this branch
  2. Create a brand new work item in the GDK
  3. You will see that the empty Child items and Linked items widgets appear as normal, and you can edit them
  4. Copy the URL and open it in a new incognito tab
  5. You will see that as a user who does not have permission to edit the child items or linked items, the empty widgets do not appear in the UI
  6. Now visit a work item that does have child items or linked items in an incognito tab
  7. You will see that if there are child items, then the child items widget appears for users who do not have permission to edit
  8. You will see that if there are linked items, then the linked items widget appears for users who do not have permission to edit

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

Merge request reports

Loading