@@ -32,18 +32,19 @@ module Projects
3232 class ProjectCreationFooterComponent < ApplicationComponent
3333 include OpPrimer ::ComponentHelpers
3434
35- def initialize ( form_identifier :, project :, template :, current_step :)
35+ def initialize ( form_identifier :, project :, template :, current_step :, cancel_href : )
3636 @form_identifier = form_identifier
3737 @project = project
3838 @template = template
3939 @current_step = current_step
40+ @cancel_href = cancel_href
4041
4142 super
4243 end
4344
4445 def call
4546 render ( StepWizard ::FooterComponent . new ( form_identifier :, total_steps :, current_step :) ) do |footer |
46- footer . with_cancel_button ( href : href_for_cancel_button )
47+ footer . with_cancel_button ( href : cancel_href )
4748 footer . with_continue_button ( **continue_button_args )
4849 footer . with_submit_button ( **submit_button_args )
4950 if show_progress_bar?
@@ -52,7 +53,7 @@ def call
5253 end
5354 end
5455
55- attr_reader :form_identifier , :project , :template , :current_step
56+ attr_reader :form_identifier , :project , :template , :current_step , :cancel_href
5657
5758 private
5859
@@ -78,9 +79,5 @@ def submit_button_args
7879 def total_steps
7980 template . nil? && project . available_custom_fields . required . any? ? 3 : 2
8081 end
81-
82- def href_for_cancel_button
83- project . portfolio? ? portfolios_path : projects_path
84- end
8582 end
8683end
0 commit comments