improve/add translations

This commit is contained in:
Lisa Durand 2023-05-02 15:10:36 +02:00
parent 24eca40f66
commit 6113c0b75e
5 changed files with 27 additions and 15 deletions

View file

@ -1,4 +1,6 @@
class Dossiers::UserFilterComponent < ApplicationComponent class Dossiers::UserFilterComponent < ApplicationComponent
include DossierHelper
def initialize(statut:, filter:) def initialize(statut:, filter:)
@statut = statut @statut = statut
@filter = filter @filter = filter

View file

@ -1,3 +1,8 @@
en: en:
legend: legend:
states: States states: States
created_at: Creation date
depose_at: Submission date
button:
apply_filters: Apply filters
reset_filters: Reset filters

View file

@ -1,3 +1,8 @@
fr: fr:
legend: legend:
states: États states: États
created_at: Date de création
depose_at: Date de dépot
button:
apply_filters: Appliquer les filtres
reset_filters: Réinitialiser les filtres

View file

@ -9,20 +9,20 @@
.fr-fieldset__element.fr-fieldset__element--inline .fr-fieldset__element.fr-fieldset__element--inline
.fr-checkbox-group.fr-ml-2w.fr-py-1w .fr-checkbox-group.fr-ml-2w.fr-py-1w
= b.check_box(checked: filter.states_filtered?(b.value)) = b.check_box(checked: filter.states_filtered?(b.value))
= b.label(class: 'fr-label') { t b.text, scope: 'activerecord.attributes.procedure.aasm_state' } = b.label(class: 'fr-label') { dossier_display_state(b.text) }
.fr-col-12.fr-col-md-3 .fr-col-12.fr-col-md-3
.fr-input-group .fr-input-group
= f.label 'from_created_at_date', 'Dossier créé depuis le', class: 'fr-label' = f.label 'from_created_at_date', t('.legend.created_at'), class: 'fr-label'
= f.date_field 'from_created_at_date', value: @filter.from_created_at_date, class: 'fr-input' = f.date_field 'from_created_at_date', value: @filter.from_created_at_date, class: 'fr-input'
.fr-col-12.fr-col-md-3 .fr-col-12.fr-col-md-3
.fr-input-group .fr-input-group
= f.label 'from_depose_at_date', 'Dossier déposé depuis le', class: 'fr-label' = f.label 'from_depose_at_date', t('.legend.depose_at'), class: 'fr-label'
= f.date_field 'from_depose_at_date', value: @filter.from_depose_at_date, class: 'fr-input' = f.date_field 'from_depose_at_date', value: @filter.from_depose_at_date, class: 'fr-input'
.fr-mb-2w .fr-mb-2w
= f.submit 'Appliquer les filtres', class: 'fr-btn fr-btn--sm' = f.submit t('.button.apply_filters'), class: 'fr-btn fr-btn--sm'
= link_to 'Réinitialiser les filtres', dossiers_path(statut: @statut), class: 'fr-btn fr-btn--sm fr-btn--tertiary-no-outline' = link_to t('.button.reset_filters'), dossiers_path(statut: @statut), class: 'fr-btn fr-btn--sm fr-btn--tertiary-no-outline'
%hr %hr

View file

@ -62,8 +62,8 @@ describe 'user access to the list of their dossiers', js: true do
expect(page).to have_text('2 traités') expect(page).to have_text('2 traités')
expect(page).to have_text('4 sur 4 dossiers') expect(page).to have_text('4 sur 4 dossiers')
expect(page).to have_text('Brouillon') expect(page).to have_text('Brouillon')
expect(page).to have_text('En Construction') expect(page).to have_text('En construction')
expect(page).to have_text('En Instruction') expect(page).to have_text('En instruction')
find("label", text: "Brouillon").click find("label", text: "Brouillon").click
click_on('Appliquer les filtres') click_on('Appliquer les filtres')
expect(page).to have_text('1 dossier') expect(page).to have_text('1 dossier')
@ -75,16 +75,16 @@ describe 'user access to the list of their dossiers', js: true do
expect(page).to have_text('4 en cours') expect(page).to have_text('4 en cours')
expect(page).to have_text('2 traités') expect(page).to have_text('2 traités')
expect(page).to have_text('2 sur 2 dossiers') expect(page).to have_text('2 sur 2 dossiers')
expect(page).to have_text('Accepte') expect(page).to have_text('Accepté')
expect(page).to have_text('Refuse') expect(page).to have_text('Refusé')
expect(page).to have_text('Sans Suite') expect(page).to have_text('Classé sans suite')
find("label", text: "Refuse").click find("label", text: "Refusé").click
click_on('Appliquer les filtres') click_on('Appliquer les filtres')
expect(page).to have_text('1 dossier') expect(page).to have_text('1 dossier')
expect(page).to have_checked_field('Refuse') expect(page).to have_checked_field('Refusé')
click_on('Réinitialiser les filtres') click_on('Réinitialiser les filtres')
expect(page).to have_text('2 sur 2 dossiers') expect(page).to have_text('2 sur 2 dossiers')
expect(page).to have_unchecked_field('Refuse') expect(page).to have_unchecked_field('Refusé')
end end
scenario 'user filters by created_at' do scenario 'user filters by created_at' do
@ -105,8 +105,8 @@ describe 'user access to the list of their dossiers', js: true do
click_on('Appliquer les filtres') click_on('Appliquer les filtres')
expect(page).to have_text('3 sur 3 dossiers') expect(page).to have_text('3 sur 3 dossiers')
find("label", text: "En Construction").click find("label", text: "En construction").click
find("label", text: "En Instruction").click find("label", text: "En instruction").click
click_on('Appliquer les filtres') click_on('Appliquer les filtres')
expect(page).to have_text('2 sur 2 dossiers') expect(page).to have_text('2 sur 2 dossiers')