Commit 0b9a6dc1 authored by Scott Hampton's avatar Scott Hampton

Merge branch 'reposition-integration-form-elements' into 'master'

Move integration inheritance override dropdown above grid layout

See merge request gitlab-org/gitlab!49325
parents 5a71fa07 4f6072ef
...@@ -95,10 +95,7 @@ export default { ...@@ -95,10 +95,7 @@ export default {
</script> </script>
<template> <template>
<div> <div class="gl-mb-3">
<!-- helpHtml is trusted input -->
<div v-if="helpHtml" v-safe-html:[$options.helpHtmlConfig]="helpHtml"></div>
<override-dropdown <override-dropdown
v-if="defaultState !== null" v-if="defaultState !== null"
:inherit-from-id="defaultState.id" :inherit-from-id="defaultState.id"
...@@ -107,6 +104,13 @@ export default { ...@@ -107,6 +104,13 @@ export default {
@change="setOverride" @change="setOverride"
/> />
<div class="row">
<div class="col-lg-4"></div>
<div class="col-lg-8">
<!-- helpHtml is trusted input -->
<div v-if="helpHtml" v-safe-html:[$options.helpHtmlConfig]="helpHtml"></div>
<active-checkbox v-if="propsSource.showActive" :key="`${currentKey}-active-checkbox`" /> <active-checkbox v-if="propsSource.showActive" :key="`${currentKey}-active-checkbox`" />
<jira-trigger-fields <jira-trigger-fields
v-if="isJira" v-if="isJira"
...@@ -180,7 +184,11 @@ export default { ...@@ -180,7 +184,11 @@ export default {
<reset-confirmation-modal @reset="onResetClick" /> <reset-confirmation-modal @reset="onResetClick" />
</template> </template>
<gl-button class="btn-cancel" :href="propsSource.cancelPath">{{ __('Cancel') }}</gl-button> <gl-button class="btn-cancel" :href="propsSource.cancelPath">{{
__('Cancel')
}}</gl-button>
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -30,8 +30,8 @@ class ConfluenceService < Service ...@@ -30,8 +30,8 @@ class ConfluenceService < Service
s_('ConfluenceService|Connect a Confluence Cloud Workspace to GitLab') s_('ConfluenceService|Connect a Confluence Cloud Workspace to GitLab')
end end
def detailed_description def help
return unless project.wiki_enabled? return unless project&.wiki_enabled?
if activated? if activated?
wiki_url = project.wiki.web_url wiki_url = project.wiki.web_url
......
- if lookup_context.template_exists?('top', "projects/services/#{@service.to_param}", true) - if lookup_context.template_exists?('top', "projects/services/#{@service.to_param}", true)
= render "projects/services/#{@service.to_param}/top" = render "projects/services/#{@service.to_param}/top"
.row.gl-mt-3.gl-mb-3 %h3.page-title
.col-lg-4
%h3.page-title.gl-mt-0
= @service.title = @service.title
- if @service.operating? - if @service.operating?
= sprite_icon('check', css_class: 'gl-text-green-500') = sprite_icon('check', css_class: 'gl-text-green-500')
- if @service.respond_to?(:detailed_description) = 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: { 'test-url' => test_project_service_path(@project, @service) } }) do |form|
%p= @service.detailed_description
.col-lg-8
= 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: { 'test-url' => test_project_service_path(@project, @service) } }) do |form|
= render 'shared/service_settings', form: form, integration: @service = render 'shared/service_settings', form: form, integration: @service
%input{ id: 'services_redirect_to', type: 'hidden', name: 'redirect_to', value: request.referrer } %input{ id: 'services_redirect_to', type: 'hidden', name: 'redirect_to', value: request.referrer }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
- if @default_integration - if @default_integration
.js-vue-default-integration-settings{ data: integration_form_data(@default_integration, group: @group) } .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-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 -# All content below will be repositioned in Vue
- if lookup_context.template_exists?('help', "projects/services/#{integration.to_param}", true) - if lookup_context.template_exists?('help', "projects/services/#{integration.to_param}", true)
= render "projects/services/#{integration.to_param}/help", subject: integration = render "projects/services/#{integration.to_param}/help", subject: integration
......
- integration = local_assigns.fetch(:integration) - integration = local_assigns.fetch(:integration)
.row.gl-mt-3 %h3.page-title
.col-lg-4
%h3.page-title.gl-mt-0
= integration.title = integration.title
.col-lg-8 = form_for integration, as: :service, url: scoped_integration_path(integration), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => scoped_test_integration_path(integration) } } do |form|
= form_for integration, as: :service, url: scoped_integration_path(integration), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => scoped_test_integration_path(integration) } } do |form|
= render 'shared/service_settings', form: form, integration: integration = render 'shared/service_settings', form: form, integration: integration
---
title: Move integration inheritance override dropdown above grid layout
merge_request: 49325
author:
type: changed
...@@ -26,10 +26,11 @@ class GithubService < Service ...@@ -26,10 +26,11 @@ class GithubService < Service
"See pipeline statuses on GitHub for your commits and pull requests" "See pipeline statuses on GitHub for your commits and pull requests"
end end
def detailed_description def help
mirror_path = project_settings_repository_path(project) return unless project
mirror_link = link_to('mirroring your GitHub repository', mirror_path)
"This requires #{mirror_link} to this project.".html_safe 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 end
def self.to_param def self.to_param
......
...@@ -70,9 +70,9 @@ RSpec.describe GithubService do ...@@ -70,9 +70,9 @@ RSpec.describe GithubService do
end end
end end
describe '#detailed_description' do describe '#help' do
it 'links to mirroring settings' do it 'links to mirroring settings' do
expect(subject.detailed_description).to match(/href=.*mirroring/) expect(subject.help).to match(/href=.*mirroring/)
end end
end end
......
...@@ -15907,6 +15907,9 @@ msgstr "" ...@@ -15907,6 +15907,9 @@ msgstr ""
msgid "Integrations|This integration, and inheriting projects were reset." msgid "Integrations|This integration, and inheriting projects were reset."
msgstr "" 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." msgid "Integrations|To keep this project going, create a new issue."
msgstr "" msgstr ""
......
...@@ -43,13 +43,13 @@ RSpec.describe ConfluenceService do ...@@ -43,13 +43,13 @@ RSpec.describe ConfluenceService do
end end
end end
describe '#detailed_description' do describe '#help' do
it 'can correctly return a link to the project wiki when active' do it 'can correctly return a link to the project wiki when active' do
project = create(:project) project = create(:project)
subject.project = project subject.project = project
subject.active = true 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 end
context 'when the project wiki is not enabled' do context 'when the project wiki is not enabled' do
...@@ -60,7 +60,7 @@ RSpec.describe ConfluenceService do ...@@ -60,7 +60,7 @@ RSpec.describe ConfluenceService do
[true, false].each do |active| [true, false].each do |active|
subject.active = active subject.active = active
expect(subject.detailed_description).to be_nil expect(subject.help).to be_nil
end 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