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

Added content to milestone dropdown

Changes toggle text on milestone change
parent 6bfb7b3a
...@@ -96,13 +96,18 @@ require('./board_new_form'); ...@@ -96,13 +96,18 @@ require('./board_new_form');
}, },
updateMilestoneFilterDropdown() { updateMilestoneFilterDropdown() {
const $milestoneDropdown = $('.dropdown-menu-milestone'); const $milestoneDropdown = $('.dropdown-menu-milestone');
const hideElements = this.board.milestone_id === undefined; const hideElements = this.board.milestone_id === null;
console.log(hideElements, this.board.milestone_id);
$milestoneDropdown.find('.dropdown-input').toggle(hideElements); $milestoneDropdown.find('.dropdown-input, .dropdown-footer-list')
$milestoneDropdown.find('.dropdown-footer').toggle(hideElements); .toggle(hideElements);
$milestoneDropdown.find('.js-milestone-footer-content').toggle(!hideElements);
$milestoneDropdown.find('.dropdown-content li') $milestoneDropdown.find('.dropdown-content li')
.filter((i, el) => $(el).find('.is-active').length === 0) .filter((i, el) => $(el).find('.is-active').length === 0)
.toggle(hideElements); .toggle(hideElements);
$('.js-milestone-select .dropdown-toggle-text')
.text(hideElements ? 'Milestone' : this.board.milestone.title);
}, },
}, },
created() { created() {
......
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
vue: $dropdown.hasClass('js-issue-board-sidebar'), vue: $dropdown.hasClass('js-issue-board-sidebar'),
hideRow: function(milestone) { hideRow: function(milestone) {
if ($('html').hasClass('issue-boards-page') && !$dropdown.hasClass('js-issue-board-sidebar') && if ($('html').hasClass('issue-boards-page') && !$dropdown.hasClass('js-issue-board-sidebar') &&
!$dropdown.closest('.add-issues-modal').length && gl.issueBoards.BoardsStore.state.currentBoard.milestone.title) { !$dropdown.closest('.add-issues-modal').length && gl.issueBoards.BoardsStore.state.currentBoard.milestone_id) {
return milestone !== gl.issueBoards.BoardsStore.state.currentBoard.milestone.title; return milestone !== gl.issueBoards.BoardsStore.state.currentBoard.milestone.title;
} }
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
}, },
isSelectable: function() { isSelectable: function() {
if ($('html').hasClass('issue-boards-page') && !$dropdown.hasClass('js-issue-board-sidebar') && if ($('html').hasClass('issue-boards-page') && !$dropdown.hasClass('js-issue-board-sidebar') &&
!$dropdown.closest('.add-issues-modal').length && gl.issueBoards.BoardsStore.state.currentBoard.milestone.title) { !$dropdown.closest('.add-issues-modal').length && gl.issueBoards.BoardsStore.state.currentBoard.milestone_id) {
return false; return false;
} }
......
...@@ -576,3 +576,9 @@ ...@@ -576,3 +576,9 @@
min-width: 100%; min-width: 100%;
} }
} }
.board-milestone-footer-content {
padding-left: 12px;
padding-right: 12px;
color: $gl-gray-dark;
}
...@@ -26,3 +26,7 @@ ...@@ -26,3 +26,7 @@
Manage milestones Manage milestones
- else - else
View milestones View milestones
- if board
%p.board-milestone-footer-content.js-milestone-footer-content{ style: "display: none;" }
This board's milestone has been set in its configuration.
Edit this value under the board menu.
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