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
......@@ -274,7 +274,7 @@
Members
%ul.sidebar-sub-level-items.is-fly-out-only
= 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
%strong.fly-out-top-item-name
#{ _('Members') }
......
---
title: Fix broken Members link when relative URL root paths are used
merge_request:
author:
type: fixed
namespace :ci do
resource :lint, only: [:show, :create]
root to: redirect('/')
root to: redirect('')
end
......@@ -393,7 +393,7 @@ constraints(ProjectUrlConstrainer.new) do
end
end
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
end
end
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
end
# 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')
end
constraints(UserUrlConstrainer.new) 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