Commit 8785aa64 authored by Clement Ho's avatar Clement Ho

Fix issue board transient failure

parent aaafd639
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
<div class="flash-container" <div class="flash-container"
v-if="error"> v-if="error">
<div class="flash-alert"> <div class="flash-alert">
An error occured. Please try again. An error occurred. Please try again.
</div> </div>
</div> </div>
<label class="label-light" <label class="label-light"
......
/* global ListIssue */ /* global ListIssue */
/* global Flash */
import Vue from 'vue'; import Vue from 'vue';
import queryData from '../../utils/query_data'; import queryData from '../../utils/query_data';
...@@ -108,7 +109,7 @@ gl.issueBoards.IssuesModal = Vue.extend({ ...@@ -108,7 +109,7 @@ gl.issueBoards.IssuesModal = Vue.extend({
if (!this.issuesCount) { if (!this.issuesCount) {
this.issuesCount = data.size; this.issuesCount = data.size;
} }
}); }).catch(() => new Flash('An unexpected error has occurred.', 'alert'));
}, },
}, },
computed: { computed: {
......
/* eslint-disable space-before-function-paren, no-underscore-dangle, class-methods-use-this, consistent-return, no-shadow, no-param-reassign, max-len, no-unused-vars */ /* eslint-disable space-before-function-paren, no-underscore-dangle, class-methods-use-this, consistent-return, no-shadow, no-param-reassign, max-len, no-unused-vars */
/* global ListIssue */ /* global ListIssue */
/* global ListLabel */ /* global ListLabel */
/* global Flash */
import queryData from '../utils/query_data'; import queryData from '../utils/query_data';
const PER_PAGE = 20; const PER_PAGE = 20;
...@@ -44,7 +45,8 @@ class List { ...@@ -44,7 +45,8 @@ class List {
this.position = data.position; this.position = data.position;
return this.getIssues(); return this.getIssues();
}); })
.catch(() => new Flash('An unexpected error has occurred.', 'alert'));
} }
destroy () { destroy () {
...@@ -52,11 +54,13 @@ class List { ...@@ -52,11 +54,13 @@ class List {
gl.issueBoards.BoardsStore.state.lists.splice(index, 1); gl.issueBoards.BoardsStore.state.lists.splice(index, 1);
gl.issueBoards.BoardsStore.updateNewListDropdown(this.id); gl.issueBoards.BoardsStore.updateNewListDropdown(this.id);
gl.boardService.destroyList(this.id); gl.boardService.destroyList(this.id)
.catch(() => new Flash('An unexpected error has occurred.', 'alert'));
} }
update () { update () {
gl.boardService.updateList(this.id, this.position); gl.boardService.updateList(this.id, this.position)
.catch(() => new Flash('An unexpected error has occurred.', 'alert'));
} }
nextPage () { nextPage () {
...@@ -91,7 +95,8 @@ class List { ...@@ -91,7 +95,8 @@ class List {
} }
this.createIssues(data.issues); this.createIssues(data.issues);
}); })
.catch(() => new Flash('Failed to load issues, please try again.', 'alert'));
} }
newIssue (issue) { newIssue (issue) {
...@@ -103,7 +108,8 @@ class List { ...@@ -103,7 +108,8 @@ class List {
const data = resp.json(); const data = resp.json();
issue.id = data.iid; issue.id = data.iid;
issue.milestone = data.milestone; issue.milestone = data.milestone;
}); })
.catch(() => new Flash('An unexpected error has occurred.', 'alert'));
} }
createIssues (data) { createIssues (data) {
...@@ -147,11 +153,13 @@ class List { ...@@ -147,11 +153,13 @@ class List {
this.issues.splice(oldIndex, 1); this.issues.splice(oldIndex, 1);
this.issues.splice(newIndex, 0, issue); this.issues.splice(newIndex, 0, issue);
gl.boardService.moveIssue(issue.id, null, null, moveBeforeIid, moveAfterIid); gl.boardService.moveIssue(issue.id, null, null, moveBeforeIid, moveAfterIid)
.catch(() => new Flash('An unexpected error has occurred.', 'alert'));
} }
updateIssueLabel(issue, listFrom, moveBeforeIid, moveAfterIid) { updateIssueLabel(issue, listFrom, moveBeforeIid, moveAfterIid) {
gl.boardService.moveIssue(issue.id, listFrom.id, this.id, moveBeforeIid, moveAfterIid); gl.boardService.moveIssue(issue.id, listFrom.id, this.id, moveBeforeIid, moveAfterIid)
.catch(() => new Flash('An unexpected error has occurred.', 'alert'));
} }
findIssue (id) { findIssue (id) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment