Commit 4006d534 authored by Tom Quirk's avatar Tom Quirk

Move `detailed_description` to `help`

Changes apply only to confluence and github.

Changing this content to `help` means that the UI
is consistent with all other integrations (the
`help` content is displayed in the right-hand
column of the integration setup form)

Also, Ensures that Confluence and Github's "help"
doesn't interfere when trying to figure them at the
group or instance level.
parent 61f46c69
......@@ -30,8 +30,8 @@ class ConfluenceService < Service
s_('ConfluenceService|Connect a Confluence Cloud Workspace to GitLab')
end
def detailed_description
return unless project.wiki_enabled?
def help
return unless project && project.wiki_enabled?
if activated?
wiki_url = project.wiki.web_url
......
......@@ -4,7 +4,7 @@
- if @default_integration
.js-vue-default-integration-settings{ data: integration_form_data(@default_integration, group: @group) }
.js-vue-integration-settings{ data: integration_form_data(integration, group: @group) }
.js-integration-help-html
.js-integration-help-html.gl-display-none
-# All content below will be repositioned in Vue
- if lookup_context.template_exists?('help', "projects/services/#{integration.to_param}", true)
= render "projects/services/#{integration.to_param}/help", subject: integration
......
---
title: Move integration inheritance override dropdown above grid layout
merge_request: 49325
author:
type: changed
......@@ -26,10 +26,11 @@ class GithubService < Service
"See pipeline statuses on GitHub for your commits and pull requests"
end
def detailed_description
mirror_path = project_settings_repository_path(project)
mirror_link = link_to('mirroring your GitHub repository', mirror_path)
"This requires #{mirror_link} to this project.".html_safe
def help
return unless project
docs_link = link_to _('Learn more'), help_page_url('user/project/repository/repository_mirroring')
s_("Integrations|This requires mirroring your GitHub repository to this project. %{docs_link}" % { docs_link: docs_link }).html_safe
end
def self.to_param
......
......@@ -70,9 +70,9 @@ RSpec.describe GithubService do
end
end
describe '#detailed_description' do
describe '#help' do
it 'links to mirroring settings' do
expect(subject.detailed_description).to match(/href=.*mirroring/)
expect(subject.help).to match(/href=.*mirroring/)
end
end
......
......@@ -15898,6 +15898,9 @@ msgstr ""
msgid "Integrations|This integration, and inheriting projects were reset."
msgstr ""
msgid "Integrations|This requires mirroring your GitHub repository to this project. %{docs_link}"
msgstr ""
msgid "Integrations|To keep this project going, create a new issue."
msgstr ""
......
......@@ -43,13 +43,13 @@ RSpec.describe ConfluenceService do
end
end
describe '#detailed_description' do
describe '#help' do
it 'can correctly return a link to the project wiki when active' do
project = create(:project)
subject.project = project
subject.active = true
expect(subject.detailed_description).to include(Gitlab::Routing.url_helpers.project_wikis_url(project))
expect(subject.help).to include(Gitlab::Routing.url_helpers.project_wikis_url(project))
end
context 'when the project wiki is not enabled' do
......@@ -60,7 +60,7 @@ RSpec.describe ConfluenceService do
[true, false].each do |active|
subject.active = active
expect(subject.detailed_description).to be_nil
expect(subject.help).to be_nil
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