Commit 3559083d authored by Justin Ho's avatar Justin Ho

Hide warning to disable GitLab issues

In Jira integration form:
- Pass data from backend
- Add props and logic on the frontend
- Add specs and changelog
parent 3c0f28c6
......@@ -37,6 +37,11 @@ export default {
required: false,
default: null,
},
gitlabIssuesEnabled: {
type: Boolean,
required: false,
default: true,
},
upgradePlanPath: {
type: String,
required: false,
......@@ -133,7 +138,7 @@ export default {
:disabled="!enableJiraIssues"
/>
</gl-form-group>
<p>
<p v-if="gitlabIssuesEnabled">
<gl-sprintf
:message="
s__(
......
......@@ -33,6 +33,7 @@ function parseDatasetToProps(data) {
enableComments,
showJiraIssuesIntegration,
enableJiraIssues,
gitlabIssuesEnabled,
} = parseBooleanInData(booleanAttributes);
return {
......@@ -49,6 +50,7 @@ function parseDatasetToProps(data) {
showJiraIssuesIntegration,
initialEnableJiraIssues: enableJiraIssues,
initialProjectKey: projectKey,
gitlabIssuesEnabled,
upgradePlanPath,
editProjectPath,
},
......
---
title: Hide warning to disable GitLab issues in Jira integration form
merge_request: 40248
author:
type: changed
......@@ -18,6 +18,7 @@ module EE
show_jira_issues_integration: @project&.feature_available?(:jira_issues_integration).to_s,
enable_jira_issues: integration.issues_enabled.to_s,
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,
edit_project_path: @project ? edit_project_path(@project, anchor: 'js-shared-permissions') : nil
)
......
......@@ -24,7 +24,7 @@ RSpec.describe EE::ServicesHelper do
let(:integration) { build(:slack_service) }
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
......@@ -32,7 +32,7 @@ RSpec.describe EE::ServicesHelper do
let(:integration) { build(:jira_service) }
it 'includes Jira specific fields' do
is_expected.to include(:show_jira_issues_integration, :enable_jira_issues, :project_key, :edit_project_path)
is_expected.to include(:show_jira_issues_integration, :enable_jira_issues, :project_key, :gitlab_issues_enabled, :edit_project_path)
end
end
end
......
......@@ -92,5 +92,21 @@ describe('JiraIssuesFields', () => {
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