Commit d867b9a7 authored by Simon Knox's avatar Simon Knox

fix lints

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