fix linter

This commit is contained in:
Lisa Durand 2023-03-27 17:26:53 +02:00
parent 92bc95014a
commit df701f2a8f
3 changed files with 10 additions and 6 deletions

View file

@ -22,7 +22,7 @@
= form.file_field :justificatif_motivation, direct_upload: true, id: "dossier_justificatif_motivation_accept", onchange: "DS.showDeleteJustificatif('accept');" = form.file_field :justificatif_motivation, direct_upload: true, id: "dossier_justificatif_motivation_accept", onchange: "DS.showDeleteJustificatif('accept');"
.hidden{ id: "delete_motivation_import_accept" } .hidden{ id: "delete_motivation_import_accept" }
%button.fr-btn.fr-btn--sm.fr-btn--tertiary-no-outline.fr-btn--icon-left.fr-icon-delete-line.fr-ml-0.fr-mt-1w.js_delete_motivation{ type: 'button', onclick: "DS.deleteJustificatif('accept');"} Supprimer le justificatif %button.fr-btn.fr-btn--sm.fr-btn--tertiary-no-outline.fr-btn--icon-left.fr-icon-delete-line.fr-ml-0.fr-mt-1w.js_delete_motivation{ type: 'button', onclick: "DS.deleteJustificatif('accept');" } Supprimer le justificatif
= button_tag "Annuler", type: :reset, class: 'fr-btn fr-btn--sm fr-btn--secondary', onclick: 'DS.motivationCancelBatch();' = button_tag "Annuler", type: :reset, class: 'fr-btn fr-btn--sm fr-btn--secondary', onclick: 'DS.motivationCancelBatch();'
= form.button "Valider la décision", class: ['fr-btn fr-btn--sm fr-mt-2w'], disabled: true, name: "#{form.object_name}[operation]", value: opt[:operation] = form.button "Valider la décision", class: ['fr-btn fr-btn--sm fr-mt-2w'], disabled: true, name: "#{form.object_name}[operation]", value: opt[:operation]

View file

@ -22,20 +22,24 @@ export function motivationCancel() {
} }
export function motivationCancelBatch() { export function motivationCancelBatch() {
document.querySelector('#dropdown_batch' ).classList.remove("open");; document.querySelector('#dropdown_batch').classList.remove('open');
hide(document.querySelector('.js_delete_motivation')); hide(document.querySelector('.js_delete_motivation'));
} }
export function showDeleteJustificatif(name) { export function showDeleteJustificatif(name) {
const justificatif = document.querySelector('#dossier_justificatif_motivation_' + name) const justificatif = document.querySelector(
'#dossier_justificatif_motivation_' + name
);
if (justificatif.value != '') { if (justificatif.value != '') {
show(document.querySelector('#delete_motivation_import_' + name)); show(document.querySelector('#delete_motivation_import_' + name));
} }
} }
export function deleteJustificatif(name) { export function deleteJustificatif(name) {
const justificatif = document.querySelector('#dossier_justificatif_motivation_' + name) const justificatif = document.querySelector(
justificatif.value = '' '#dossier_justificatif_motivation_' + name
);
justificatif.value = '';
hide(document.querySelector('#delete_motivation_import_' + name)); hide(document.querySelector('#delete_motivation_import_' + name));
} }

View file

@ -32,7 +32,7 @@
.hidden{ id: "justificatif_motivation_import_#{popup_class}" } .hidden{ id: "justificatif_motivation_import_#{popup_class}" }
= file_field :dossier, :justificatif_motivation, direct_upload: true, id: "dossier_justificatif_motivation_#{popup_class}",onchange: "DS.showDeleteJustificatif('#{popup_class}');" = file_field :dossier, :justificatif_motivation, direct_upload: true, id: "dossier_justificatif_motivation_#{popup_class}",onchange: "DS.showDeleteJustificatif('#{popup_class}');"
.hidden{ id: "delete_motivation_import_#{popup_class}" } .hidden{ id: "delete_motivation_import_#{popup_class}" }
%button.fr-btn.fr-btn--tertiary-no-outline.fr-btn--icon-left.fr-icon-delete-line.fr-ml-0.fr-mt-1w.js_delete_motivation{ type: 'button', onclick: "DS.deleteJustificatif('#{popup_class}');"} Supprimer le justificatif %button.fr-btn.fr-btn--tertiary-no-outline.fr-btn--icon-left.fr-icon-delete-line.fr-ml-0.fr-mt-1w.js_delete_motivation{ type: 'button', onclick: "DS.deleteJustificatif('#{popup_class}');" } Supprimer le justificatif
.fr-mt-2w .fr-mt-2w
= button_tag "Annuler", type: :reset, class: 'fr-btn fr-btn--secondary', onclick: 'DS.motivationCancel();' = button_tag "Annuler", type: :reset, class: 'fr-btn fr-btn--secondary', onclick: 'DS.motivationCancel();'
= button_tag 'Valider la décision', name: :process_action, value: process_action, class: 'fr-btn fr-mr-0', title: title = button_tag 'Valider la décision', name: :process_action, value: process_action, class: 'fr-btn fr-mr-0', title: title