Skip to content

Delete thread messages

Closes #2351 (closed)

Kapture_2019-11-11_at_10.15.28

Testing strategy

  • Removing thread message removes it from UI thread message feed and decrements the count of child messages on parent
  • Removing parent message replaces it with This message was deleted text instead of deleting it (shows in both MMF and TMF). Screenshot_2019-11-03_at_4.00.16_PM
  • When user A (one browser tab) removes thread message, user B (another tab) can immediately see the message being removed.
  • Policy (should be checked in both MMF and TMF)(only UI treatment, the backend policy implementation hasn't changed)
    • Admin can always remove messages
    • Message author can delete the message
    • User can't delete other user's message
  • Context menu
    • Appears when clicking the ... icon
    • Disappears when selecting an option or when the user clicks elsewhere.

Developer notes

Using @gitlab/ui bootstrap-vue popover

There were several problems with @gitlab/ui that were mostly solvable but after struggling for a day with the last issue I've rolled back to the bootstrap-vue popover which worked out of the box. Since the styles are clashing and we are using existing Gitter styles to style the new popover there was no immediate benefit to using @gitlab/ui (the benefit of being useful in the future was negated by the last issue on the list)

  • @gitlab/ui depends on window and needs to be imported to the project in the browser only
  • @gitlab/ui requires globally imported styles (similarly to boostrap-vue). The workaround is to reuse current bootstrap styles in for the new Bootstrap 4 popover.
  • When sending thread messages the GlPopover causes issues with $attr and $listeners fields: Screenshot_2019-11-07_at_2.30.45_PM this error might point at having different versions of Vue included in the project I've seen similar issues many times in react projects. I tried to make sure the Vue version is the same but without any effect on the error.

This is how including the @gitlab/ui to Gitter felt: https://www.youtube.com/watch?v=AbSehcT19u0 😸

Edited by Tomas Vik (OOO back on 2024-08-12)

Merge request reports