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 | |
parent | 4e9acbfba3682c552b3de707c535e6257ef41054 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/avatars_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects/import/jira_controller.rb | 20 | ||||
-rw-r--r-- | app/controllers/projects/raw_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects/wikis_controller.rb | 2 |
4 files changed, 5 insertions, 21 deletions
diff --git a/app/controllers/projects/avatars_controller.rb b/app/controllers/projects/avatars_controller.rb index 1f4a25f82e9..6e6bf09a32a 100644 --- a/app/controllers/projects/avatars_controller.rb +++ b/app/controllers/projects/avatars_controller.rb @@ -8,7 +8,7 @@ class Projects::AvatarsController < Projects::ApplicationController def show @blob = @repository.blob_at_branch(@repository.root_ref, @project.avatar_in_git) - send_blob(@repository, @blob) + send_blob(@repository, @blob, allow_caching: @project.public?) end def destroy 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 diff --git a/app/controllers/projects/raw_controller.rb b/app/controllers/projects/raw_controller.rb index f7bc6898112..69a3898af55 100644 --- a/app/controllers/projects/raw_controller.rb +++ b/app/controllers/projects/raw_controller.rb @@ -17,7 +17,7 @@ class Projects::RawController < Projects::ApplicationController def show @blob = @repository.blob_at(@commit.id, @path) - send_blob(@repository, @blob, inline: (params[:inline] != 'false')) + send_blob(@repository, @blob, inline: (params[:inline] != 'false'), allow_caching: @project.public?) end private diff --git a/app/controllers/projects/wikis_controller.rb b/app/controllers/projects/wikis_controller.rb index cfc0925d9e1..90ff798077a 100644 --- a/app/controllers/projects/wikis_controller.rb +++ b/app/controllers/projects/wikis_controller.rb @@ -45,7 +45,7 @@ class Projects::WikisController < Projects::ApplicationController render 'show' elsif file_blob - send_blob(@project_wiki.repository, file_blob) + send_blob(@project_wiki.repository, file_blob, allow_caching: @project.public?) elsif show_create_form? # Assign a title to the WikiPage unless `id` is a randomly generated slug from #new title = params[:id] unless params[:random_title].present? |