clean(InvitationWithTypoComponent): simplier interface
This commit is contained in:
parent
2bb7584246
commit
4771c45bce
3 changed files with 4 additions and 5 deletions
|
@ -1,8 +1,7 @@
|
|||
class Procedure::InvitationWithTypoComponent < ApplicationComponent
|
||||
def initialize(maybe_typo:, url:, params:, title:)
|
||||
def initialize(maybe_typo:, url:, title:)
|
||||
@maybe_typo = maybe_typo
|
||||
@url = url
|
||||
@params = params
|
||||
@title = title
|
||||
end
|
||||
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
- maybe_typos.each do |(actual_email, suggested_email)|
|
||||
%li
|
||||
= "Je confirme "
|
||||
= button_to "#{actual_email}", @url, method: :POST, params: @params.call(actual_email), class: 'fr-btn fr-btn--tertiary fr-btn--sm', form: {class: 'inline'}
|
||||
= button_to "#{actual_email}", @url, method: :POST, params: { maybe_typo: actual_email }, class: 'fr-btn fr-btn--tertiary fr-btn--sm', form: {class: 'inline'}
|
||||
= " ou "
|
||||
= button_to "#{suggested_email}", @url, method: :POST, params: @params.call(suggested_email), class: 'fr-btn fr-btn--tertiary fr-btn--sm', form: {class: 'inline'}
|
||||
= button_to "#{suggested_email}", @url, method: :POST, params: { maybe_typo: suggested_email }, class: 'fr-btn fr-btn--tertiary fr-btn--sm', form: {class: 'inline'}
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
- if @procedure.experts_require_administrateur_invitation?
|
||||
.card
|
||||
= render Procedure::InvitationWithTypoComponent.new(maybe_typo: @maybe_typo, url: admin_procedure_experts_path(@procedure), params: ->(email) { { maybe_typo: email } }, title: "Avant d'ajouter l'email à la liste d'expert prédéfinie, veuillez confirmer" )
|
||||
= render Procedure::InvitationWithTypoComponent.new(maybe_typo: @maybe_typo, url: admin_procedure_experts_path(@procedure), title: "Avant d'ajouter l'email à la liste d'expert prédéfinie, veuillez confirmer" )
|
||||
= form_for :experts_procedure,
|
||||
url: admin_procedure_experts_path(@procedure),
|
||||
html: { class: 'form' } do |f|
|
||||
|
|
Loading…
Reference in a new issue