Commit 8f12a30e authored by Jan Provaznik's avatar Jan Provaznik

Merge branch '210528-fix-broken-links-in-some-instance-level-integrations' into 'master'

Fix broken links in some Instance-level integrations

See merge request gitlab-org/gitlab!27298
parents b9e0a07a 3e0cc178
......@@ -74,7 +74,7 @@ module ServicesHelper
def scoped_integration_path(integration)
if @project.present?
project_settings_integration_path(@project, integration)
project_service_path(@project, integration)
elsif @group.present?
group_settings_integration_path(@group, integration)
else
......
......@@ -15,6 +15,8 @@ class AlertsService < Service
before_validation :ensure_token, if: :activated?
def url
return if instance? || template?
url_helpers.project_alerts_notify_url(project, format: :json)
end
......
......@@ -10,7 +10,7 @@
- if @service.respond_to?(:detailed_description)
%p= @service.detailed_description
.col-lg-9
= form_for(@service, as: :service, url: project_service_path(@project, @service.to_param), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'can-test' => @service.can_test?, 'test-url' => test_project_service_path(@project, @service) } }) do |form|
= form_for(@service, as: :service, url: scoped_integration_path(@service), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'can-test' => @service.can_test?, 'test-url' => test_project_service_path(@project, @service) } }) do |form|
= render 'shared/service_settings', form: form, service: @service
- if @service.editable?
.footer-block.row-content-block
......
.js-alerts-service-settings{ data: { activated: @service.activated?.to_s,
form_path: project_service_path(@project, @service.to_param),
authorization_key: @service.token, url: @service.url, learn_more_url: 'https://docs.gitlab.com/ee/user/project/integrations/generic_alerts.html' } }
form_path: scoped_integration_path(@service),
authorization_key: @service.token, url: @service.url || _('<namespace / project>'), learn_more_url: 'https://docs.gitlab.com/ee/user/project/integrations/generic_alerts.html' } }
- run_actions_text = s_("ProjectService|Perform common operations on GitLab project: %{project_name}") % { project_name: @project.full_name }
- pretty_name = @project&.full_name || _('<project name>')
- run_actions_text = s_("ProjectService|Perform common operations on GitLab project: %{project_name}") % { project_name: pretty_name }
%p= s_("ProjectService|To set up this service:")
%ul.list-unstyled.indent-list
......@@ -20,7 +21,7 @@
.form-group
= label_tag :display_name, _('Display name'), class: 'col-12 col-form-label label-bold'
.col-12.input-group
= text_field_tag :display_name, "GitLab / #{@project.full_name}", class: 'form-control form-control-sm', readonly: 'readonly'
= text_field_tag :display_name, "GitLab / #{pretty_name}", class: 'form-control form-control-sm', readonly: 'readonly'
.input-group-append
= clipboard_button(target: '#display_name', class: 'input-group-text')
......@@ -38,8 +39,9 @@
%p
= s_('MattermostService|Suggestions:')
%code= 'gitlab'
%code= @project.path # Path contains no spaces, but dashes
%code= @project.full_path
- if @project
%code= @project.path # Path contains no spaces, but dashes
%code= @project.full_path
.form-group
= label_tag :request_url, s_('MattermostService|Request URL'), class: 'col-12 col-form-label label-bold'
......
- pretty_name = defined?(@project) ? @project.full_name : 'namespace / path'
- run_actions_text = "Perform common operations on GitLab project: #{pretty_name}"
- pretty_name = @project&.full_name || _('<project name>')
- run_actions_text = s_("ProjectService|Perform common operations on GitLab project: %{project_name}") % { project_name: pretty_name }
.info-well
.well-segment
......@@ -31,8 +31,10 @@
%p
= _("Suggestions:")
%code= 'gitlab'
%code= @project.path # Path contains no spaces, but dashes
%code= @project.full_path
%code= 'project'
- if @project
%code= @project.path # Path contains no spaces, but dashes
%code= @project.full_path
.form-group
= label_tag :url, 'URL', class: 'col-12 col-form-label label-bold'
......
......@@ -9,5 +9,5 @@
See the list of available commands in Slack after setting up this service
by entering
%kbd.inline /gitlab help
- unless @service.template?
- unless @service.template? || @service.instance?
= render "projects/services/#{@service.to_param}/slack_integration_form"
......@@ -788,12 +788,18 @@ msgstr ""
msgid "<code>\"johnsmith@example.com\": \"johnsmith@example.com\"</code> will add \"By <a href=\"#\">johnsmith@example.com</a>\" to all issues and comments originally created by johnsmith@example.com. By default, the email address or username is masked to ensure the user's privacy. Use this option if you want to show the full email address."
msgstr ""
msgid "<namespace / project>"
msgstr ""
msgid "<no name set>"
msgstr ""
msgid "<no scopes selected>"
msgstr ""
msgid "<project name>"
msgstr ""
msgid "<strong>%{group_name}</strong> group members"
msgstr ""
......
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