Commit 0caeb99a authored by Phil Hughes's avatar Phil Hughes Committed by Douglas Barbosa Alexandre

Added extra milestone to new dropdown

Defaults to any milestone on new board
parent 6978a86b
/* global Vue */ /* global Vue */
/* eslint-disable */ /* global BoardService */
const boardMilestoneSelect = require('./milestone_select'); const boardMilestoneSelect = require('./milestone_select');
const extraMilestones = require('../mixins/extra_milestones');
(() => { (() => {
window.gl = window.gl || {}; window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {}; window.gl.issueBoards = window.gl.issueBoards || {};
...@@ -19,13 +21,14 @@ const boardMilestoneSelect = require('./milestone_select'); ...@@ -19,13 +21,14 @@ const boardMilestoneSelect = require('./milestone_select');
board: { board: {
id: false, id: false,
name: '', name: '',
milestone: {}, milestone: extraMilestones[0],
milestone_id: '', milestone_id: extraMilestones[0].id,
}, },
currentBoard: Store.state.currentBoard, currentBoard: Store.state.currentBoard,
currentPage: Store.state.currentPage, currentPage: Store.state.currentPage,
milestones: [], milestones: [],
milestoneDropdownOpen: false, milestoneDropdownOpen: false,
extraMilestones,
}; };
}, },
components: { components: {
...@@ -70,7 +73,8 @@ const boardMilestoneSelect = require('./milestone_select'); ...@@ -70,7 +73,8 @@ const boardMilestoneSelect = require('./milestone_select');
this.currentBoard.milestone_id = this.board.milestone_id; this.currentBoard.milestone_id = this.board.milestone_id;
this.currentBoard.milestone = this.board.milestone; this.currentBoard.milestone = this.board.milestone;
Store.state.filters.milestone_title = this.currentBoard.milestone_id ? this.currentBoard.milestone.title : null; Store.state.filters.milestone_title = this.currentBoard.milestone_id ?
this.currentBoard.milestone.title : null;
} }
} }
......
/* global BoardService */ /* global BoardService */
/* global Vue */ /* global Vue */
module.exports = Vue.extend({ const extraMilestones = require('../mixins/extra_milestones');
module.exports = {
props: { props: {
board: { board: {
type: Object, type: Object,
...@@ -19,16 +21,7 @@ module.exports = Vue.extend({ ...@@ -19,16 +21,7 @@ module.exports = Vue.extend({
return { return {
loading: false, loading: false,
milestones: [], milestones: [],
extraMilestones: [ extraMilestones,
{
id: null,
title: 'Any Milestone',
},
{
id: -2,
title: 'Upcoming',
},
],
}; };
}, },
mounted() { mounted() {
...@@ -68,4 +61,4 @@ module.exports = Vue.extend({ ...@@ -68,4 +61,4 @@ module.exports = Vue.extend({
</ul> </ul>
</div> </div>
`, `,
}); };
module.exports = [
{
id: null,
title: 'Any Milestone',
},
{
id: -2,
title: 'Upcoming',
},
];
...@@ -20,6 +20,12 @@ ...@@ -20,6 +20,12 @@
.dropdown-menu.dropdown-menu-selectable{ "v-if" => "milestoneDropdownOpen" } .dropdown-menu.dropdown-menu-selectable{ "v-if" => "milestoneDropdownOpen" }
.dropdown-content .dropdown-content
%ul %ul
%li{ "v-for" => "milestone in extraMilestones" }
%a{ href: "#",
":class" => "{ 'is-active': milestone.id === board.milestone_id }",
"@click.stop.prevent" => "selectMilestone(milestone)" }
{{ milestone.title }}
%li.divider
%li{ "v-for" => "milestone in milestones" } %li{ "v-for" => "milestone in milestones" }
%a{ href: "#", %a{ href: "#",
":class" => "{ 'is-active': milestone.id === board.milestone_id }", ":class" => "{ 'is-active': milestone.id === board.milestone_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