diff options
author | Heinrich Lee Yu <hleeyu@gmail.com> | 2018-10-29 06:03:43 +0300 |
---|---|---|
committer | Heinrich Lee Yu <hleeyu@gmail.com> | 2018-11-13 10:27:42 +0300 |
commit | 91f235df08a08d45ec716ddca652ccba226abb5d (patch) | |
tree | 4353850575c8c50e450a884dfc64b4701e6905b9 /app | |
parent | ee4a7811a0cdb349e4a304f01db58292ebeedbdf (diff) |
Fix tests
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/search_autocomplete.js | 9 | ||||
-rw-r--r-- | app/controllers/dashboard_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/root_controller.rb | 4 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 2 | ||||
-rw-r--r-- | app/views/dashboard/issues.html.haml | 2 | ||||
-rw-r--r-- | app/views/dashboard/merge_requests.html.haml | 2 |
6 files changed, 13 insertions, 9 deletions
diff --git a/app/assets/javascripts/search_autocomplete.js b/app/assets/javascripts/search_autocomplete.js index 17def77b2d7..0a4583b5861 100644 --- a/app/assets/javascripts/search_autocomplete.js +++ b/app/assets/javascripts/search_autocomplete.js @@ -253,7 +253,6 @@ export class SearchAutocomplete { } getCategoryContents() { - const userId = gon.current_user_id; const userName = gon.current_username; const { projectOptions, groupOptions, dashboardOptions } = gl; @@ -279,21 +278,21 @@ export class SearchAutocomplete { const issueItems = [ { text: s__('SearchAutocomplete|Issues assigned to me'), - url: `${issuesPath}/?assignee_id=${userId}`, + url: `${issuesPath}/?assignee_username=${userName}`, }, { text: s__("SearchAutocomplete|Issues I've created"), - url: `${issuesPath}/?author_id=${userId}`, + url: `${issuesPath}/?author_username=${userName}`, }, ]; const mergeRequestItems = [ { text: s__('SearchAutocomplete|Merge requests assigned to me'), - url: `${mrPath}/?assignee_id=${userId}`, + url: `${mrPath}/?assignee_username=${userName}`, }, { text: s__("SearchAutocomplete|Merge requests I've created"), - url: `${mrPath}/?author_id=${userId}`, + url: `${mrPath}/?author_username=${userName}`, }, ]; diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 714f0c0b545..5076c3da324 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -5,6 +5,9 @@ class DashboardController < Dashboard::ApplicationController include MergeRequestsAction FILTER_PARAMS = [ + # author_id and assignee_id are kept so old RSS links still work + :author_id, + :assignee_id, :author_username, :assignee_username, :milestone_title, diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb index ebf70f25bda..7b6657e1196 100644 --- a/app/controllers/root_controller.rb +++ b/app/controllers/root_controller.rb @@ -45,9 +45,9 @@ class RootController < Dashboard::ProjectsController when 'todos' redirect_to(dashboard_todos_path) when 'issues' - redirect_to(issues_dashboard_path(assignee_id: current_user.id)) + redirect_to(issues_dashboard_path(assignee_username: current_user.username)) when 'merge_requests' - redirect_to(merge_requests_dashboard_path(assignee_id: current_user.id)) + redirect_to(merge_requests_dashboard_path(assignee_username: current_user.username)) end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4f91e3e4117..2fb94de8fab 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -178,7 +178,9 @@ module ApplicationHelper scope: params[:scope], milestone_title: params[:milestone_title], assignee_id: params[:assignee_id], + assignee_username: params[:assignee_username], author_id: params[:author_id], + author_username: params[:author_username], search: params[:search], label_name: params[:label_name] } diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index ca1ad2cd691..fdd5c19d562 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -1,6 +1,6 @@ - @hide_top_links = true - page_title _("Issues") -- @breadcrumb_link = issues_dashboard_path(assignee_id: current_user.id) +- @breadcrumb_link = issues_dashboard_path(assignee_username: current_user.username) = content_for :meta_tags do = auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{current_user.name} issues") diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index 25c2dd6308e..77cfa1271df 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -1,6 +1,6 @@ - @hide_top_links = true - page_title _("Merge Requests") -- @breadcrumb_link = merge_requests_dashboard_path(assignee_id: current_user.id) +- @breadcrumb_link = merge_requests_dashboard_path(assignee_username: current_user.username) .page-title-holder %h1.page-title= _('Merge Requests') |