diff options
author | Phil Hughes <me@iamphill.com> | 2016-07-29 09:43:29 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-08-17 17:12:47 +0100 |
commit | da64959bde00363d44d1742b742485853cc2c319 (patch) | |
tree | d183012427373d45db2f42a638c72ba9bb45d2f9 | |
parent | c30a9013f0e51437eb557b3f8676ac6b21513c68 (diff) | |
download | gitlab-ce-da64959bde00363d44d1742b742485853cc2c319.tar.gz |
Started new dropdown
-rw-r--r-- | app/assets/javascripts/boards/stores/boards_store.js.es6 | 7 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/boards.scss | 13 | ||||
-rw-r--r-- | app/views/shared/issuable/_filter.html.haml | 14 | ||||
-rw-r--r-- | app/views/shared/issuable/_label_page_default.html.haml | 4 |
4 files changed, 33 insertions, 5 deletions
diff --git a/app/assets/javascripts/boards/stores/boards_store.js.es6 b/app/assets/javascripts/boards/stores/boards_store.js.es6 index ae1a88db970..6e5da9ea9f0 100644 --- a/app/assets/javascripts/boards/stores/boards_store.js.es6 +++ b/app/assets/javascripts/boards/stores/boards_store.js.es6 @@ -65,8 +65,11 @@ return label.title === boardFrom.title; }); } else { - if (boardTo.label !== null) { - BoardsStore.removeIssueFromBoard(issue, boardFrom); + if (boardTo.label) { + if (boardFrom.id !== 'backlog') { + BoardsStore.removeIssueFromBoard(issue, boardFrom); + } + foundLabel = _.find(issue.labels, (label) => { return label.title === boardTo.title; }); diff --git a/app/assets/stylesheets/pages/boards.scss b/app/assets/stylesheets/pages/boards.scss index 4151d34094b..5fcfd346485 100644 --- a/app/assets/stylesheets/pages/boards.scss +++ b/app/assets/stylesheets/pages/boards.scss @@ -2,6 +2,19 @@ display: none; } +.dropdown-menu-issues-board-new { + width: 320px; +} + +.issue-board-dropdown-content { + padding: 0px 8px; + + > p { + margin: 0; + color: #9c9c9c; + } +} + .issue-boards-page { .page-with-sidebar { display: flex; diff --git a/app/views/shared/issuable/_filter.html.haml b/app/views/shared/issuable/_filter.html.haml index 2d1b899a4f7..a06679f599d 100644 --- a/app/views/shared/issuable/_filter.html.haml +++ b/app/views/shared/issuable/_filter.html.haml @@ -30,8 +30,18 @@ - if controller.controller_name != 'boards' = render 'shared/sort_dropdown' - else - %button.btn.btn-create{ type: "button" } - Create new list + .dropdown + %button.btn.btn-create{ type: "button", data: { toggle: "dropdown" } } + Create new list + .dropdown-menu.dropdown-menu-paging.dropdown-menu-align-right.dropdown-menu-issues-board-new + = dropdown_title("Create a new list") + .issue-board-dropdown-content + %p + Add a list to issue boards by selecting a label below. The list will automatically be populated with issues that have that label. To create a list for a label that doesn't exist yet, simply create the label below. + = render partial: "shared/issuable/label_page_default", locals: { show_title: false, show_footer: true, show_create: true } + - if can?(current_user, :admin_label, @project) + = render partial: "shared/issuable/label_page_create" + = dropdown_loading - if controller.controller_name == 'issues' .issues_bulk_update.hide diff --git a/app/views/shared/issuable/_label_page_default.html.haml b/app/views/shared/issuable/_label_page_default.html.haml index 4e280c371ac..47f056604e9 100644 --- a/app/views/shared/issuable/_label_page_default.html.haml +++ b/app/views/shared/issuable/_label_page_default.html.haml @@ -1,9 +1,11 @@ - title = local_assigns.fetch(:title, 'Assign labels') - show_create = local_assigns.fetch(:show_create, true) - show_footer = local_assigns.fetch(:show_footer, true) +- show_title = local_assigns.fetch(:show_title, true) - filter_placeholder = local_assigns.fetch(:filter_placeholder, 'Search labels') .dropdown-page-one - = dropdown_title(title) + - if show_title + = dropdown_title(title) = dropdown_filter(filter_placeholder) = dropdown_content - if @project && show_footer |