Add room favourite drag and drop to Vue left-menu
Add room favourite drag and drop to Vue left-menu
- Uses https://github.com/SortableJS/Vue.Draggable for drag and drop (seems to be the most popular and was easy to use)
On favourite persisting request failure, we show a notification and rollback:
Testing strategy
- Add the feature toggle,
node ./scripts/utils/feature-toggle.js --name vue-left-menu --description "Left menu using Vue (alpha)"
- Enable the feature toggle
Try the following with and without the feature toggle:
- Drag rooms into the favourites list
- Drag rooms around in the favourites list
- Drag rooms out of the favourites list
Previous old left-menu code
Frontend
- https://gitlab.com/gitlab-org/gitter/webapp/blob/f623bb85a49b9b5458ae2cb914c22840b476b954/public/js/components/menu/room/dnd-controller.js
- https://gitlab.com/gitlab-org/gitter/webapp/blob/f623bb85a49b9b5458ae2cb914c22840b476b954/public/js/views/menu/room/favourite-collection/favourite-collection-view.js#L50-75
- https://gitlab.com/gitlab-org/gitter/realtime-client/blob/9c11abd8a1206b712272a99aed49c95f1cb10471/lib/room-collection.js#L25-76
Styles:
Server:
Dev notes
- https://github.com/SortableJS/Vue.Draggable/blob/cf0aba17372e392fc569c1b9a90495f124e4cc70/tests/unit/vuedraggable.integrated.spec.js
- https://github.com/SortableJS/Vue.Draggable/blob/cf0aba17372e392fc569c1b9a90495f124e4cc70/tests/unit/vuedraggable.spec.js
Closes https://gitlab.com/gitlab-org/gitter/webapp/issues/2154
Edited by Eric Eastwood