Skip to content

Unify Vuex message API request logic

Tomas Vik requested to merge unify-message-request into develop

With every message related API request we need to do the same things:

  • show message spinner while the request is active
  • mark message red if the request failed

For context: https://gitlab.com/gitlab-org/gitter/webapp/merge_requests/1686#note_258883937

This MR introduces VuexMessageRequest that generates arguments for UPDATE_MESSAGE mutation that are identical to all message-related requests.

Feature success error
Update Kapture_2019-12-15_at_17.18.17 Kapture_2019-12-17_at_18.04.38
Delete Kapture_2019-12-17_at_18.21.40 Kapture_2019-12-17_at_18.09.25
Report Kapture_2019-12-17_at_17.58.38 Kapture_2019-12-17_at_18.02.14

Testing strategy

  • Update message
    • successful update - shows the spinner
    • error - turn of the local server before submitting update - observe message getting red and make sure the red message contains the new updated text
  • Delete message
    • successful delete - shows the spinner before the message disappears
    • error - turn of the local server before clicking delete - observe message getting red
  • Report message
    • successful report - shows the spinner
    • error - turn of the local server before clicking report - observe message getting red

Note: throttling the network connection can help with seeing the message spinner

Edited by Tomas Vik

Merge request reports