Commit c7cc3bb1 authored by Justin Ho Tuan Duong's avatar Justin Ho Tuan Duong Committed by Mike Greiling

Make sure feature flag is independent

The feature flags `vue_issuables_list` and `jira_integration`
should not be tied together, i.e. we should be able to
enable just `jira_integration` and it should work without
the need to enable the other feature flag.

This change makes sure the frontend considers this and
still renders the Jira issues list when the ff is enabled.
parent 31a1c997
...@@ -36,7 +36,7 @@ function mountIssuableListRootApp() { ...@@ -36,7 +36,7 @@ function mountIssuableListRootApp() {
} }
function mountIssuablesListApp() { function mountIssuablesListApp() {
if (!gon.features?.vueIssuablesList) { if (!gon.features?.vueIssuablesList && !gon.features?.jiraIntegration) {
return; return;
} }
......
...@@ -128,7 +128,7 @@ class JiraService < IssueTrackerService ...@@ -128,7 +128,7 @@ class JiraService < IssueTrackerService
end end
def new_issue_url def new_issue_url
"#{url}/secure/CreateIssue.jspa" "#{url}/secure/CreateIssue!default.jspa"
end end
alias_method :original_url, :url alias_method :original_url, :url
......
...@@ -12,7 +12,6 @@ module Projects ...@@ -12,7 +12,6 @@ module Projects
before_action do before_action do
push_frontend_feature_flag(:jira_integration, project) push_frontend_feature_flag(:jira_integration, project)
push_frontend_feature_flag(:vue_issuables_list, project)
end end
def index def index
...@@ -70,7 +69,7 @@ module Projects ...@@ -70,7 +69,7 @@ module Projects
protected protected
def check_feature_enabled! def check_feature_enabled!
return render_404 unless Feature.enabled?(:jira_integration, project) return render_404 unless Feature.enabled?(:jira_integration, project) && project.external_issue_tracker
end end
def render_bad_request(error) def render_bad_request(error)
......
.nav-controls.issues-nav-controls.gl-my-5
= link_to @project.external_issue_tracker.new_issue_url, class: 'btn gl-button', target: '_blank', rel: 'noopener noreferrer' do
= _('Create new issue in Jira')
= sprite_icon('external-link', css_class: 'gl-ml-1')
- page_title _('Jira Issues') - page_title _('Jira Issues')
.top-area.gl-border-b-0.gl-justify-content-end
= render 'projects/integrations/jira/issues/nav_btns'
.js-issuables-list{ data: { endpoint: expose_path(project_integrations_jira_issues_path(@project, format: :json)), .js-issuables-list{ data: { endpoint: expose_path(project_integrations_jira_issues_path(@project, format: :json)),
'can-bulk-edit': false, 'can-bulk-edit': false,
'empty-svg-path': image_path('illustrations/issues.svg'), 'empty-svg-path': image_path('illustrations/issues.svg'),
......
...@@ -171,6 +171,7 @@ RSpec.describe Projects::Integrations::Jira::IssuesController do ...@@ -171,6 +171,7 @@ RSpec.describe Projects::Integrations::Jira::IssuesController do
before do before do
sign_in user sign_in user
project.add_developer(user) project.add_developer(user)
create(:jira_service, project: project)
end end
it_behaves_like 'unauthorized when external service denies access' do it_behaves_like 'unauthorized when external service denies access' do
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Jira issues list' do
let_it_be(:project) { create(:project) }
let_it_be(:jira_integration) { create(:jira_service, project: project, issues_enabled: true) }
let(:user) { create(:user) }
before do
project.add_user(user, :developer)
sign_in(user)
end
it 'renders "Create new issue" button' do
visit project_integrations_jira_issues_path(project)
expect(page).to have_link('Create new issue in Jira')
end
end
...@@ -6863,6 +6863,9 @@ msgstr "" ...@@ -6863,6 +6863,9 @@ msgstr ""
msgid "Create new file or directory" msgid "Create new file or directory"
msgstr "" msgstr ""
msgid "Create new issue in Jira"
msgstr ""
msgid "Create new label" msgid "Create new label"
msgstr "" msgstr ""
......
...@@ -724,7 +724,7 @@ RSpec.describe JiraService do ...@@ -724,7 +724,7 @@ RSpec.describe JiraService do
describe '#new_issue_url' do describe '#new_issue_url' do
it 'handles trailing slashes' do it 'handles trailing slashes' do
expect(service.new_issue_url).to eq('http://jira.test.com/path/secure/CreateIssue.jspa') expect(service.new_issue_url).to eq('http://jira.test.com/path/secure/CreateIssue!default.jspa')
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