Commit d6cd7006 authored by Stan Hu's avatar Stan Hu

Fix broken Members link when relative URL root paths are used

Navigating to the "Members" section of a project would omit the
relative URL root path. Fix the redirection and eliminate the
need for a redirection in the first place.

Fix other redirections failing to work with relative roots
parent dfd6c3f8
Pipeline #13298904 passed with stages
in 27 minutes and 1 second
......@@ -274,7 +274,7 @@
= nav_link(path: %w[members#show], html_options: { class: "fly-out-top-item" } ) do
= link_to project_settings_members_path(@project) do
= link_to project_project_members_path(@project) do
#{ _('Members') }
title: Fix broken Members link when relative URL root paths are used
type: fixed
namespace :ci do
resource :lint, only: [:show, :create]
root to: redirect('/')
root to: redirect('')
......@@ -393,7 +393,7 @@ constraints( do
namespace :settings do
get :members, to: redirect('/%{namespace_id}/%{project_id}/project_members')
get :members, to: redirect("%{namespace_id}/%{project_id}/project_members")
resource :ci_cd, only: [:show], controller: 'ci_cd'
resource :integrations, only: [:show]
resource :repository, only: [:show], controller: :repository
......@@ -17,5 +17,5 @@ resources :snippets, concerns: :awardable do
get '/s/:username', to: redirect('/u/%{username}/snippets'),
get '/s/:username', to: redirect('u/%{username}/snippets'),
constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }
......@@ -22,17 +22,17 @@ scope(constraints: { username: Gitlab::PathRegex.root_namespace_route_regex }) d
get :contributed, as: :contributed_projects
get :snippets
get :exists
get '/', to: redirect('/%{username}'), as: nil
get '/', to: redirect('%{username}'), as: nil
# Compatibility with old routing
# TODO (dzaporozhets): remove in 10.0
get '/u/:username', to: redirect('/%{username}')
get '/u/:username', to: redirect('%{username}')
# TODO (dzaporozhets): remove in 9.0
get '/u/:username/groups', to: redirect('/users/%{username}/groups')
get '/u/:username/projects', to: redirect('/users/%{username}/projects')
get '/u/:username/snippets', to: redirect('/users/%{username}/snippets')
get '/u/:username/contributed', to: redirect('/users/%{username}/contributed')
get '/u/:username/groups', to: redirect('users/%{username}/groups')
get '/u/:username/projects', to: redirect('users/%{username}/projects')
get '/u/:username/snippets', to: redirect('users/%{username}/snippets')
get '/u/:username/contributed', to: redirect('users/%{username}/contributed')
constraints( do
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