Commit ee35c96b authored by Clement Ho's avatar Clement Ho

fix eslint

parent 85834b64
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
/* global MilestoneSelect */ /* global MilestoneSelect */
/* global LabelsSelect */ /* global LabelsSelect */
/* global Sidebar */ /* global Sidebar */
/* global Flash */
import Vue from 'vue'; import Vue from 'vue';
import eventHub from '../../sidebar/event_hub'; import eventHub from '../../sidebar/event_hub';
...@@ -85,10 +86,14 @@ require('./sidebar/remove_issue'); ...@@ -85,10 +86,14 @@ require('./sidebar/remove_issue');
saveAssignees () { saveAssignees () {
this.loadingAssignees = true; this.loadingAssignees = true;
function setLoadingFalse() {
this.loadingAssignees = false;
}
gl.issueBoards.BoardsStore.detail.issue.update(this.endpoint) gl.issueBoards.BoardsStore.detail.issue.update(this.endpoint)
.then(() => this.loadingAssignees = false) .then(setLoadingFalse)
.catch(() => { .catch(() => {
this.loadingAssignees = false; setLoadingFalse();
return new Flash('An error occurred while saving assignees'); return new Flash('An error occurred while saving assignees');
}); });
}, },
......
...@@ -19,7 +19,7 @@ export default class SidebarMediator { ...@@ -19,7 +19,7 @@ export default class SidebarMediator {
} }
saveAssignees(field) { saveAssignees(field) {
const selected = this.store.assignees.map((u) => u.id); const selected = this.store.assignees.map(u => u.id);
// If there are no ids, that means we have to unassign (which is id = 0) // If there are no ids, that means we have to unassign (which is id = 0)
// And it only accepts an array, hence [0] // And it only accepts an array, hence [0]
......
...@@ -177,7 +177,6 @@ describe('Issue card component', () => { ...@@ -177,7 +177,6 @@ describe('Issue card component', () => {
expect(component.$el.querySelectorAll('.card-assignee .avatar').length).toEqual(4); expect(component.$el.querySelectorAll('.card-assignee .avatar').length).toEqual(4);
}); });
describe('more than four assignees', () => { describe('more than four assignees', () => {
beforeEach((done) => { beforeEach((done) => {
component.issue.assignees.push(new ListAssignee({ component.issue.assignees.push(new ListAssignee({
...@@ -199,7 +198,7 @@ describe('Issue card component', () => { ...@@ -199,7 +198,7 @@ describe('Issue card component', () => {
}); });
it('renders 99+ avatar counter', (done) => { it('renders 99+ avatar counter', (done) => {
for(let i = 5; i < 104; i++) { for (let i = 5; i < 104; i += 1) {
const u = new ListAssignee({ const u = new ListAssignee({
id: i, id: i,
name: 'name', name: 'name',
...@@ -215,7 +214,7 @@ describe('Issue card component', () => { ...@@ -215,7 +214,7 @@ describe('Issue card component', () => {
}); });
}); });
}); });
}) });
describe('labels', () => { describe('labels', () => {
it('does not render any', () => { it('does not render any', () => {
......
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