diff options
author | James Lopez <james@jameslopez.es> | 2016-05-04 18:44:15 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-05-04 18:44:15 +0300 |
commit | 7a531bb1160a34680ef663651f9138b46ab34f4a (patch) | |
tree | 317e481cb6cf199b2021b67c8ba84c17f76bcb4b /app | |
parent | 14dd2d4ad0be905385ec524a3022b9b81cb4671b (diff) | |
parent | a4d242b887f214493e73e2d44110974a417f3418 (diff) |
Merge branches 'feature/project-export-ui-experimental' and 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into feature/project-export-ui-experimental
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/import/gitlab_project_controller.rb | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/app/controllers/import/gitlab_project_controller.rb b/app/controllers/import/gitlab_project_controller.rb deleted file mode 100644 index ab0da196ac1..00000000000 --- a/app/controllers/import/gitlab_project_controller.rb +++ /dev/null @@ -1,45 +0,0 @@ -class Import::GitlabProjectController < Import::BaseController - before_action :verify_gitlab_project_import_enabled - before_action :gitlab_project_auth, except: :callback - - rescue_from OAuth::Error, with: :gitlab_project_unauthorized - - #TODO permissions stuff - - def callback - - redirect_to status_import_gitlab_project_url - end - - def status - @repos = client.projects - @incompatible_repos = client.incompatible_projects - - @already_added_projects = current_user.created_projects.where(import_type: "gitlab_project") - already_added_projects_names = @already_added_projects.pluck(:import_source) - - @repos.to_a.reject!{ |repo| already_added_projects_names.include? "#{repo["owner"]}/#{repo["slug"]}" } - end - - def jobs - jobs = current_user.created_projects.where(import_type: "gitlab_project").to_json(only: [:id, :import_status]) - render json: jobs - end - - def create - @file = params[:file] - - repo_owner = current_user.username - @target_namespace = params[:new_namespace].presence || repo_owner - - # namespace = get_or_create_namespace || (render and return) - - @project = Gitlab::ImportExport::ImportService.execute(archive_file: file, owner: repo_owner) - end - - private - - def verify_gitlab_project_import_enabled - render_404 unless gitlab_project_import_enabled? - end -end |