diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-30 21:08:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-30 21:08:07 +0300 |
commit | 2c72daf2f1744f2b8c8c6674c266907e9ef55558 (patch) | |
tree | e489b6e87557d3f6d8a94f2e7d4d47e633d646b5 /app/controllers/projects/import | |
parent | 4e9acbfba3682c552b3de707c535e6257ef41054 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/projects/import')
-rw-r--r-- | app/controllers/projects/import/jira_controller.rb | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/app/controllers/projects/import/jira_controller.rb b/app/controllers/projects/import/jira_controller.rb index d38d9e27347..e88d28e9db4 100644 --- a/app/controllers/projects/import/jira_controller.rb +++ b/app/controllers/projects/import/jira_controller.rb @@ -16,9 +16,8 @@ module Projects end def import - import_state = @project.import_state || @project.create_import_state - - schedule_import(jira_import_params) unless import_state.in_progress? + response = ::JiraImport::StartImportService.new(current_user, @project, jira_import_params[:jira_project_key]).execute + flash[:notice] = response.message if response.message.present? redirect_to project_import_jira_path(@project) end @@ -39,21 +38,6 @@ module Projects redirect_to project_issues_path(@project) end - def schedule_import(params) - import_data = @project.create_or_update_import_data(data: {}).becomes(JiraImportData) - - jira_project_details = JiraImportData::JiraProjectDetails.new( - params[:jira_project_key], - Time.now.strftime('%Y-%m-%d %H:%M:%S'), - { user_id: current_user.id, name: current_user.name } - ) - import_data << jira_project_details - import_data.force_import! - - @project.import_type = 'jira' - @project.import_state.schedule if @project.save - end - def jira_import_params params.permit(:jira_project_key) end |