Unify Vuex message API request logic
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 | ||
Delete | ||
Report |
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