Commit d867b9a7 authored by Simon Knox's avatar Simon Knox

fix lints

parent 80f4fa87
......@@ -199,7 +199,7 @@ export default Vue.extend({
return false;
},
expandButtonText() {
return this.expanded ? 'Collapse' : 'Expand'
return this.expanded ? 'Collapse' : 'Expand';
},
collapseScope() {
return this.currentPage === 'new';
......@@ -212,19 +212,6 @@ export default Vue.extend({
refreshPage() {
location.href = location.pathname;
},
loadMilestones(e) {
this.milestoneDropdownOpen = !this.milestoneDropdownOpen;
BoardService.loadMilestones.call(this);
if (this.milestoneDropdownOpen) {
this.$nextTick(() => {
const milestoneDropdown = this.$refs.milestoneDropdown;
const rect = e.target.getBoundingClientRect();
milestoneDropdown.style.width = `${rect.width}px`;
});
}
},
submit() {
gl.boardService.createBoard(this.board)
.then(resp => resp.json())
......@@ -252,13 +239,6 @@ export default Vue.extend({
cancel() {
Store.state.currentPage = '';
},
selectMilestone(milestone) {
this.milestoneDropdownOpen = false;
this.board.milestone_id = milestone.id;
this.board.milestone = {
title: milestone.title,
};
},
},
});
</script>
......@@ -41,7 +41,7 @@ export default {
type: Boolean,
required: false,
default: false,
}
},
},
data() {
return {
......@@ -54,4 +54,4 @@ export default {
},
},
};
</script>
\ No newline at end of file
</script>
......@@ -84,7 +84,15 @@ export default {
};
},
mounted() {
BoardService.loadMilestones.call(this).then(() => this.loading = false);
this.$http.get(this.milestonePath)
.then(resp => resp.json())
.then((data) => {
this.milestones = data;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
eventHub.$on('open', this.open);
eventHub.$on('close', this.close);
eventHub.$on('toggle', this.toggle);
......@@ -99,7 +107,7 @@ export default {
},
methods: {
selectMilestone(milestone) {
this.board.milestone = milestone;
this.$set(this.board, 'milestone', milestone);
this.$emit('input', milestone.id);
this.close();
},
......
......@@ -99,17 +99,6 @@ class BoardService {
return this.issues.bulkUpdate(data);
}
static loadMilestones(path) {
this.loading = true;
return this.$http.get(this.milestonePath)
.then(resp => resp.json())
.then((data) => {
this.milestones = data;
this.loading = false;
});
}
}
window.BoardService = BoardService;
......@@ -4,7 +4,7 @@
/* global mockBoardService */
import Vue from 'vue';
import milestoneSelect from '~/boards/components/milestone_select';
import MilestoneSelect from '~/boards/components/milestone_select.vue';
import '~/boards/services/board_service';
import '~/boards/stores/boards_store';
import './mock_data';
......@@ -14,8 +14,6 @@ describe('Milestone select component', () => {
let vm;
beforeEach(() => {
const MilestoneComp = Vue.extend(milestoneSelect);
Vue.http.interceptors.push(boardsMockInterceptor);
gl.boardService = mockBoardService();
gl.issueBoards.BoardsStore.create();
......@@ -24,7 +22,7 @@ describe('Milestone select component', () => {
vm.board.milestone_id = milestone.id;
});
vm = new MilestoneComp({
vm = new MilestoneSelect({
propsData: {
board: boardObj,
milestonePath: '/test/issue-boards/milestones.json',
......
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