add autosave feedback when admin updates form
This commit is contained in:
parent
bacd8ab6f7
commit
2c6a9e7bf2
7 changed files with 13 additions and 1 deletions
1
app/views/administrateurs/_autosave_notice.html.haml
Normal file
1
app/views/administrateurs/_autosave_notice.html.haml
Normal file
|
@ -0,0 +1 @@
|
|||
#autosave-notice.fr-badge.fr-badge--sm.fr-badge--success= t(".form_saved")
|
|
@ -19,4 +19,5 @@
|
|||
%li
|
||||
= link_to t('preview', scope: [:layouts, :breadcrumb]), apercu_admin_procedure_path(@procedure), target: "_blank", rel: "noopener", class: 'fr-btn fr-btn--secondary'
|
||||
.fr-ml-auto
|
||||
#autosave-notice.hidden
|
||||
= render TypesDeChampEditor::EstimatedFillDurationComponent.new(revision: @procedure.draft_revision, is_annotation: false)
|
||||
|
|
|
@ -6,6 +6,11 @@
|
|||
|
||||
= turbo_stream.replace 'errors-summary', render(TypesDeChampEditor::ErrorsSummary.new(revision: @procedure.draft_revision))
|
||||
|
||||
- unless flash.alert
|
||||
= turbo_stream.show 'autosave-notice'
|
||||
= turbo_stream.replace 'autosave-notice', render(partial: 'administrateurs/autosave_notice')
|
||||
= turbo_stream.hide 'autosave-notice', delay: 30000
|
||||
|
||||
- if @destroyed.present?
|
||||
= turbo_stream.remove dom_id(@destroyed, :type_de_champ_editor)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue