From 142e6c032cdf579024140bcabd4e8b9cf319a2a8 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Fri, 6 May 2022 19:25:12 +0200 Subject: [PATCH] cleanup(dossier): remove legacy menu --- .../procedures/_download_dossiers.html.haml | 34 ------------------- .../procedures/deleted_dossiers.html.haml | 2 -- .../instructeurs/procedures/show.html.haml | 4 +-- config/locales/en.yml | 2 +- config/locales/fr.yml | 2 +- .../views/instructeurs/procedures/en.yml | 15 -------- .../views/instructeurs/procedures/fr.yml | 15 -------- spec/system/instructeurs/instruction_spec.rb | 22 ++---------- 8 files changed, 5 insertions(+), 91 deletions(-) delete mode 100644 app/views/instructeurs/procedures/_download_dossiers.html.haml diff --git a/app/views/instructeurs/procedures/_download_dossiers.html.haml b/app/views/instructeurs/procedures/_download_dossiers.html.haml deleted file mode 100644 index 80477d130..000000000 --- a/app/views/instructeurs/procedures/_download_dossiers.html.haml +++ /dev/null @@ -1,34 +0,0 @@ -%span.dropdown - %button.button.dropdown-button{ 'aria-expanded' => 'false', 'aria-controls' => 'download-menu' } - = t('.download') - #download-menu.dropdown-content.fade-in-down{ style: 'width: 450px' } - %ul.dropdown-items - - exports_list(exports).each do |item| - - format = item[:format] - - time_span_type = item[:time_span_type] - - export = item[:export] - %li - - if export.nil? - // i18n-tasks-use t('.everything_csv_html') - // i18n-tasks-use t('.monthly_csv_html') - // i18n-tasks-use t('.everything_xlsx_html') - // i18n-tasks-use t('.monthly_xlsx_html') - // i18n-tasks-use t('.everything_ods_html') - // i18n-tasks-use t('.monthly_ods_html') - = link_to t(".#{time_span_type}_#{format}_html"), download_export_instructeur_procedure_path(procedure, time_span_type: time_span_type, export_format: format), remote: true - - elsif export.ready? - // i18n-tasks-use t('.export_everything_ready_html') - // i18n-tasks-use t('.export_monthly_ready_html') - = link_to t(".export_#{time_span_type}_ready_html", export_time: time_ago_in_words(export.updated_at), export_format: ".#{format}"), export.file.service_url, target: "_blank", rel: "noopener" - - if export.old? - // i18n-tasks-use t('.everything_short') - // i18n-tasks-use t('.monthly_short') - = button_to download_export_instructeur_procedure_path(procedure, export_format: format, time_span_type: time_span_type, force_export: true), class: "button small", style: "padding-right: 2px", title: t(".#{time_span_type}_short", export_format: ".#{format}"), remote: true, method: :get, params: { export_format: format, time_span_type: time_span_type, force_export: true } do - .icon.retry - - else - %span{ 'data-export-poll-url': download_export_instructeur_procedure_path(procedure, export_format: format, time_span_type: time_span_type, no_progress_notification: true) } - // i18n-tasks-use t('.export_everything_pending_html') - // i18n-tasks-use t('.export_monthly_pending_html') - = t(".export_#{time_span_type}_pending_html", export_time: time_ago_in_words(export.created_at), export_format: ".#{format}") - %li - = link_to t(".download_archive"), instructeur_archives_path(procedure) diff --git a/app/views/instructeurs/procedures/deleted_dossiers.html.haml b/app/views/instructeurs/procedures/deleted_dossiers.html.haml index f702298b2..9a2c2fe1d 100644 --- a/app/views/instructeurs/procedures/deleted_dossiers.html.haml +++ b/app/views/instructeurs/procedures/deleted_dossiers.html.haml @@ -10,8 +10,6 @@ = render partial: 'header', locals: { procedure: @procedure, statut: @statut } .procedure-actions - - if @can_download_dossiers - = render partial: "download_dossiers", locals: { procedure: @procedure, exports: @exports } .container.flex= render partial: "tabs", locals: { procedure: @procedure, statut: @statut, diff --git a/app/views/instructeurs/procedures/show.html.haml b/app/views/instructeurs/procedures/show.html.haml index d125dc3c3..d0bbde56d 100644 --- a/app/views/instructeurs/procedures/show.html.haml +++ b/app/views/instructeurs/procedures/show.html.haml @@ -10,8 +10,6 @@ = render partial: 'header', locals: { procedure: @procedure, statut: @statut } .procedure-actions - - if @can_download_dossiers - = render partial: "download_dossiers", locals: { procedure: @procedure, exports: @exports } .container.flex= render partial: "tabs", locals: { procedure: @procedure, statut: @statut, @@ -34,7 +32,7 @@ = t('views.instructeurs.dossiers.tab_explainations.suivis') - if @statut == 'traites' %p.explication-onglet - = t('views.instructeurs.dossiers.tab_explainations.traites') + = t('views.instructeurs.dossiers.tab_explainations.traites_html', archives_path: instructeur_archives_path(@procedure)) - if @statut == 'tous' %p.explication-onglet = t('views.instructeurs.dossiers.tab_explainations.tous') diff --git a/config/locales/en.yml b/config/locales/en.yml index 5237e58f1..1938ded5f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -151,7 +151,7 @@ en: tab_explainations: a_suivre: No instructor is assigned to follow up on these files. Be the first ! suivis: The folders that are in this tab are only those that you follow. You can exchange with the requester until you can accept them, refuse them or classify them without follow-up. - traites: "The files in this tab are finished: they have been accepted, refused or closed without follow-up." + traites_html: "The files in this tab are finished: they have been accepted, refused or closed without follow-up. You can download the zip archives of finished files and their attachments." tous: All the files that have been submitted on this approach, regardless of the status. supprimes_recemment: All files completed and deleted by the instructors on this approach. archives: "The files in this tab are archived: you can no longer reply to them, and requesters can no longer modify them." diff --git a/config/locales/fr.yml b/config/locales/fr.yml index f13621dfb..fb1cb4951 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -146,7 +146,7 @@ fr: tab_explainations: a_suivre: Aucun instructeur n’est affecté au suivi de ces dossiers. Soyez le premier ! suivis: Les dossiers qui sont dans cet onglet sont uniquement ceux que vous suivez. Vous pouvez échanger avec le demandeur jusqu'à pouvoir les accepter, les refuser ou les classer sans suite. - traites: "Les dossiers dans cet onglet sont terminés : ils ont été acceptés, refusés ou classés sans suite." + traites_html: "Les dossiers dans cet onglet sont terminés : ils ont été acceptés, refusés ou classés sans suite. Vous pouvez télécharger les archives au format zip des dossiers terminés et leurs pièces jointes." tous: Tous les dossiers qui ont été déposés sur cette démarche, quel que soit le statut. supprimes_recemment: Tous les dossiers terminés et supprimés par les instructeurs sur cette démarche archives: "Les dossiers de cet onglet sont archivés : vous ne pouvez plus y répondre, et les demandeurs ne peuvent plus les modifier." diff --git a/config/locales/views/instructeurs/procedures/en.yml b/config/locales/views/instructeurs/procedures/en.yml index 427e8ff81..fd70b140f 100644 --- a/config/locales/views/instructeurs/procedures/en.yml +++ b/config/locales/views/instructeurs/procedures/en.yml @@ -20,21 +20,6 @@ en: download: one: Download a file other: Download %{count} files - download_dossiers: - everything_short: Ask an export in format %{export_format} - everything_csv_html: Ask an export in format .csv
(only folders, without repeatable fields) - everything_xlsx_html: Ask an export in format .xlsx - everything_ods_html: Ask an export in format .ods - monthly_short: Request an export of the last 30 days in the format %{export_format} - monthly_csv_html: Request an export of the last 30 days in the format .csv
(only folders, without repeatable fields) - monthly_xlsx_html: Request an export of the last 30 days in the format .xlsx - monthly_ods_html: Request an export of the last 30 days in the format .ods - export_everything_ready_html: Download the export in the format %{export_format}
(generated %{export_time} ago) - export_everything_pending_html: An export in the format %{export_format} is being generated
(asked %{export_time} ago) - export_monthly_ready_html: Request an export of the last 30 days in the format %{export_format}
(generated %{export_time} ago) - export_monthly_pending_html: An export of the last 30 days in the format %{export_format} is being generated
(asked %{export_time} ago) - download_archive: Download a .zip archive of all files and their attachments - download: Download all files email_usagers: contact_users: Contact users (draft) notice: "You will send a message to %{dossiers_count} whose files are in draft, in the instructor groups : %{groupe_instructeurs}." diff --git a/config/locales/views/instructeurs/procedures/fr.yml b/config/locales/views/instructeurs/procedures/fr.yml index 66e3d3a92..7d9f79ed1 100644 --- a/config/locales/views/instructeurs/procedures/fr.yml +++ b/config/locales/views/instructeurs/procedures/fr.yml @@ -20,21 +20,6 @@ fr: download: one: Télécharger un dossier other: Télécharger %{count} dossiers - download_dossiers: - everything_short: Demander un export au format %{export_format} - everything_csv_html: Demander un export au format .csv
(uniquement les dossiers, sans les champs répétables) - everything_xlsx_html: Demander un export au format .xlsx - everything_ods_html: Demander un export au format .ods - monthly_short: Demander un export des 30 derniers jours au format %{export_format} - monthly_csv_html: Demander un export des 30 derniers jours au format .csv
(uniquement les dossiers, sans les champs répétables) - monthly_xlsx_html: Demander un export des 30 derniers jours au format .xlsx - monthly_ods_html: Demander un export des 30 derniers jours au format .ods - export_everything_ready_html: Télécharger l’export au format %{export_format}
(généré il y a %{export_time}) - export_everything_pending_html: Un export au format %{export_format} est en train d’être généré
(demandé il y a %{export_time}) - export_monthly_ready_html: Télécharger l’export des 30 derniers jours au format %{export_format}
(généré il y a %{export_time}) - export_monthly_pending_html: Un export des 30 derniers jours au format %{export_format} est en train d’être généré
(demandé il y a %{export_time}) - download_archive: Télécharger une archive au format .zip de tous les dossiers et leurs pièces jointes - download: Télécharger tous les dossiers email_usagers: contact_users: Contacter les usagers (brouillon) notice: "Vous allez envoyer un message à %{dossiers_count} dont les dossiers sont en brouillon, dans les groupes instructeurs : %{groupe_instructeurs}." diff --git a/spec/system/instructeurs/instruction_spec.rb b/spec/system/instructeurs/instruction_spec.rb index a2651b4ac..8fa9daaf1 100644 --- a/spec/system/instructeurs/instruction_spec.rb +++ b/spec/system/instructeurs/instruction_spec.rb @@ -104,18 +104,6 @@ describe 'Instructing a dossier:', js: true do test_statut_bar(a_suivre: 1, tous_les_dossiers: 1) assert_performed_jobs 1 - click_on "Télécharger tous les dossiers" - within(:css, '.procedure-actions') do - click_on "Demander un export au format .xlsx" - end - expect(page).to have_text('Nous générons cet export.') - expect(page).to have_text('Un export au format .xlsx est en train d’être généré') - - click_on "Télécharger tous les dossiers" - click_on "Demander un export des 30 derniers jours au format .xlsx" - expect(page).to have_text('Nous générons cet export.') - expect(page).to have_text('Un export des 30 derniers jours au format .xlsx est en train d’être généré') - click_on "Télécharger un dossier" within(:css, '.dossiers-export') do click_on "Demander un export au format .csv" @@ -124,17 +112,11 @@ describe 'Instructing a dossier:', js: true do expect(page).to have_text('Un export au format .csv est en train d’être généré') perform_enqueued_jobs(only: ExportJob) - assert_performed_jobs 4 + assert_performed_jobs 2 page.driver.browser.navigate.refresh - click_on "Télécharger tous les dossiers" - expect(page).to have_text('Télécharger l’export au format .xlsx') - expect(page).to have_text('Télécharger l’export des 30 derniers jours au format .xlsx') - # close dropdown menu - click_on "Télécharger tous les dossiers" - click_on "Télécharger un dossier" - expect(page).to have_text('Télécharger l’export au format .xlsx') + expect(page).to have_text('Télécharger l’export au format .csv') end scenario 'A instructeur can see the personnes impliquées' do