Commit 4dc50578 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '219105-remove-jira_issue_import_vue-feature-flag' into 'master'

Remove `:jira_issue_import_vue` feature flag

See merge request gitlab-org/gitlab!33495
parents 00e680e2 cf0e2f9e
......@@ -6,26 +6,9 @@ module Projects
before_action :authenticate_user!
before_action :check_issues_available!
before_action :authorize_read_project!
before_action :jira_integration_configured?
before_action :authorize_admin_project!, only: [:import]
def show
jira_service = @project.jira_service
if jira_service.present? && !@project.latest_jira_import&.in_progress? && current_user&.can?(:admin_project, @project)
jira_client = jira_service.client
jira_projects = jira_client.Project.all
if jira_projects.present?
@jira_projects = jira_projects.map { |p| ["#{p.name} (#{p.key})", p.key] }
else
flash[:alert] = 'No projects have been returned from Jira. Please check your Jira configuration.'
end
end
unless Feature.enabled?(:jira_issue_import_vue, @project, default_enabled: true)
flash[:notice] = _("Import %{status}") % { status: @project.jira_import_status } unless @project.latest_jira_import&.initial?
end
end
def import
......@@ -43,15 +26,6 @@ module Projects
private
def jira_integration_configured?
return if Feature.enabled?(:jira_issue_import_vue, @project, default_enabled: true)
return if @project.jira_service
flash[:notice] = _("Configure the Jira integration first on your project's %{strong_start} Settings > Integrations > Jira%{strong_end} page." %
{ strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe })
redirect_to project_issues_path(@project)
end
def jira_import_params
params.permit(:jira_project_key)
end
......
- if Feature.enabled?(:jira_issue_import_vue, @project, default_enabled: true)
.js-jira-import-root{ data: { project_path: @project.full_path,
issues_path: project_issues_path(@project),
jira_integration_path: edit_project_service_path(@project, :jira),
is_jira_configured: @project.jira_service.present?.to_s,
in_progress_illustration: image_path('illustrations/export-import.svg'),
setup_illustration: image_path('illustrations/manual_action.svg') } }
- else
- title = _('Jira Issue Import')
- page_title title
- breadcrumb_title title
- header_title _("Projects"), root_path
= render 'import/shared/errors'
- if @project.import_state&.in_progress?
%h3.page-title.d-flex.align-items-center
= sprite_icon('issues', size: 16, css_class: 'mr-1')
= _('Import in progress')
- elsif @jira_projects.present?
%h3.page-title.d-flex.align-items-center
= sprite_icon('issues', size: 16, css_class: 'mr-1')
= _('Import issues from Jira')
= form_tag import_project_import_jira_path(@project), method: :post do
.form-group.row
= label_tag :jira_project_key, _('From project'), class: 'col-form-label col-md-2'
.col-md-4
= select_tag :jira_project_key, options_for_select(@jira_projects, ''), { class: 'select2' }
.form-actions
= submit_tag _('Import issues'), class: 'btn btn-success'
= link_to _('Cancel'), project_issues_path(@project), class: 'btn btn-cancel'
.js-jira-import-root{ data: { project_path: @project.full_path,
issues_path: project_issues_path(@project),
jira_integration_path: edit_project_service_path(@project, :jira),
is_jira_configured: @project.jira_service.present?.to_s,
in_progress_illustration: image_path('illustrations/export-import.svg'),
setup_illustration: image_path('illustrations/manual_action.svg') } }
......@@ -5798,9 +5798,6 @@ msgstr ""
msgid "Configure the %{link} integration."
msgstr ""
msgid "Configure the Jira integration first on your project's %{strong_start} Settings > Integrations > Jira%{strong_end} page."
msgstr ""
msgid "Configure the way a user creates a new account."
msgstr ""
......@@ -9937,9 +9934,6 @@ msgstr ""
msgid "From merge request merge until deploy to production"
msgstr ""
msgid "From project"
msgstr ""
msgid "From the Kubernetes cluster details view, install Runner from the applications list"
msgstr ""
......@@ -11639,9 +11633,6 @@ msgstr ""
msgid "Import"
msgstr ""
msgid "Import %{status}"
msgstr ""
msgid "Import CSV"
msgstr ""
......@@ -11678,9 +11669,6 @@ msgstr ""
msgid "Import issues"
msgstr ""
msgid "Import issues from Jira"
msgstr ""
msgid "Import members"
msgstr ""
......@@ -12334,9 +12322,6 @@ msgstr ""
msgid "January"
msgstr ""
msgid "Jira Issue Import"
msgstr ""
msgid "Jira import is already running."
msgstr ""
......
......@@ -31,7 +31,6 @@ describe Projects::Import::JiraController do
before do
sign_in(user)
project.add_maintainer(user)
stub_feature_flags(jira_issue_import_vue: false)
stub_jira_service_test
end
......@@ -57,7 +56,6 @@ describe Projects::Import::JiraController do
it 'renders show template' do
expect(response).to render_template(:show)
expect(assigns(:jira_projects)).not_to be_present
end
end
......@@ -74,7 +72,7 @@ describe Projects::Import::JiraController do
let_it_be(:disabled_issues_project) { create(:project, :public, :issues_disabled) }
context 'get show' do
it 'returs 404' do
it 'returns 404' do
get :show, params: { namespace_id: project.namespace.to_param, project_id: disabled_issues_project }
expect(response).to have_gitlab_http_status(:not_found)
......@@ -82,7 +80,7 @@ describe Projects::Import::JiraController do
end
context 'post import' do
it 'returs 404' do
it 'returns 404' do
post :import, params: { namespace_id: disabled_issues_project.namespace, project_id: disabled_issues_project, jira_project_key: jira_project_key }
expect(response).to have_gitlab_http_status(:not_found)
......@@ -91,33 +89,6 @@ describe Projects::Import::JiraController do
end
context 'when running Jira import first time' do
context 'get show' do
before do
allow(JIRA::Resource::Project).to receive(:all).and_return(jira_projects)
expect(project.jira_imports).to be_empty
get :show, params: { namespace_id: project.namespace.to_param, project_id: project }
end
context 'when no projects have been retrieved from Jira' do
let(:jira_projects) { [] }
it 'render an error message' do
expect(flash[:alert]).to eq('No projects have been returned from Jira. Please check your Jira configuration.')
expect(response).to render_template(:show)
end
end
context 'when projects retrieved from Jira' do
let(:jira_projects) { [double(name: 'FOO project', key: 'FOO')] }
it 'renders show template' do
expect(response).to render_template(:show)
end
end
end
context 'post import' do
context 'when Jira project key is empty' do
it 'redirects back to show with an error' do
......@@ -149,16 +120,6 @@ describe Projects::Import::JiraController do
context 'when import state is scheduled' do
let_it_be(:jira_import_state) { create(:jira_import_state, :scheduled, project: project) }
context 'get show' do
it 'renders import status' do
get :show, params: { namespace_id: project.namespace.to_param, project_id: project }
jira_import = project.latest_jira_import
expect(jira_import.status).to eq 'scheduled'
expect(flash.now[:notice]).to eq 'Import scheduled'
end
end
context 'post import' do
it 'uses the existing import data' do
post :import, params: { namespace_id: project.namespace, project_id: project, jira_project_key: 'New Project' }
......@@ -172,16 +133,6 @@ describe Projects::Import::JiraController do
context 'when Jira import ran before' do
let_it_be(:jira_import_state) { create(:jira_import_state, :finished, project: project, jira_project_key: jira_project_key) }
context 'get show' do
it 'renders import status' do
allow(JIRA::Resource::Project).to receive(:all).and_return([])
get :show, params: { namespace_id: project.namespace.to_param, project_id: project }
expect(project.latest_jira_import.status).to eq 'finished'
expect(flash.now[:notice]).to eq 'Import finished'
end
end
context 'post import' do
it 'uses the existing import data' do
post :import, params: { namespace_id: project.namespace, project_id: project, jira_project_key: 'New Project' }
......
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