Commit 2da77592 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Apply new search bar on issues and merge request dashboards

parent 12397018
import projectSelect from '~/project_select'; import projectSelect from '~/project_select';
import initLegacyFilters from '~/init_legacy_filters'; import initFilteredSearch from '~/pages/search/init_filtered_search';
import IssuableFilteredSearchTokenKeys from '~/filtered_search/issuable_filtered_search_token_keys';
import { FILTERED_SEARCH } from '~/pages/constants';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
initFilteredSearch({
page: FILTERED_SEARCH.ISSUES,
filteredSearchTokenKeys: IssuableFilteredSearchTokenKeys,
});
projectSelect(); projectSelect();
initLegacyFilters();
}); });
import projectSelect from '~/project_select'; import projectSelect from '~/project_select';
import initLegacyFilters from '~/init_legacy_filters'; import initFilteredSearch from '~/pages/search/init_filtered_search';
import IssuableFilteredSearchTokenKeys from '~/filtered_search/issuable_filtered_search_token_keys';
import { FILTERED_SEARCH } from '~/pages/constants';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
initFilteredSearch({
page: FILTERED_SEARCH.ISSUES,
filteredSearchTokenKeys: IssuableFilteredSearchTokenKeys,
});
projectSelect(); projectSelect();
initLegacyFilters();
}); });
...@@ -5,10 +5,11 @@ class DashboardController < Dashboard::ApplicationController ...@@ -5,10 +5,11 @@ class DashboardController < Dashboard::ApplicationController
include MergeRequestsAction include MergeRequestsAction
FILTER_PARAMS = [ FILTER_PARAMS = [
:author_id, :author_username,
:assignee_id, :assignee_username,
:milestone_title, :milestone_title,
:label_name :label_name,
:my_reaction_emoji
].freeze ].freeze
before_action :event_filter, only: :activity before_action :event_filter, only: :activity
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
module DashboardHelper module DashboardHelper
def assigned_issues_dashboard_path def assigned_issues_dashboard_path
issues_dashboard_path(assignee_id: current_user.id) issues_dashboard_path(assignee_username: current_user.username)
end end
def assigned_mrs_dashboard_path def assigned_mrs_dashboard_path
merge_requests_dashboard_path(assignee_id: current_user.id) merge_requests_dashboard_path(assignee_username: current_user.username)
end end
def dashboard_nav_links def dashboard_nav_links
......
...@@ -163,10 +163,11 @@ module SearchHelper ...@@ -163,10 +163,11 @@ module SearchHelper
if @project.present? if @project.present?
opts[:data]['project-id'] = @project.id opts[:data]['project-id'] = @project.id
opts[:data]['base-endpoint'] = project_path(@project) opts[:data]['base-endpoint'] = project_path(@project)
else elsif @group.present?
# Group context
opts[:data]['group-id'] = @group.id opts[:data]['group-id'] = @group.id
opts[:data]['base-endpoint'] = group_canonical_path(@group) opts[:data]['base-endpoint'] = group_canonical_path(@group)
else
opts[:data]['base-endpoint'] = root_dashboard_path
end end
opts opts
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
.nav-controls .nav-controls
= render 'shared/issuable/feed_buttons' = render 'shared/issuable/feed_buttons'
= render 'shared/issuable/filter', type: :issues = render 'shared/issuable/search_bar', type: :issues
- if current_user && @no_filters_set - if current_user && @no_filters_set
= render 'shared/dashboard/no_filter_selected' = render 'shared/dashboard/no_filter_selected'
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
.top-area .top-area
= render 'shared/issuable/nav', type: :merge_requests, display_count: !@no_filters_set = render 'shared/issuable/nav', type: :merge_requests, display_count: !@no_filters_set
= render 'shared/issuable/filter', type: :merge_requests = render 'shared/issuable/search_bar', type: :merge_requests
- if current_user && @no_filters_set - if current_user && @no_filters_set
= render 'shared/dashboard/no_filter_selected' = render 'shared/dashboard/no_filter_selected'
......
- type = local_assigns.fetch(:type) - type = local_assigns.fetch(:type)
- board = local_assigns.fetch(:board, nil) - board = local_assigns.fetch(:board, nil)
- block_css_class = type != :boards_modal ? 'row-content-block second-block' : '' - block_css_class = type != :boards_modal ? 'row-content-block second-block' : ''
- full_path = @project.present? ? @project.full_path : @group.full_path - full_path = if @project.present? then @project.full_path elsif @group.present? then @group.full_path else request.path end
- user_can_admin_list = board && can?(current_user, :admin_list, board.parent) - user_can_admin_list = board && can?(current_user, :admin_list, board.parent)
- show_sorting_dropdown = local_assigns.fetch(:show_sorting_dropdown, true) - show_sorting_dropdown = local_assigns.fetch(:show_sorting_dropdown, true)
......
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