feat(naming): enhance naming of dates columns.
This commit is contained in:
parent
fa50e21101
commit
26a078bc45
8 changed files with 48 additions and 48 deletions
|
@ -22,7 +22,7 @@ en:
|
|||
sva_decision_before: SVA decision date before
|
||||
svr_decision_on: Date décision %{type}
|
||||
svr_decision_before: SVR decision date before
|
||||
user_from_france_connect?: "FranceConnect ?"
|
||||
user_from_france_connect?: "France connecté ?"
|
||||
for_tiers: "For tiers"
|
||||
mandataire_last_name: "Tier last name"
|
||||
mandataire_first_name: "Tier first name"
|
||||
|
|
|
@ -7,28 +7,28 @@ fr:
|
|||
id: Nº dossier
|
||||
user_email_for_display: Email
|
||||
state: État du dossier
|
||||
created_at: Créé le
|
||||
updated_at: Dernière mise à jour le
|
||||
depose_at: Déposé le
|
||||
en_construction_at: Passé en construction le
|
||||
en_instruction_at: Passé en instruction le
|
||||
processed_at: Traité le
|
||||
updated_since: Mis à jour depuis
|
||||
created_at: Date de création
|
||||
updated_at: Date du dernier évènement
|
||||
depose_at: Date de dépot
|
||||
en_construction_at: Date de passage en construction
|
||||
en_instruction_at: Date de passage en instruction
|
||||
processed_at: Date de traitement
|
||||
updated_since: Dernier évènement depuis
|
||||
depose_since: Déposé depuis
|
||||
en_construction_since: En construction depuis
|
||||
en_instruction_since: En instruction depuis
|
||||
processed_since: Terminé depuis
|
||||
processed_since: Traité depuis
|
||||
sva_decision_on: Date décision %{type}
|
||||
sva_decision_before: Date décision SVA avant
|
||||
svr_decision_on: Date décision %{type}
|
||||
svr_decision_before: Date décision SVR avant
|
||||
user_from_france_connect?: "FranceConnect ?"
|
||||
user_from_france_connect?: "France connecté ?"
|
||||
for_tiers: "Dépôt pour un tiers"
|
||||
mandataire_last_name: "Nom du mandataire"
|
||||
mandataire_first_name: "Prénom du mandataire"
|
||||
archived: 'Archivé'
|
||||
dossier_state: 'État du dossier'
|
||||
last_champ_updated_at: 'Dernière mise à jour du dossier le'
|
||||
last_champ_updated_at: Date de dernière modification (usager)
|
||||
motivation: 'Motivation de la décision'
|
||||
user:
|
||||
id: Identifiant du demandeur
|
||||
|
|
|
@ -31,26 +31,26 @@ describe ColumnsConcern do
|
|||
[
|
||||
{ label: 'Dossier ID', table: 'self', column: 'id', displayable: true, type: :number, scope: '', value_column: :value, filterable: true },
|
||||
{ label: 'notifications', table: 'notifications', column: 'notifications', displayable: true, type: :text, scope: '', value_column: :value, filterable: false },
|
||||
{ label: 'Créé le', table: 'self', column: 'created_at', displayable: true, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: 'Date de création', table: 'self', column: 'created_at', displayable: true, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: 'Mis à jour le', table: 'self', column: 'updated_at', displayable: true, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: 'Déposé le', table: 'self', column: 'depose_at', displayable: true, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: 'Date de dépot', table: 'self', column: 'depose_at', displayable: true, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: 'En construction le', table: 'self', column: 'en_construction_at', displayable: true, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: 'En instruction le', table: 'self', column: 'en_instruction_at', displayable: true, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: 'Terminé le', table: 'self', column: 'processed_at', displayable: true, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: "Mis à jour depuis", table: "self", column: "updated_since", displayable: false, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: "Dernier évènement depuis", table: "self", column: "updated_since", displayable: false, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: "Déposé depuis", table: "self", column: "depose_since", displayable: false, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: "En construction depuis", table: "self", column: "en_construction_since", displayable: false, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: "En instruction depuis", table: "self", column: "en_instruction_since", displayable: false, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: "Terminé depuis", table: "self", column: "processed_since", displayable: false, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: "Traité depuis", table: "self", column: "processed_since", displayable: false, type: :date, scope: '', value_column: :value, filterable: true },
|
||||
{ label: "Statut", table: "self", column: "state", displayable: false, scope: 'instructeurs.dossiers.filterable_state', type: :enum, value_column: :value, filterable: true },
|
||||
{ label: "Archivé", table: "self", column: "archived", displayable: false, scope: '', type: :text, value_column: :value, filterable: false },
|
||||
{ label: "Motivation de la décision", table: "self", column: "motivation", displayable: false, scope: '', type: :text, value_column: :value, filterable: false },
|
||||
{ label: "Dernière mise à jour du dossier le", table: "self", column: "last_champ_updated_at", displayable: false, scope: '', type: :text, value_column: :value, filterable: false },
|
||||
{ label: "Date de dernière modification (usager)", table: "self", column: "last_champ_updated_at", displayable: false, scope: '', type: :text, value_column: :value, filterable: false },
|
||||
{ label: 'Demandeur', table: 'user', column: 'email', displayable: true, type: :text, scope: '', value_column: :value, filterable: true },
|
||||
{ label: 'Email instructeur', table: 'followers_instructeurs', column: 'email', displayable: true, type: :text, scope: '', value_column: :value, filterable: true },
|
||||
{ label: 'Groupe instructeur', table: 'groupe_instructeur', column: 'id', displayable: true, type: :enum, scope: '', value_column: :value, filterable: true },
|
||||
{ label: 'Avis oui/non', table: 'avis', column: 'question_answer', displayable: true, type: :text, scope: '', value_column: :value, filterable: false },
|
||||
{ label: 'FranceConnect ?', table: 'self', column: 'user_from_france_connect?', displayable: false, type: :text, scope: '', value_column: :value, filterable: false },
|
||||
{ label: 'France connecté ?', table: 'self', column: 'user_from_france_connect?', displayable: false, type: :text, scope: '', value_column: :value, filterable: false },
|
||||
{ label: 'SIREN', table: 'etablissement', column: 'entreprise_siren', displayable: true, type: :text, scope: '', value_column: :value, filterable: true },
|
||||
{ label: 'Forme juridique', table: 'etablissement', column: 'entreprise_forme_juridique', displayable: true, type: :text, scope: '', value_column: :value, filterable: true },
|
||||
{ label: 'Nom commercial', table: 'etablissement', column: 'entreprise_nom_commercial', displayable: true, type: :text, scope: '', value_column: :value, filterable: true },
|
||||
|
@ -154,7 +154,7 @@ describe ColumnsConcern do
|
|||
expected = [
|
||||
procedure.find_column(label: "Nº dossier"),
|
||||
procedure.find_column(label: "Email"),
|
||||
procedure.find_column(label: "FranceConnect ?"),
|
||||
procedure.find_column(label: "France connecté ?"),
|
||||
procedure.find_column(label: "Civilité"),
|
||||
procedure.find_column(label: "Nom"),
|
||||
procedure.find_column(label: "Prénom"),
|
||||
|
@ -176,7 +176,7 @@ describe ColumnsConcern do
|
|||
expected = [
|
||||
procedure.find_column(label: "Nº dossier"),
|
||||
procedure.find_column(label: "Email"),
|
||||
procedure.find_column(label: "FranceConnect ?"),
|
||||
procedure.find_column(label: "France connecté ?"),
|
||||
procedure.find_column(label: "Établissement SIRET"),
|
||||
procedure.find_column(label: "Établissement siège social"),
|
||||
procedure.find_column(label: "Établissement NAF"),
|
||||
|
@ -232,11 +232,11 @@ describe ColumnsConcern do
|
|||
expected = [
|
||||
procedure.find_column(label: "Archivé"),
|
||||
procedure.find_column(label: "État du dossier"),
|
||||
procedure.find_column(label: "Dernière mise à jour le"),
|
||||
procedure.find_column(label: "Dernière mise à jour du dossier le"),
|
||||
procedure.find_column(label: "Déposé le"),
|
||||
procedure.find_column(label: "Passé en instruction le"),
|
||||
procedure.find_column(label: "Traité le"),
|
||||
procedure.find_column(label: "Date du dernier évènement"),
|
||||
procedure.find_column(label: "Date de dernière modification (usager)"),
|
||||
procedure.find_column(label: "Date de dépot"),
|
||||
procedure.find_column(label: "Date de passage en instruction"),
|
||||
procedure.find_column(label: "Date de traitement"),
|
||||
procedure.find_column(label: "Motivation de la décision"),
|
||||
procedure.find_column(label: "Instructeurs"),
|
||||
procedure.find_column(label: "Groupe instructeur")
|
||||
|
|
|
@ -81,7 +81,7 @@ RSpec.describe Export, type: :model do
|
|||
let(:instructeur) { create(:instructeur) }
|
||||
let!(:gi_1) { create(:groupe_instructeur, procedure: procedure, instructeurs: [instructeur]) }
|
||||
let!(:pp) { gi_1.instructeurs.first.procedure_presentation_and_errors_for_procedure_id(procedure.id).first }
|
||||
let(:created_at_column) { FilteredColumn.new(column: procedure.find_column(label: 'Créé le'), filter: '10/12/2021') }
|
||||
let(:created_at_column) { FilteredColumn.new(column: procedure.find_column(label: 'Date de création'), filter: '10/12/2021') }
|
||||
|
||||
before { pp.update(tous_filters: [created_at_column]) }
|
||||
|
||||
|
@ -95,7 +95,7 @@ RSpec.describe Export, type: :model do
|
|||
expect { Export.find_or_create_fresh_export(:zip, [gi_1], instructeur, time_span_type: Export.time_span_types.fetch(:everything), statut: Export.statuts.fetch(:tous), procedure_presentation: pp) }
|
||||
.to change { Export.count }.by(1)
|
||||
|
||||
update_at_column = FilteredColumn.new(column: procedure.find_column(label: 'Dernière mise à jour le'), filter: '10/12/2021')
|
||||
update_at_column = FilteredColumn.new(column: procedure.find_column(label: 'Date du dernier évènement'), filter: '10/12/2021')
|
||||
pp.update(tous_filters: [created_at_column, update_at_column])
|
||||
|
||||
expect { Export.find_or_create_fresh_export(:zip, [gi_1], instructeur, time_span_type: Export.time_span_types.fetch(:everything), statut: Export.statuts.fetch(:tous), procedure_presentation: pp) }
|
||||
|
@ -181,7 +181,7 @@ RSpec.describe Export, type: :model do
|
|||
let(:statut) { 'tous' }
|
||||
|
||||
let(:procedure_presentation) do
|
||||
statut_column = procedure.find_column(label: 'État du dossier')
|
||||
statut_column = procedure.dossier_state_column
|
||||
en_construction_filter = FilteredColumn.new(column: statut_column, filter: 'en_construction')
|
||||
create(:procedure_presentation,
|
||||
procedure:,
|
||||
|
|
|
@ -85,7 +85,7 @@ describe ProcedurePresentation do
|
|||
end
|
||||
|
||||
context 'when filter is a date' do
|
||||
let(:filtered_column) { to_filter(['Créé le', "15/06/2023"]) }
|
||||
let(:filtered_column) { to_filter(['Date de création', "15/06/2023"]) }
|
||||
|
||||
it 'should get formatted value' do
|
||||
expect(subject).to eq("15/06/2023")
|
||||
|
@ -94,8 +94,8 @@ describe ProcedurePresentation do
|
|||
end
|
||||
|
||||
describe '#update_displayed_fields' do
|
||||
let(:en_construction_column) { procedure.find_column(label: 'Passé en construction le') }
|
||||
let(:mise_a_jour_column) { procedure.find_column(label: 'Dernière mise à jour le') }
|
||||
let(:en_construction_column) { procedure.find_column(label: 'Date de passage en construction') }
|
||||
let(:mise_a_jour_column) { procedure.find_column(label: 'Date du dernier évènement') }
|
||||
|
||||
let(:procedure_presentation) do
|
||||
create(:procedure_presentation, assign_to:).tap do |pp|
|
||||
|
|
|
@ -102,7 +102,7 @@ describe DossierFilterService do
|
|||
let(:order) { 'asc' } # Desc works the same, no extra test required
|
||||
|
||||
context 'for created_at column' do
|
||||
let!(:column) { procedure.find_column(label: 'Créé le') }
|
||||
let!(:column) { procedure.find_column(label: 'Date de création') }
|
||||
let!(:recent_dossier) { Timecop.freeze(Time.zone.local(2018, 10, 17)) { create(:dossier, procedure:) } }
|
||||
let!(:older_dossier) { Timecop.freeze(Time.zone.local(2003, 11, 11)) { create(:dossier, procedure:) } }
|
||||
|
||||
|
@ -110,7 +110,7 @@ describe DossierFilterService do
|
|||
end
|
||||
|
||||
context 'for en_construction_at column' do
|
||||
let!(:column) { procedure.find_column(label: 'Passé en construction le') }
|
||||
let!(:column) { procedure.find_column(label: 'Date de passage en construction') }
|
||||
let!(:recent_dossier) { create(:dossier, :en_construction, procedure:, en_construction_at: Time.zone.local(2018, 10, 17)) }
|
||||
let!(:older_dossier) { create(:dossier, :en_construction, procedure:, en_construction_at: Time.zone.local(2013, 1, 1)) }
|
||||
|
||||
|
@ -118,7 +118,7 @@ describe DossierFilterService do
|
|||
end
|
||||
|
||||
context 'for updated_at column' do
|
||||
let(:column) { procedure.find_column(label: 'Dernière mise à jour le') }
|
||||
let(:column) { procedure.find_column(label: 'Date du dernier évènement') }
|
||||
let(:recent_dossier) { create(:dossier, procedure:) }
|
||||
let(:older_dossier) { create(:dossier, procedure:) }
|
||||
|
||||
|
@ -297,7 +297,7 @@ describe DossierFilterService do
|
|||
|
||||
context 'for self table' do
|
||||
context 'for created_at column' do
|
||||
let(:filter) { ['Créé le', '18/9/2018'] }
|
||||
let(:filter) { ['Date de création', '18/9/2018'] }
|
||||
|
||||
let!(:kept_dossier) { create(:dossier, procedure:, created_at: Time.zone.local(2018, 9, 18, 14, 28)) }
|
||||
let!(:discarded_dossier) { create(:dossier, procedure:, created_at: Time.zone.local(2018, 9, 17, 23, 59)) }
|
||||
|
@ -306,7 +306,7 @@ describe DossierFilterService do
|
|||
end
|
||||
|
||||
context 'for en_construction_at column' do
|
||||
let(:filter) { ['Passé en construction le', '17/10/2018'] }
|
||||
let(:filter) { ['Date de passage en construction', '17/10/2018'] }
|
||||
|
||||
let!(:kept_dossier) { create(:dossier, :en_construction, procedure:, en_construction_at: Time.zone.local(2018, 10, 17)) }
|
||||
let!(:discarded_dossier) { create(:dossier, :en_construction, procedure:, en_construction_at: Time.zone.local(2013, 1, 1)) }
|
||||
|
@ -315,7 +315,7 @@ describe DossierFilterService do
|
|||
end
|
||||
|
||||
context 'for updated_at column' do
|
||||
let(:filter) { ['Dernière mise à jour le', '18/9/2018'] }
|
||||
let(:filter) { ['Date du dernier évènement', '18/9/2018'] }
|
||||
|
||||
let(:kept_dossier) { create(:dossier, procedure:) }
|
||||
let(:discarded_dossier) { create(:dossier, procedure:) }
|
||||
|
@ -329,7 +329,7 @@ describe DossierFilterService do
|
|||
end
|
||||
|
||||
context 'for updated_since column' do
|
||||
let(:filter) { ['Mis à jour depuis', '18/9/2018'] }
|
||||
let(:filter) { ['Dernier évènement depuis', '18/9/2018'] }
|
||||
|
||||
let(:kept_dossier) { create(:dossier, procedure:) }
|
||||
let(:later_dossier) { create(:dossier, procedure:) }
|
||||
|
@ -362,7 +362,7 @@ describe DossierFilterService do
|
|||
end
|
||||
|
||||
context 'ignore time of day' do
|
||||
let(:filter) { ['Passé en construction le', '17/10/2018 19:30'] }
|
||||
let(:filter) { ['Date de passage en construction', '17/10/2018 19:30'] }
|
||||
|
||||
let!(:kept_dossier) { create(:dossier, :en_construction, procedure:, en_construction_at: Time.zone.local(2018, 10, 17, 15, 56)) }
|
||||
let!(:discarded_dossier) { create(:dossier, :en_construction, procedure:, en_construction_at: Time.zone.local(2018, 10, 18, 5, 42)) }
|
||||
|
@ -372,20 +372,20 @@ describe DossierFilterService do
|
|||
|
||||
context 'for a malformed date' do
|
||||
context 'when its a string' do
|
||||
let(:filter) { ['Dernière mise à jour le', 'malformed date'] }
|
||||
let(:filter) { ['Date du dernier évènement', 'malformed date'] }
|
||||
|
||||
it { is_expected.to match([]) }
|
||||
end
|
||||
|
||||
context 'when its a number' do
|
||||
let(:filter) { ['Dernière mise à jour le', '177500'] }
|
||||
let(:filter) { ['Date du dernier évènement', '177500'] }
|
||||
|
||||
it { is_expected.to match([]) }
|
||||
end
|
||||
end
|
||||
|
||||
context 'with multiple search values' do
|
||||
let(:filters) { [['Passé en construction le', '17/10/2018'], ['Passé en construction le', '19/10/2018']] }
|
||||
let(:filters) { [['Date de passage en construction', '17/10/2018'], ['Date de passage en construction', '19/10/2018']] }
|
||||
|
||||
let!(:kept_dossier) { create(:dossier, :en_construction, procedure:, en_construction_at: Time.zone.local(2018, 10, 17)) }
|
||||
let!(:other_kept_dossier) { create(:dossier, :en_construction, procedure:, en_construction_at: Time.zone.local(2018, 10, 19)) }
|
||||
|
|
|
@ -80,28 +80,28 @@ describe DossierProjectionService do
|
|||
|
||||
context 'for self table' do
|
||||
context 'for created_at column' do
|
||||
let(:label) { 'Créé le' }
|
||||
let(:label) { 'Date de création' }
|
||||
let(:dossier) { Timecop.freeze(Time.zone.local(1992, 3, 22)) { create(:dossier, procedure:) } }
|
||||
|
||||
it { is_expected.to eq('22/03/1992') }
|
||||
end
|
||||
|
||||
context 'for en_construction_at column' do
|
||||
let(:label) { 'Passé en construction le' }
|
||||
let(:label) { 'Date de passage en construction' }
|
||||
let(:dossier) { create(:dossier, :en_construction, en_construction_at: Time.zone.local(2018, 10, 17), procedure:) }
|
||||
|
||||
it { is_expected.to eq('17/10/2018') }
|
||||
end
|
||||
|
||||
context 'for depose_at column' do
|
||||
let(:label) { 'Déposé le' }
|
||||
let(:label) { 'Date de dépot' }
|
||||
let(:dossier) { create(:dossier, :en_construction, depose_at: Time.zone.local(2018, 10, 17), procedure:) }
|
||||
|
||||
it { is_expected.to eq('17/10/2018') }
|
||||
end
|
||||
|
||||
context 'for updated_at column' do
|
||||
let(:label) { 'Dernière mise à jour le' }
|
||||
let(:label) { 'Date du dernier évènement' }
|
||||
let(:dossier) { create(:dossier, procedure:) }
|
||||
|
||||
before { dossier.touch(time: Time.zone.local(2018, 9, 25)) }
|
||||
|
|
|
@ -44,9 +44,9 @@ describe "procedure filters" do
|
|||
end
|
||||
|
||||
scenario "should add be able to add created_at column", js: true do
|
||||
add_column("Créé le")
|
||||
add_column("Date de création")
|
||||
within ".dossiers-table" do
|
||||
expect(page).to have_link("Créé le")
|
||||
expect(page).to have_link("Date de création")
|
||||
expect(page).to have_link(new_unfollow_dossier.created_at.strftime('%d/%m/%Y'))
|
||||
end
|
||||
end
|
||||
|
@ -99,7 +99,7 @@ describe "procedure filters" do
|
|||
|
||||
scenario "should be able to user custom fiters", js: true do
|
||||
# use date filter
|
||||
add_filter("Passé en construction le", "10/10/2010", type: :date)
|
||||
add_filter("Date de passage en construction", "10/10/2010", type: :date)
|
||||
|
||||
# use statut dropdown filter
|
||||
add_filter('État du dossier', 'En construction', type: :enum)
|
||||
|
|
Loading…
Reference in a new issue