Class: Projects::ImportsController

Inherits:
ApplicationController show all
Includes:
ContinueParams
Defined in:
app/controllers/projects/imports_controller.rb

Instance Method Summary collapse

Methods included from ContinueParams

#continue_params

Methods inherited from ApplicationController

#redirect_back_or_default

Methods included from PageLayoutHelper

#blank_container, #container_class, #fluid_layout, #header_title, #nav, #page_card_attributes, #page_card_meta_tags, #page_description, #page_image, #page_title, #sidebar

Methods included from GitlabRoutingHelper

#activity_project_path, #edit_project_path, #edit_project_url, #issue_path, #issue_url, #merge_request_path, #merge_request_url, #milestone_path, #project_builds_path, #project_commits_path, #project_files_path, #project_path, #project_pipelines_path, #project_snippet_url, #project_url, #runner_path, #runners_path, #toggle_subscription_path

Methods included from Gitlab::GonHelper

#add_gon_variables

Methods included from Gitlab::CurrentSettings

#current_application_settings, #fake_application_settings

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Projects::ApplicationController

Instance Method Details

#createObject


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/controllers/projects/imports_controller.rb', line 13

def create
  @project.import_url = params[:project][:import_url]

  if @project.save
    @project.reload

    if @project.import_failed?
      @project.import_retry
    else
      @project.import_start
    end
  end

  redirect_to namespace_project_import_path(@project.namespace, @project)
end

#newObject


10
11
# File 'app/controllers/projects/imports_controller.rb', line 10

def new
end

#showObject


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'app/controllers/projects/imports_controller.rb', line 29

def show
  if @project.import_finished?
    if continue_params
      redirect_to continue_params[:to], notice: continue_params[:notice]
    else
      redirect_to namespace_project_path(@project.namespace, @project), notice: finished_notice
    end
  elsif @project.import_failed?
    redirect_to new_namespace_project_import_path(@project.namespace, @project)
  else
    if continue_params && continue_params[:notice_now]
      flash.now[:notice] = continue_params[:notice_now]
    end

    # Render
  end
end