Delete thread messages
Closes #2351 (closed)
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).
- 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.
- Appears when clicking the
Developer notes
@gitlab/ui
bootstrap-vue
popover
Using @gitlab/ui
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 onwindow
and needs to be imported to the project in the browser only -
⚠ @gitlab/ui
requires globally imported styles (similarly toboostrap-vue
). The workaround is to reuse current bootstrap styles in for the new Bootstrap 4 popover. -
⚠ When sending thread messages theGlPopover
causes issues with$attr
and$listeners
fields: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)