Commit f1adf825 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'ce-to-ee-2018-05-22' into 'master'

CE upstream - 2018-05-22 09:40 UTC

See merge request gitlab-org/gitlab-ee!5800
parents 57c6bf60 2a192be2
10.8.0-pre 11.0.0-pre
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
= nav_link(path: 'projects#show', html_options: { class: "fly-out-top-item" } ) do = nav_link(path: 'projects#show', html_options: { class: "fly-out-top-item" } ) do
= link_to project_path(@project) do = link_to project_path(@project) do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
= _('Overview') = _('Project')
%li.divider.fly-out-top-item %li.divider.fly-out-top-item
= nav_link(path: 'projects#show') do = nav_link(path: 'projects#show') do
= link_to project_path(@project), title: _('Project details'), class: 'shortcuts-project' do = link_to project_path(@project), title: _('Project details'), class: 'shortcuts-project' do
......
---
title: Renamed 'Overview' to 'Project' in collapsed contextual navigation at a project
level
merge_request: 18996
author: Constance Okoghenun
type: fixed
---
title: Fixed bug where generated api urls didn't add the base url if set
merge_request: 19003
author:
type: fixed
...@@ -13,9 +13,14 @@ module API ...@@ -13,9 +13,14 @@ module API
def expose_url(path) def expose_url(path)
url_options = Gitlab::Application.routes.default_url_options url_options = Gitlab::Application.routes.default_url_options
protocol, host, port = url_options.slice(:protocol, :host, :port).values protocol, host, port, script_name = url_options.values_at(:protocol, :host, :port, :script_name)
URI::Generic.build(scheme: protocol, host: host, port: port, path: path).to_s # Using a blank component at the beginning of the join we ensure
# that the resulted path will start with '/'. If the resulted path
# does not start with '/', URI::Generic#build will fail
path_with_script_name = File.join('', [script_name, path].select(&:present?))
URI::Generic.build(scheme: protocol, host: host, port: port, path: path_with_script_name).to_s
end end
private private
......
...@@ -35,7 +35,7 @@ describe 'Project active tab' do ...@@ -35,7 +35,7 @@ describe 'Project active tab' do
visit project_path(project) visit project_path(project)
end end
it_behaves_like 'page has active tab', 'Overview' it_behaves_like 'page has active tab', 'Project'
it_behaves_like 'page has active sub tab', 'Details' it_behaves_like 'page has active sub tab', 'Details'
context 'on project Home/Activity' do context 'on project Home/Activity' do
...@@ -43,7 +43,7 @@ describe 'Project active tab' do ...@@ -43,7 +43,7 @@ describe 'Project active tab' do
click_tab('Activity') click_tab('Activity')
end end
it_behaves_like 'page has active tab', 'Overview' it_behaves_like 'page has active tab', 'Project'
it_behaves_like 'page has active sub tab', 'Activity' it_behaves_like 'page has active sub tab', 'Activity'
end end
end end
......
...@@ -37,7 +37,7 @@ describe 'Projects > User sees sidebar' do ...@@ -37,7 +37,7 @@ describe 'Projects > User sees sidebar' do
visit project_path(project) visit project_path(project)
within('.nav-sidebar') do within('.nav-sidebar') do
expect(page).to have_content 'Overview' expect(page).to have_content 'Project'
expect(page).to have_content 'Issues' expect(page).to have_content 'Issues'
expect(page).to have_content 'Wiki' expect(page).to have_content 'Wiki'
......
...@@ -9,9 +9,9 @@ describe API::Helpers::RelatedResourcesHelpers do ...@@ -9,9 +9,9 @@ describe API::Helpers::RelatedResourcesHelpers do
let(:path) { '/api/v4/awesome_endpoint' } let(:path) { '/api/v4/awesome_endpoint' }
subject(:url) { helpers.expose_url(path) } subject(:url) { helpers.expose_url(path) }
def stub_default_url_options(protocol: 'http', host: 'example.com', port: nil) def stub_default_url_options(protocol: 'http', host: 'example.com', port: nil, script_name: '')
expect(Gitlab::Application.routes).to receive(:default_url_options) expect(Gitlab::Application.routes).to receive(:default_url_options)
.and_return(protocol: protocol, host: host, port: port) .and_return(protocol: protocol, host: host, port: port, script_name: script_name)
end end
it 'respects the protocol if it is HTTP' do it 'respects the protocol if it is HTTP' do
...@@ -37,5 +37,17 @@ describe API::Helpers::RelatedResourcesHelpers do ...@@ -37,5 +37,17 @@ describe API::Helpers::RelatedResourcesHelpers do
is_expected.to start_with('http://example.com:8080/') is_expected.to start_with('http://example.com:8080/')
end end
it 'includes the relative_url before the path if it is set' do
stub_default_url_options(script_name: '/gitlab')
is_expected.to start_with('http://example.com/gitlab/api/v4')
end
it 'includes the path after the host' do
stub_default_url_options
is_expected.to start_with('http://example.com/api/v4')
end
end end
end end
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