2023-04-18 18:06:24 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Instructeurs::EnConstructionMenuComponent < ApplicationComponent
|
|
|
|
attr_reader :dossier
|
|
|
|
|
|
|
|
def initialize(dossier:)
|
|
|
|
@dossier = dossier
|
|
|
|
end
|
|
|
|
|
|
|
|
def render?
|
|
|
|
return true if dossier.may_repasser_en_construction?
|
|
|
|
return true if dossier.may_flag_as_pending_correction?
|
|
|
|
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
def menu_label
|
2023-06-06 14:41:47 +02:00
|
|
|
if !dossier.may_repasser_en_construction?
|
2023-04-18 18:06:24 +02:00
|
|
|
t('.request_correction')
|
|
|
|
else
|
|
|
|
t(".revert_en_construction")
|
|
|
|
end
|
|
|
|
end
|
2023-06-14 13:14:19 +02:00
|
|
|
|
|
|
|
def sva?
|
|
|
|
dossier.procedure.sva?
|
|
|
|
end
|
|
|
|
|
|
|
|
def sva_resume_method
|
|
|
|
dossier.procedure.sva_svr_configuration.resume
|
|
|
|
end
|
2023-04-18 18:06:24 +02:00
|
|
|
end
|