Commit 5b7b66d4 authored by Justin Ho's avatar Justin Ho

Refactor code after review

Remove redundant title class
parent 7106ccba
...@@ -124,6 +124,7 @@ export default { ...@@ -124,6 +124,7 @@ export default {
:initial-is-enabled="initialEnableJiraVulnerabilities" :initial-is-enabled="initialEnableJiraVulnerabilities"
:initial-issue-type-id="initialVulnerabilitiesIssuetype" :initial-issue-type-id="initialVulnerabilitiesIssuetype"
:show-full-feature="showJiraVulnerabilitiesIntegration" :show-full-feature="showJiraVulnerabilitiesIntegration"
class="gl-mt-6"
data-testid="jira-for-vulnerabilities" data-testid="jira-for-vulnerabilities"
@request-jira-issue-types="$emit('request-jira-issue-types')" @request-jira-issue-types="$emit('request-jira-issue-types')"
/> />
......
...@@ -143,7 +143,7 @@ module Integrations ...@@ -143,7 +143,7 @@ module Integrations
end end
def help def help
jira_doc_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_url('integration/jira/index.html') } jira_doc_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('integration/jira/index') }
s_("JiraService|You must configure Jira before enabling this integration. %{jira_doc_link_start}Learn more.%{link_end}") % { jira_doc_link_start: jira_doc_link_start, link_end: '</a>'.html_safe } s_("JiraService|You must configure Jira before enabling this integration. %{jira_doc_link_start}Learn more.%{link_end}") % { jira_doc_link_start: jira_doc_link_start, link_end: '</a>'.html_safe }
end end
...@@ -175,19 +175,10 @@ module Integrations ...@@ -175,19 +175,10 @@ module Integrations
# Jira issues is currently only configurable on the project level. # Jira issues is currently only configurable on the project level.
if project_level? if project_level?
jira_issues_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_url('integration/jira/issues.html') }
description = s_('JiraService|Work on Jira issues without leaving GitLab. Add a Jira menu to access a read-only list of your Jira issues. %{jira_issues_link_start}Learn more.%{link_end}') % { jira_issues_link_start: jira_issues_link_start, link_end: '</a>'.html_safe }
if project&.issues_enabled?
gitlab_issues_link_start = '<a href="%{url}">'.html_safe % { url: edit_project_path(project, anchor: 'js-shared-permissions') }
description += '<br><br>'.html_safe
description += s_("JiraService|Displaying Jira issues while leaving GitLab issues also enabled might be confusing. Consider %{gitlab_issues_link_start}disabling GitLab issues%{link_end} if they won't otherwise be used.") % { gitlab_issues_link_start: gitlab_issues_link_start, link_end: '</a>'.html_safe }
end
sections.push({ sections.push({
type: SECTION_TYPE_JIRA_ISSUES, type: SECTION_TYPE_JIRA_ISSUES,
title: _('Issues'), title: _('Issues'),
description: description description: jira_issues_section_description
}) })
end end
...@@ -617,6 +608,19 @@ module Integrations ...@@ -617,6 +608,19 @@ module Integrations
data_fields.deployment_server! data_fields.deployment_server!
end end
end end
def jira_issues_section_description
jira_issues_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('integration/jira/issues') }
description = s_('JiraService|Work on Jira issues without leaving GitLab. Add a Jira menu to access a read-only list of your Jira issues. %{jira_issues_link_start}Learn more.%{link_end}') % { jira_issues_link_start: jira_issues_link_start, link_end: '</a>'.html_safe }
if project&.issues_enabled?
gitlab_issues_link_start = '<a href="%{url}">'.html_safe % { url: edit_project_path(project, anchor: 'js-shared-permissions') }
description += '<br><br>'.html_safe
description += s_("JiraService|Displaying Jira issues while leaving GitLab issues also enabled might be confusing. Consider %{gitlab_issues_link_start}disabling GitLab issues%{link_end} if they won't otherwise be used.") % { gitlab_issues_link_start: gitlab_issues_link_start, link_end: '</a>'.html_safe }
end
description
end
end end
end end
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
.gl-alert-body .gl-alert-body
= s_('ExternalIssueIntegration|Only one issue tracker integration can be active at a time. Please disable the active tracker first and try again.') = s_('ExternalIssueIntegration|Only one issue tracker integration can be active at a time. Please disable the active tracker first and try again.')
%h2.title.gl-mb-4 %h2.gl-mb-4
= integration.title = integration.title
- if integration.operating? - if integration.operating?
= sprite_icon('check', css_class: 'gl-text-green-500') = sprite_icon('check', css_class: 'gl-text-green-500')
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
- page_title @integration.title, _('Integrations') - page_title @integration.title, _('Integrations')
- @content_class = 'limit-container-width' unless fluid_layout - @content_class = 'limit-container-width' unless fluid_layout
%h2.title.gl-mb-4 %h2.gl-mb-4
= @integration.title = @integration.title
= render 'shared/integrations/tabs', integration: @integration, active_tab: 'edit' do = render 'shared/integrations/tabs', integration: @integration, active_tab: 'edit' do
......
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
</script> </script>
<template> <template>
<div class="gl-mt-6"> <div>
<gl-form-checkbox <gl-form-checkbox
v-model="isJiraVulnerabilitiesEnabled" v-model="isJiraVulnerabilitiesEnabled"
data-testid="enable-jira-vulnerabilities" data-testid="enable-jira-vulnerabilities"
......
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