diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 5e5d170a9f3..aeebdf90ba6 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -348,4 +348,10 @@ module ProjectsHelper message.strip.gsub(Gitlab.config.gitlab_shell.repos_path.chomp('/'), "[REPOS PATH]") end + + def db_export_list + YAML.load_file(Gitlab::ImportExport.config_file)['project_tree'].map do |relation| + relation.is_a?(Hash) ? relation.keys.first.to_s : relation.to_s + end + ['notes', 'merge_request_diffs'] + end end diff --git a/app/models/project.rb b/app/models/project.rb index 1625e880220..323bde5d5c4 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -348,16 +348,6 @@ class Project < ActiveRecord::Base joins(join_body).reorder('join_note_counts.amount DESC') end - - def create_from_import_job(current_user_id:, tmp_file:, namespace_id:, project_path:) - job_id = ProjectImportWorker.perform_async(current_user_id, tmp_file, namespace_id, project_path) - - if job_id - Rails.logger.info "Import job started for export #{tmp_file} with job ID #{job_id}" - else - Rails.logger.error "Import job failed to start for #{tmp_file}" - end - end end def team diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index 9a832eceaf5..2441e71a5d2 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -129,9 +129,27 @@ Generates a compressed export file of the project and sends a link to download the export. .col-lg-9 - = link_to 'Generate new export', export_namespace_project_path(@project.namespace, @project), + = link_to 'Export project', export_namespace_project_path(@project.namespace, @project), method: :post, class: "btn btn-default" + %p.append-bottom-0 + %p + .row.prepend-top-default + Clicking on Export project, will produce a compressed file that will be sent as a link to your registered e-mail address. + + .bs-callout.bs-callout-info + %p.append-bottom-0 + %p + The following items will be exported: + %ul + %li Project and wiki repository + %li Project uploads + %li DB items, including configuration + %ul + - db_export_list.each do |export_relation| + %li + %code #{export_relation} + %hr - if can? current_user, :archive_project, @project .row.prepend-top-default diff --git a/lib/gitlab/import_export/project_creator.rb b/lib/gitlab/import_export/project_creator.rb index b8424cb9719..801d4b4f43a 100644 --- a/lib/gitlab/import_export/project_creator.rb +++ b/lib/gitlab/import_export/project_creator.rb @@ -2,7 +2,7 @@ module Gitlab module ImportExport class ProjectCreator - def initialize(namespace_id, current_user, ) + def initialize(namespace_id, current_user) @repo = repo @namespace = Namespace.find_by_id(namespace_id) @current_user = current_user