Commit 6a37f6f3 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-05-22

# Conflicts:
#	config/webpack.config.js

[ci skip]
parents e012060b 67a12690
10.8.0-pre
11.0.0-pre
......@@ -19,7 +19,7 @@
= nav_link(path: 'projects#show', html_options: { class: "fly-out-top-item" } ) do
= link_to project_path(@project) do
%strong.fly-out-top-item-name
= _('Overview')
= _('Project')
%li.divider.fly-out-top-item
= nav_link(path: 'projects#show') 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
......@@ -95,12 +95,15 @@ module.exports = {
vendor: path.join(ROOT_PATH, 'vendor/assets/javascripts'),
vue$: 'vue/dist/vue.esm.js',
spec: path.join(ROOT_PATH, 'spec/javascripts'),
<<<<<<< HEAD
// EE-only
ee: path.join(ROOT_PATH, 'ee/app/assets/javascripts'),
ee_empty_states: path.join(ROOT_PATH, 'ee/app/views/shared/empty_states'),
ee_icons: path.join(ROOT_PATH, 'ee/app/views/shared/icons'),
ee_images: path.join(ROOT_PATH, 'ee/app/assets/images'),
=======
>>>>>>> upstream/master
},
},
......
......@@ -13,9 +13,14 @@ module API
def expose_url(path)
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
private
......
......@@ -35,7 +35,7 @@ describe 'Project active tab' do
visit project_path(project)
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'
context 'on project Home/Activity' do
......@@ -43,7 +43,7 @@ describe 'Project active tab' do
click_tab('Activity')
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'
end
end
......
......@@ -37,7 +37,7 @@ describe 'Projects > User sees sidebar' do
visit project_path(project)
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 'Wiki'
......
......@@ -9,9 +9,9 @@ describe API::Helpers::RelatedResourcesHelpers do
let(:path) { '/api/v4/awesome_endpoint' }
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)
.and_return(protocol: protocol, host: host, port: port)
.and_return(protocol: protocol, host: host, port: port, script_name: script_name)
end
it 'respects the protocol if it is HTTP' do
......@@ -37,5 +37,17 @@ describe API::Helpers::RelatedResourcesHelpers do
is_expected.to start_with('http://example.com:8080/')
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
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