Merge branch 'fix-help-paths' into 'master'
Fix help page paths to make sure shortcuts and the UI help page work. Add a test to make sure the help page UI path doesn't break in the future. Fixes #19972 and #19889. cc: @dzaporozhets @rspeicher @lbennett See merge request !5350
This commit is contained in:
commit
1d7ac1641e
|
@ -89,11 +89,10 @@ Rails.application.routes.draw do
|
||||||
mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\/(info\/lfs|gitlab-lfs)/.match(request.path_info) }, via: [:get, :post, :put]
|
mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\/(info\/lfs|gitlab-lfs)/.match(request.path_info) }, via: [:get, :post, :put]
|
||||||
|
|
||||||
# Help
|
# Help
|
||||||
|
get 'help' => 'help#index'
|
||||||
get 'help' => 'help#index'
|
get 'help/shortcuts' => 'help#shortcuts'
|
||||||
get 'help/*path' => 'help#show', as: :help_page
|
get 'help/ui' => 'help#ui'
|
||||||
get 'help/shortcuts'
|
get 'help/*path' => 'help#show', as: :help_page
|
||||||
get 'help/ui' => 'help#ui'
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Global snippets
|
# Global snippets
|
||||||
|
|
|
@ -5,7 +5,7 @@ module Gitlab
|
||||||
gon.default_avatar_url = URI::join(Gitlab.config.gitlab.url, ActionController::Base.helpers.image_path('no_avatar.png')).to_s
|
gon.default_avatar_url = URI::join(Gitlab.config.gitlab.url, ActionController::Base.helpers.image_path('no_avatar.png')).to_s
|
||||||
gon.max_file_size = current_application_settings.max_attachment_size
|
gon.max_file_size = current_application_settings.max_attachment_size
|
||||||
gon.relative_url_root = Gitlab.config.gitlab.relative_url_root
|
gon.relative_url_root = Gitlab.config.gitlab.relative_url_root
|
||||||
gon.shortcuts_path = help_shortcuts_path
|
gon.shortcuts_path = help_page_path('shortcuts')
|
||||||
gon.user_color_scheme = Gitlab::ColorSchemes.for_user(current_user).css_class
|
gon.user_color_scheme = Gitlab::ColorSchemes.for_user(current_user).css_class
|
||||||
gon.award_menu_url = emojis_path
|
gon.award_menu_url = emojis_path
|
||||||
|
|
||||||
|
|
|
@ -63,4 +63,13 @@ describe HelpController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'GET #ui' do
|
||||||
|
context 'for UI Development Kit' do
|
||||||
|
it 'renders found' do
|
||||||
|
get :ui
|
||||||
|
expect(response).to have_http_status(200)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -116,12 +116,9 @@ describe HelpController, "routing" do
|
||||||
expect(get(path)).to route_to('help#show',
|
expect(get(path)).to route_to('help#show',
|
||||||
path: 'workflow/protected_branches/protected_branches1',
|
path: 'workflow/protected_branches/protected_branches1',
|
||||||
format: 'png')
|
format: 'png')
|
||||||
path = '/help/shortcuts'
|
|
||||||
expect(get(path)).to route_to('help#show',
|
|
||||||
path: 'shortcuts')
|
|
||||||
path = '/help/ui'
|
path = '/help/ui'
|
||||||
expect(get(path)).to route_to('help#show',
|
expect(get(path)).to route_to('help#ui')
|
||||||
path: 'ui')
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue