Commit db29952b authored by Ash McKenzie's avatar Ash McKenzie

Merge branch '228824-follow-up-from-add-an-upgrade-banner-for-non-premium-plans' into 'master'

Hide warning to disable GitLab issues in Jira integration form

See merge request gitlab-org/gitlab!40248
parents c69a78da 9926d936
...@@ -37,6 +37,11 @@ export default { ...@@ -37,6 +37,11 @@ export default {
required: false, required: false,
default: null, default: null,
}, },
gitlabIssuesEnabled: {
type: Boolean,
required: false,
default: true,
},
upgradePlanPath: { upgradePlanPath: {
type: String, type: String,
required: false, required: false,
...@@ -133,7 +138,7 @@ export default { ...@@ -133,7 +138,7 @@ export default {
:disabled="!enableJiraIssues" :disabled="!enableJiraIssues"
/> />
</gl-form-group> </gl-form-group>
<p> <p v-if="gitlabIssuesEnabled">
<gl-sprintf <gl-sprintf
:message=" :message="
s__( s__(
......
...@@ -34,6 +34,7 @@ function parseDatasetToProps(data) { ...@@ -34,6 +34,7 @@ function parseDatasetToProps(data) {
enableComments, enableComments,
showJiraIssuesIntegration, showJiraIssuesIntegration,
enableJiraIssues, enableJiraIssues,
gitlabIssuesEnabled,
} = parseBooleanInData(booleanAttributes); } = parseBooleanInData(booleanAttributes);
return { return {
...@@ -50,6 +51,7 @@ function parseDatasetToProps(data) { ...@@ -50,6 +51,7 @@ function parseDatasetToProps(data) {
showJiraIssuesIntegration, showJiraIssuesIntegration,
initialEnableJiraIssues: enableJiraIssues, initialEnableJiraIssues: enableJiraIssues,
initialProjectKey: projectKey, initialProjectKey: projectKey,
gitlabIssuesEnabled,
upgradePlanPath, upgradePlanPath,
editProjectPath, editProjectPath,
}, },
......
...@@ -18,6 +18,7 @@ module EE ...@@ -18,6 +18,7 @@ module EE
show_jira_issues_integration: @project&.feature_available?(:jira_issues_integration).to_s, show_jira_issues_integration: @project&.feature_available?(:jira_issues_integration).to_s,
enable_jira_issues: integration.issues_enabled.to_s, enable_jira_issues: integration.issues_enabled.to_s,
project_key: integration.project_key, project_key: integration.project_key,
gitlab_issues_enabled: @project&.issues_enabled?.to_s,
upgrade_plan_path: @project && ::Gitlab::CurrentSettings.should_check_namespace_plan? ? upgrade_plan_path(@project.group) : nil, upgrade_plan_path: @project && ::Gitlab::CurrentSettings.should_check_namespace_plan? ? upgrade_plan_path(@project.group) : nil,
edit_project_path: @project ? edit_project_path(@project, anchor: 'js-shared-permissions') : nil edit_project_path: @project ? edit_project_path(@project, anchor: 'js-shared-permissions') : nil
) )
......
---
title: Hide warning to disable GitLab issues in Jira integration form
merge_request: 40248
author:
type: changed
...@@ -20,19 +20,31 @@ RSpec.describe EE::ServicesHelper do ...@@ -20,19 +20,31 @@ RSpec.describe EE::ServicesHelper do
describe '#integration_form_data' do describe '#integration_form_data' do
subject { helper.integration_form_data(integration) } subject { helper.integration_form_data(integration) }
before do
assign(:project, project)
end
context 'Slack service' do context 'Slack service' do
let(:integration) { build(:slack_service) } let(:integration) { build(:slack_service) }
it 'does not include Jira specific fields' do it 'does not include Jira specific fields' do
is_expected.not_to include(:show_jira_issues_integration, :enable_jira_issues, :project_key, :edit_project_path) is_expected.not_to include(:show_jira_issues_integration, :enable_jira_issues, :project_key, :gitlab_issues_enabled, :edit_project_path)
end end
end end
context 'Jira service' do context 'Jira service' do
let(:integration) { build(:jira_service) } let(:integration) { build(:jira_service, issues_enabled: true, project_key: 'FE') }
it 'includes Jira specific fields' do it 'includes Jira specific fields' do
is_expected.to include(:show_jira_issues_integration, :enable_jira_issues, :project_key, :edit_project_path) stub_licensed_features(jira_issues_integration: true)
is_expected.to include(
show_jira_issues_integration: 'true',
enable_jira_issues: 'true',
project_key: 'FE',
gitlab_issues_enabled: 'true',
edit_project_path: edit_project_path(project, anchor: 'js-shared-permissions')
)
end end
end end
end end
......
...@@ -92,5 +92,21 @@ describe('JiraIssuesFields', () => { ...@@ -92,5 +92,21 @@ describe('JiraIssuesFields', () => {
expect(wrapper.find(`a[href="${defaultProps.editProjectPath}"]`).exists()).toBe(true); expect(wrapper.find(`a[href="${defaultProps.editProjectPath}"]`).exists()).toBe(true);
}); });
describe('GitLab issues warning', () => {
const expectedText = 'Consider disabling GitLab issues';
it('contains warning when GitLab issues is enabled', () => {
createComponent();
expect(wrapper.text()).toContain(expectedText);
});
it('does not contain warning when GitLab issues is disabled', () => {
createComponent({ gitlabIssuesEnabled: false });
expect(wrapper.text()).not.toContain(expectedText);
});
});
}); });
}); });
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