Commit 024a0b83 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'master' into 42568-pipeline-empty-state

* master:
  Fix provider server URL used when listing repos to import
  Fix inconsistent punctuation on MR form
  Update dependency for svgs
  Fix timestamp to include %M instead of %I for post-deploy migrations.
parents c7776a1d 51f91537
module ImportHelper
include ::Gitlab::Utils::StrongMemoize
def has_ci_cd_only_params?
false
end
......@@ -75,17 +77,18 @@ module ImportHelper
private
def github_project_url(full_path)
"#{github_root_url}/#{full_path}"
URI.join(github_root_url, full_path).to_s
end
def github_root_url
return @github_url if defined?(@github_url)
strong_memoize(:github_url) do
provider = Gitlab::Auth::OAuth::Provider.config_for('github')
provider = Gitlab.config.omniauth.providers.find { |p| p.name == 'github' }
@github_url = provider.fetch('url', 'https://github.com') if provider
provider&.dig('url').presence || 'https://github.com'
end
end
def gitea_project_url(full_path)
"#{@gitea_host_url.sub(%r{/+\z}, '')}/#{full_path}"
URI.join(@gitea_host_url, full_path).to_s
end
end
......@@ -14,7 +14,7 @@
.checkbox
= form.label :allow_maintainer_to_push do
= form.check_box :allow_maintainer_to_push, disabled: !issuable.can_allow_maintainer_to_push?(current_user)
= _('Allow edits from maintainers')
= _('Allow edits from maintainers.')
= link_to 'About this feature', help_page_path('user/project/merge_requests/maintainer_access')
.help-block
= allow_maintainer_push_unavailable_reason(issuable)
---
title: Fix generated URL when listing repoitories for import
merge_request: 17692
author:
type: fixed
......@@ -3,7 +3,7 @@ require 'rails/generators'
module Rails
class PostDeploymentMigrationGenerator < Rails::Generators::NamedBase
def create_migration_file
timestamp = Time.now.strftime('%Y%m%d%H%I%S')
timestamp = Time.now.strftime('%Y%m%d%H%M%S')
template "migration.rb", "db/post_migrate/#{timestamp}_#{file_name}.rb"
end
......
......@@ -4,7 +4,7 @@ module Gitlab
class Config
class << self
def options
Gitlab.config.omniauth.providers.find { |provider| provider.name == 'saml' }
Gitlab::Auth::OAuth::Provider.config_for('saml')
end
def groups
......
......@@ -197,10 +197,7 @@ module Gitlab
end
def github_omniauth_provider
@github_omniauth_provider ||=
Gitlab.config.omniauth.providers
.find { |provider| provider.name == 'github' }
.to_h
@github_omniauth_provider ||= Gitlab::Auth::OAuth::Provider.config_for('github').to_h
end
def rate_limit_counter
......
......@@ -72,7 +72,7 @@ module Gitlab
end
def config
Gitlab.config.omniauth.providers.find {|provider| provider.name == "gitlab"}
Gitlab::Auth::OAuth::Provider.config_for('gitlab')
end
def gitlab_options
......
......@@ -83,7 +83,7 @@ module Gitlab
end
def config
Gitlab.config.omniauth.providers.find { |provider| provider.name == "github" }
Gitlab::Auth::OAuth::Provider.config_for('github')
end
def github_options
......
......@@ -32,7 +32,7 @@ module GoogleApi
private
def config
Gitlab.config.omniauth.providers.find { |provider| provider.name == "google_oauth2" }
Gitlab::Auth::OAuth::Provider.config_for('google_oauth2')
end
def client
......
......@@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gitlab 1.0.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-06 17:36+0100\n"
"PO-Revision-Date: 2018-03-06 17:36+0100\n"
"POT-Creation-Date: 2018-03-12 19:50+0100\n"
"PO-Revision-Date: 2018-03-12 19:50+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
......@@ -28,6 +28,11 @@ msgid_plural "%d commits behind"
msgstr[0] ""
msgstr[1] ""
msgid "%d exporter"
msgid_plural "%d exporters"
msgstr[0] ""
msgstr[1] ""
msgid "%d issue"
msgid_plural "%d issues"
msgstr[0] ""
......@@ -43,6 +48,11 @@ msgid_plural "%d merge requests"
msgstr[0] ""
msgstr[1] ""
msgid "%d metric"
msgid_plural "%d metrics"
msgstr[0] ""
msgstr[1] ""
msgid "%s additional commit has been omitted to prevent performance issues."
msgid_plural "%s additional commits have been omitted to prevent performance issues."
msgstr[0] ""
......@@ -102,6 +112,9 @@ msgstr ""
msgid "2FA enabled"
msgstr ""
msgid "<strong>Removes</strong> source branch"
msgstr ""
msgid "A collection of graphs regarding Continuous Integration"
msgstr ""
......@@ -111,6 +124,9 @@ msgstr ""
msgid "A project is where you house your files (repository), plan your work (issues), and publish your documentation (wiki), %{among_other_things_link}."
msgstr ""
msgid "A user with write access to the source branch selected this option"
msgstr ""
msgid "About auto deploy"
msgstr ""
......@@ -213,7 +229,7 @@ msgstr ""
msgid "All features are enabled for blank projects, from templates, or when importing, but you can disable them afterward in the project settings."
msgstr ""
msgid "Allow edits from maintainers"
msgid "Allow edits from maintainers."
msgstr ""
msgid "Allows you to add and manage Kubernetes clusters."
......@@ -857,6 +873,9 @@ msgstr ""
msgid "ClusterIntegration|Learn more about environments"
msgstr ""
msgid "ClusterIntegration|Learn more about security configuration"
msgstr ""
msgid "ClusterIntegration|Machine type"
msgstr ""
......@@ -914,6 +933,9 @@ msgstr ""
msgid "ClusterIntegration|Save changes"
msgstr ""
msgid "ClusterIntegration|Security"
msgstr ""
msgid "ClusterIntegration|See and edit the details for your Kubernetes cluster"
msgstr ""
......@@ -941,6 +963,9 @@ msgstr ""
msgid "ClusterIntegration|Something went wrong while installing %{title}"
msgstr ""
msgid "ClusterIntegration|The default cluster configuration grants access to a wide set of functionalities needed to successfully build and deploy a containerised application."
msgstr ""
msgid "ClusterIntegration|This account must have permissions to create a Kubernetes cluster in the %{link_to_container_project} specified below"
msgstr ""
......@@ -1182,6 +1207,9 @@ msgstr ""
msgid "Create empty bare repository"
msgstr ""
msgid "Create group label"
msgstr ""
msgid "Create lists from labels. Issues with that label appear in that list."
msgstr ""
......@@ -1197,6 +1225,9 @@ msgstr ""
msgid "Create new..."
msgstr ""
msgid "Create project label"
msgstr ""
msgid "CreateNewFork|Fork"
msgstr ""
......@@ -1776,9 +1807,18 @@ msgstr ""
msgid "Labels"
msgstr ""
msgid "Labels can be applied to %{features}. Group labels are available for any project within the group."
msgstr ""
msgid "Labels can be applied to issues and merge requests to categorize them."
msgstr ""
msgid "Labels|Promote Label"
msgstr ""
msgid "Labels|Promote label %{labelTitle} to Group Label?"
msgstr ""
msgid "Last %d day"
msgid_plural "Last %d days"
msgstr[0] ""
......@@ -1850,9 +1890,15 @@ msgstr ""
msgid "Login"
msgstr ""
msgid "Manage group labels"
msgstr ""
msgid "Manage labels"
msgstr ""
msgid "Manage project labels"
msgstr ""
msgid "Mar"
msgstr ""
......@@ -1907,6 +1953,12 @@ msgstr ""
msgid "Milestones|Milestone %{milestoneTitle} was not found"
msgstr ""
msgid "Milestones|Promote %{milestoneTitle} to group milestone?"
msgstr ""
msgid "Milestones|Promote Milestone"
msgstr ""
msgid "MissingSSHKeyWarningLink|add an SSH key"
msgstr ""
......@@ -2002,6 +2054,9 @@ msgstr ""
msgid "No file chosen"
msgstr ""
msgid "No labels created yet."
msgstr ""
msgid "No repository"
msgstr ""
......@@ -2251,9 +2306,15 @@ msgstr ""
msgid "Pipelines|Loading Pipelines"
msgstr ""
msgid "Pipelines|Project cache successfully reset."
msgstr ""
msgid "Pipelines|Run Pipeline"
msgstr ""
msgid "Pipelines|Something went wrong while cleaning runners cache."
msgstr ""
msgid "Pipelines|There are currently no %{scope} pipelines."
msgstr ""
......@@ -2380,9 +2441,6 @@ msgstr ""
msgid "Project avatar in repository: %{link}"
msgstr ""
msgid "Project cache successfully reset."
msgstr ""
msgid "Project details"
msgstr ""
......@@ -2446,6 +2504,12 @@ msgstr ""
msgid "ProjectsDropdown|This feature requires browser localStorage support"
msgstr ""
msgid "PrometheusService|%{exporters} with %{metrics} were found"
msgstr ""
msgid "PrometheusService|<p class=\"text-tertiary\">No <a href=\"%{docsUrl}\">common metrics</a> were found</p>"
msgstr ""
msgid "PrometheusService|Active"
msgstr ""
......@@ -2458,6 +2522,9 @@ msgstr ""
msgid "PrometheusService|By default, Prometheus listens on ‘http://localhost:9090’. It’s not recommended to change the default address and port as this might affect or conflict with other services running on the GitLab server."
msgstr ""
msgid "PrometheusService|Common metrics"
msgstr ""
msgid "PrometheusService|Finding and configuring metrics..."
msgstr ""
......@@ -2479,15 +2546,9 @@ msgstr ""
msgid "PrometheusService|Missing environment variable"
msgstr ""
msgid "PrometheusService|Monitored"
msgstr ""
msgid "PrometheusService|More information"
msgstr ""
msgid "PrometheusService|No metrics are being monitored. To start monitoring, deploy to an environment."
msgstr ""
msgid "PrometheusService|Prometheus API Base URL, like http://prometheus.example.com/"
msgstr ""
......@@ -2503,7 +2564,16 @@ msgstr ""
msgid "PrometheusService|To enable the installation of Prometheus on your clusters, deactivate the manual configuration below"
msgstr ""
msgid "PrometheusService|View environments"
msgid "PrometheusService|Waiting for your first deployment to an environment to find common metrics"
msgstr ""
msgid "Promote"
msgstr ""
msgid "Promote to Group Label"
msgstr ""
msgid "Promote to Group Milestone"
msgstr ""
msgid "Protip:"
......@@ -2515,9 +2585,6 @@ msgstr ""
msgid "Public - The project can be accessed without any authentication."
msgstr ""
msgid "Push access to this project is necessary in order to enable this option"
msgstr ""
msgid "Push events"
msgstr ""
......@@ -3338,9 +3405,6 @@ msgstr ""
msgid "Trigger this manual action"
msgstr ""
msgid "Unable to reset project cache."
msgstr ""
msgid "Unlock"
msgstr ""
......@@ -3383,12 +3447,18 @@ msgstr ""
msgid "View file @ "
msgstr ""
msgid "View group labels"
msgstr ""
msgid "View labels"
msgstr ""
msgid "View open merge request"
msgstr ""
msgid "View project labels"
msgstr ""
msgid "View replaced file @ "
msgstr ""
......
......@@ -12,7 +12,7 @@
"webpack-prod": "NODE_ENV=production webpack --config config/webpack.config.js"
},
"dependencies": {
"@gitlab-org/gitlab-svgs": "^1.13.0",
"@gitlab-org/gitlab-svgs": "^1.14.0",
"autosize": "^4.0.0",
"axios": "^0.17.1",
"babel-core": "^6.26.0",
......
......@@ -27,25 +27,48 @@ describe ImportHelper do
describe '#provider_project_link' do
context 'when provider is "github"' do
let(:github_server_url) { nil }
before do
setting = Settingslogic.new('name' => 'github')
setting['url'] = github_server_url if github_server_url
allow(Gitlab.config.omniauth).to receive(:providers).and_return([setting])
end
context 'when provider does not specify a custom URL' do
it 'uses default GitHub URL' do
allow(Gitlab.config.omniauth).to receive(:providers)
.and_return([Settingslogic.new('name' => 'github')])
expect(helper.provider_project_link('github', 'octocat/Hello-World'))
.to include('href="https://github.com/octocat/Hello-World"')
end
end
context 'when provider specify a custom URL' do
let(:github_server_url) { 'https://github.company.com' }
it 'uses custom URL' do
allow(Gitlab.config.omniauth).to receive(:providers)
.and_return([Settingslogic.new('name' => 'github', 'url' => 'https://github.company.com')])
expect(helper.provider_project_link('github', 'octocat/Hello-World'))
.to include('href="https://github.company.com/octocat/Hello-World"')
end
end
context "when custom URL contains a '/' char at the end" do
let(:github_server_url) { 'https://github.company.com/' }
it "doesn't render double slash" do
expect(helper.provider_project_link('github', 'octocat/Hello-World'))
.to include('href="https://github.company.com/octocat/Hello-World"')
end
end
context 'when provider is missing' do
it 'uses the default URL' do
allow(Gitlab.config.omniauth).to receive(:providers).and_return([])
expect(helper.provider_project_link('github', 'octocat/Hello-World'))
.to include('href="https://github.com/octocat/Hello-World"')
end
end
end
context 'when provider is "gitea"' do
......
......@@ -54,9 +54,9 @@
lodash "^4.2.0"
to-fast-properties "^2.0.0"
"@gitlab-org/gitlab-svgs@^1.13.0":
version "1.13.0"
resolved "https://registry.yarnpkg.com/@gitlab-org/gitlab-svgs/-/gitlab-svgs-1.13.0.tgz#9e856ef9fa7bbe49b2dce9789187a89e11311215"
"@gitlab-org/gitlab-svgs@^1.14.0":
version "1.14.0"
resolved "https://registry.yarnpkg.com/@gitlab-org/gitlab-svgs/-/gitlab-svgs-1.14.0.tgz#b4a5cca3106f33224c5486cf674ba3b70cee727e"
"@types/jquery@^2.0.40":
version "2.0.48"
......
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