summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-07-05 19:15:27 +0000
committerRobert Speicher <robert@gitlab.com>2018-07-05 19:15:27 +0000
commitdc6c89ccab29603c12d254ee8be5009ce8f94729 (patch)
treea2238577cfabd7c3f75180757aae1a358195b8ab
parent48d1f3d6195eb620c74efb2fd4057b419961cb10 (diff)
parent471c2ee9bcc095cff21ff15c3cffa8eae5548522 (diff)
downloadgitlab-ce-dc6c89ccab29603c12d254ee8be5009ce8f94729.tar.gz
Merge branch 'ce-6145-unify-issuable-search-bar' into 'master'
CE: Unify app/views/shared/issuable/_search_bar.html.haml See merge request gitlab-org/gitlab-ce!20266
-rw-r--r--app/models/board.rb4
-rw-r--r--app/views/shared/boards/_show.html.haml7
-rw-r--r--app/views/shared/issuable/_search_bar.html.haml14
3 files changed, 20 insertions, 5 deletions
diff --git a/app/models/board.rb b/app/models/board.rb
index 3cede6fc99a..bb6bb753daf 100644
--- a/app/models/board.rb
+++ b/app/models/board.rb
@@ -26,4 +26,8 @@ class Board < ActiveRecord::Base
def closed_list
lists.merge(List.closed).take
end
+
+ def scoped?
+ false
+ end
end
diff --git a/app/views/shared/boards/_show.html.haml b/app/views/shared/boards/_show.html.haml
index a88d8f61fb4..28e6fe1b16d 100644
--- a/app/views/shared/boards/_show.html.haml
+++ b/app/views/shared/boards/_show.html.haml
@@ -2,8 +2,8 @@
- group = local_assigns.fetch(:group, false)
- @no_breadcrumb_container = true
- @no_container = true
-- @content_class = "issue-boards-content"
-- breadcrumb_title _("Issue Board")
+- @content_class = "issue-boards-content js-focus-mode-board"
+- breadcrumb_title _("Issue Boards")
- page_title _("Boards")
- content_for :page_specific_javascripts do
@@ -11,10 +11,11 @@
-# haml-lint:disable InlineJavaScript
%script#js-board-template{ type: "text/x-template" }= render "shared/boards/components/board"
%script#js-board-modal-filter{ type: "text/x-template" }= render "shared/issuable/search_bar", type: :boards_modal
+ %script#js-board-promotion{ type: "text/x-template" }= render_if_exists "shared/promotions/promote_issue_board"
#board-app.boards-app{ "v-cloak" => true, data: board_data, ":class" => "{ 'is-compact': detailIssueVisible }" }
.d-none.d-sm-none.d-md-block
- = render 'shared/issuable/search_bar', type: :boards
+ = render 'shared/issuable/search_bar', type: :boards, board: board
.boards-list
.boards-app-loading.text-center{ "v-if" => "loading" }
diff --git a/app/views/shared/issuable/_search_bar.html.haml b/app/views/shared/issuable/_search_bar.html.haml
index ef9ea2194ee..9ce7f6fe269 100644
--- a/app/views/shared/issuable/_search_bar.html.haml
+++ b/app/views/shared/issuable/_search_bar.html.haml
@@ -1,9 +1,14 @@
- type = local_assigns.fetch(:type)
+- board = local_assigns.fetch(:board, nil)
- block_css_class = type != :boards_modal ? 'row-content-block second-block' : ''
- full_path = @project.present? ? @project.full_path : @group.full_path
+- user_can_admin_list = board && can?(current_user, :admin_list, board.parent)
.issues-filters
.issues-details-filters.filtered-search-block{ class: block_css_class, "v-pre" => type == :boards_modal }
+ - if type == :boards
+ #js-multiple-boards-switcher.inline.boards-switcher{ "v-cloak" => true }
+ = render_if_exists "shared/boards/switcher", board: board
= form_tag page_filter_path(without: [:assignee_id, :author_id, :milestone_title, :label_name, :search]), method: :get, class: 'filter-form js-filter-form' do
- if params[:search].present?
= hidden_field_tag :search, params[:search]
@@ -99,13 +104,18 @@
%gl-emoji
%span.js-data-value.prepend-left-10
{{name}}
+
+ = render_if_exists 'shared/issuable/filter_weight', type: type
+
%button.clear-search.hidden{ type: 'button' }
= icon('times')
.filter-dropdown-container
- if type == :boards
- - if can?(current_user, :admin_list, board.parent)
- = render_if_exists 'shared/issuable/board_create_list_dropdown', board: board
+ .js-board-config{ data: { can_admin_list: user_can_admin_list, has_scope: board.scoped? } }
+ - if user_can_admin_list
+ = render 'shared/issuable/board_create_list_dropdown', board: board
- if @project
#js-add-issues-btn.prepend-left-10{ data: { can_admin_list: can?(current_user, :admin_list, @project) } }
+ #js-toggle-focus-btn
- elsif type != :boards_modal
= render 'shared/sort_dropdown'