From ceaf8ebbe797532734343ccd5b0a117babd22eda Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Fri, 7 Oct 2022 14:13:42 +0200 Subject: [PATCH 01/58] fix: orphan tdc due to reset_draft --- app/models/procedure.rb | 1 + spec/models/procedure_spec.rb | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index c75d225ee..d2a3a19ba 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -803,6 +803,7 @@ class Procedure < ApplicationRecord if published_revision.present? && draft_changed? transaction do reset! + draft_revision.types_de_champ.filter(&:only_present_on_draft?).each(&:destroy) draft_revision.update(attestation_template: nil, dossier_submitted_message: nil) draft_revision.destroy update!(draft_revision: create_new_revision(published_revision)) diff --git a/spec/models/procedure_spec.rb b/spec/models/procedure_spec.rb index 69063f825..8080cec63 100644 --- a/spec/models/procedure_spec.rb +++ b/spec/models/procedure_spec.rb @@ -908,7 +908,15 @@ describe Procedure do end context "published procedure" do - let(:procedure) { create(:procedure, :published, attestation_template: create(:attestation_template), dossier_submitted_message: create(:dossier_submitted_message)) } + let(:procedure) do + create( + :procedure, + :published, + attestation_template: create(:attestation_template), + dossier_submitted_message: create(:dossier_submitted_message), + types_de_champ_public: [{ type: :text, libelle: 'published tdc' }] + ) + end it "should reset draft revision" do procedure.draft_revision.add_type_de_champ(tdc_attributes) @@ -924,6 +932,16 @@ describe Procedure do expect(procedure.draft_revision.attestation_template).to eq(previous_attestation_template) expect(procedure.draft_revision.dossier_submitted_message).to eq(previous_dossier_submitted_message) end + + it "should erase orphan tdc" do + published_tdc = procedure.published_revision.types_de_champ.first + draft_tdc = procedure.draft_revision.add_type_de_champ(tdc_attributes) + + procedure.reset_draft_revision! + + expect { published_tdc.reload }.not_to raise_error(ActiveRecord::RecordNotFound) + expect { draft_tdc.reload }.to raise_error(ActiveRecord::RecordNotFound) + end end end From c52b06a84f013fafcde364a9f9e3c560c30f57b1 Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 7 Oct 2022 15:49:49 +0200 Subject: [PATCH 02/58] fix(data): move type de champs engagement to checkbox --- ...07134731_fix_clean_migrate_type_de_champs_engagement.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 db/migrate/20221007134731_fix_clean_migrate_type_de_champs_engagement.rb diff --git a/db/migrate/20221007134731_fix_clean_migrate_type_de_champs_engagement.rb b/db/migrate/20221007134731_fix_clean_migrate_type_de_champs_engagement.rb new file mode 100644 index 000000000..010015d93 --- /dev/null +++ b/db/migrate/20221007134731_fix_clean_migrate_type_de_champs_engagement.rb @@ -0,0 +1,7 @@ +class FixCleanMigrateTypeDeChampsEngagement < ActiveRecord::Migration[6.1] + def change + Champ.where(type: "Champs::EngagementChamp").in_batches do |batch| + batch.update_all(type: 'Champs::CheckboxChamp') + end + end +end From 6752da40a9c80b12cf3de5b7ecec95053e59792b Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 5 Oct 2022 17:49:21 +0200 Subject: [PATCH 03/58] test(procedure.direction): can we drop this column ? --- app/dashboards/procedure_dashboard.rb | 2 -- app/models/procedure.rb | 2 +- app/serializers/procedure_serializer.rb | 1 - .../administrateurs/procedures_controller_spec.rb | 7 ------- spec/controllers/api/v1/procedures_controller_spec.rb | 1 - spec/factories/procedure.rb | 1 - 6 files changed, 1 insertion(+), 13 deletions(-) diff --git a/app/dashboards/procedure_dashboard.rb b/app/dashboards/procedure_dashboard.rb index 544fbe054..79a3451d6 100644 --- a/app/dashboards/procedure_dashboard.rb +++ b/app/dashboards/procedure_dashboard.rb @@ -19,7 +19,6 @@ class ProcedureDashboard < Administrate::BaseDashboard zone: Field::BelongsTo, lien_site_web: Field::String, # TODO: use Field::Url when administrate-v0.12 will be released organisation: Field::String, - direction: Field::String, created_at: Field::DateTime, updated_at: Field::DateTime, for_individual: Field::Boolean, @@ -67,7 +66,6 @@ class ProcedureDashboard < Administrate::BaseDashboard :description, :lien_site_web, :organisation, - :direction, :zone, :service, :created_at, diff --git a/app/models/procedure.rb b/app/models/procedure.rb index d2a3a19ba..c278c17b0 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -62,7 +62,7 @@ class Procedure < ApplicationRecord include Discard::Model self.discard_column = :hidden_at - self.ignored_columns = [:durees_conservation_required, :cerfa_flag, :test_started_at] + self.ignored_columns = [:direction, :durees_conservation_required, :cerfa_flag, :test_started_at] default_scope -> { kept } diff --git a/app/serializers/procedure_serializer.rb b/app/serializers/procedure_serializer.rb index 915dd0d23..c8a8ec98e 100644 --- a/app/serializers/procedure_serializer.rb +++ b/app/serializers/procedure_serializer.rb @@ -6,7 +6,6 @@ class ProcedureSerializer < ActiveModel::Serializer attributes :id, :description, :organisation, - :direction, :archived_at, :geographic_information, :total_dossier, diff --git a/spec/controllers/administrateurs/procedures_controller_spec.rb b/spec/controllers/administrateurs/procedures_controller_spec.rb index 7530ea0d0..f5a03b132 100644 --- a/spec/controllers/administrateurs/procedures_controller_spec.rb +++ b/spec/controllers/administrateurs/procedures_controller_spec.rb @@ -6,7 +6,6 @@ describe Administrateurs::ProceduresController, type: :controller do let(:libelle) { 'Démarche de test' } let(:description) { 'Description de test' } let(:organisation) { 'Organisation de test' } - let(:direction) { 'Direction de test' } let(:ministere) { create(:zone) } let(:cadre_juridique) { 'cadre juridique' } let(:duree_conservation_dossiers_dans_ds) { 3 } @@ -52,7 +51,6 @@ describe Administrateurs::ProceduresController, type: :controller do libelle: libelle, description: description, organisation: organisation, - direction: direction, ministere: ministere, cadre_juridique: cadre_juridique, duree_conservation_dossiers_dans_ds: duree_conservation_dossiers_dans_ds, @@ -206,7 +204,6 @@ describe Administrateurs::ProceduresController, type: :controller do it { expect(subject.libelle).to eq(libelle) } it { expect(subject.description).to eq(description) } it { expect(subject.organisation).to eq(organisation) } - it { expect(subject.direction).to eq(direction) } it { expect(subject.administrateurs).to eq([admin]) } it { expect(subject.duree_conservation_dossiers_dans_ds).to eq(duree_conservation_dossiers_dans_ds) } end @@ -276,7 +273,6 @@ describe Administrateurs::ProceduresController, type: :controller do let(:libelle) { 'Blable' } let(:description) { 'blabla' } let(:organisation) { 'plop' } - let(:direction) { 'plap' } let(:duree_conservation_dossiers_dans_ds) { 7 } let(:procedure_expires_when_termine_enabled) { true } @@ -288,7 +284,6 @@ describe Administrateurs::ProceduresController, type: :controller do it { expect(subject.libelle).to eq(libelle) } it { expect(subject.description).to eq(description) } it { expect(subject.organisation).to eq(organisation) } - it { expect(subject.direction).to eq(direction) } it { expect(subject.duree_conservation_dossiers_dans_ds).to eq(duree_conservation_dossiers_dans_ds) } it { expect(subject.procedure_expires_when_termine_enabled).to eq(true) } end @@ -330,8 +325,6 @@ describe Administrateurs::ProceduresController, type: :controller do it { expect(subject.libelle).to eq procedure_params[:libelle] } it { expect(subject.description).to eq procedure_params[:description] } it { expect(subject.organisation).to eq procedure_params[:organisation] } - it { expect(subject.direction).to eq procedure_params[:direction] } - it { expect(subject.for_individual).not_to eq procedure_params[:for_individual] } end end diff --git a/spec/controllers/api/v1/procedures_controller_spec.rb b/spec/controllers/api/v1/procedures_controller_spec.rb index 9410920ed..c0518a378 100644 --- a/spec/controllers/api/v1/procedures_controller_spec.rb +++ b/spec/controllers/api/v1/procedures_controller_spec.rb @@ -34,7 +34,6 @@ describe API::V1::ProceduresController, type: :controller do it { expect(subject[:label]).to eq(procedure.libelle) } it { expect(subject[:description]).to eq(procedure.description) } it { expect(subject[:organisation]).to eq(procedure.organisation) } - it { expect(subject[:direction]).to eq(procedure.direction) } it { expect(subject[:archived_at]).to eq(procedure.closed_at) } it { expect(subject[:total_dossier]).to eq(procedure.total_dossier) } it { is_expected.to have_key(:types_de_champ) } diff --git a/spec/factories/procedure.rb b/spec/factories/procedure.rb index 04acc4316..84984ac04 100644 --- a/spec/factories/procedure.rb +++ b/spec/factories/procedure.rb @@ -5,7 +5,6 @@ FactoryBot.define do sequence(:libelle) { |n| "Procedure #{n}" } description { "Demande de subvention à l'intention des associations" } organisation { "Orga DINUM" } - direction { "direction DINUM" } cadre_juridique { "un cadre juridique important" } published_at { nil } duree_conservation_dossiers_dans_ds { 3 } From 1f8bf201a2369985a64c6ecd0611861bbcde1f16 Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 6 Oct 2022 11:03:49 +0200 Subject: [PATCH 04/58] feat(procedure_serializer): just add an empty string for direction --- app/serializers/procedure_serializer.rb | 7 ++++++- spec/controllers/api/v1/procedures_controller_spec.rb | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/serializers/procedure_serializer.rb b/app/serializers/procedure_serializer.rb index c8a8ec98e..3ec46cb0d 100644 --- a/app/serializers/procedure_serializer.rb +++ b/app/serializers/procedure_serializer.rb @@ -10,7 +10,8 @@ class ProcedureSerializer < ActiveModel::Serializer :geographic_information, :total_dossier, :link, - :state + :state, + :direction has_one :geographic_information, serializer: ModuleAPICartoSerializer has_many :types_de_champ, serializer: TypeDeChampSerializer @@ -18,6 +19,10 @@ class ProcedureSerializer < ActiveModel::Serializer has_many :types_de_piece_justificative belongs_to :service, serializer: ServiceSerializer + def direction + "" + end + def archived_at object.closed_at&.in_time_zone('UTC') end diff --git a/spec/controllers/api/v1/procedures_controller_spec.rb b/spec/controllers/api/v1/procedures_controller_spec.rb index c0518a378..ab48cf54c 100644 --- a/spec/controllers/api/v1/procedures_controller_spec.rb +++ b/spec/controllers/api/v1/procedures_controller_spec.rb @@ -35,6 +35,7 @@ describe API::V1::ProceduresController, type: :controller do it { expect(subject[:description]).to eq(procedure.description) } it { expect(subject[:organisation]).to eq(procedure.organisation) } it { expect(subject[:archived_at]).to eq(procedure.closed_at) } + it { expect(subject[:direction]).to eq("") } it { expect(subject[:total_dossier]).to eq(procedure.total_dossier) } it { is_expected.to have_key(:types_de_champ) } it { expect(subject[:types_de_champ]).to be_an(Array) } From 1177d861f4cb1d5c9ce34b6985e78e701f10d39d Mon Sep 17 00:00:00 2001 From: Eric Leroy-Terquem Date: Fri, 30 Sep 2022 11:34:55 +0200 Subject: [PATCH 05/58] add validation on routing_criteria_name --- .../administrateurs/groupe_instructeurs_controller.rb | 10 ++++++---- app/models/procedure.rb | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/controllers/administrateurs/groupe_instructeurs_controller.rb b/app/controllers/administrateurs/groupe_instructeurs_controller.rb index e6a36d2c8..4cb339df8 100644 --- a/app/controllers/administrateurs/groupe_instructeurs_controller.rb +++ b/app/controllers/administrateurs/groupe_instructeurs_controller.rb @@ -191,10 +191,12 @@ module Administrateurs end def update_routing_criteria_name - procedure.update!(routing_criteria_name: routing_criteria_name) - - redirect_to admin_procedure_groupe_instructeurs_path(procedure), - notice: "Le libellé est maintenant « #{procedure.routing_criteria_name} »." + if procedure.update(routing_criteria_name: routing_criteria_name) + flash[:notice] = "Le libellé est maintenant « #{procedure.routing_criteria_name} »." + else + flash[:alert] = "Le libellé du routage doit être rempli." + end + redirect_to admin_procedure_groupe_instructeurs_path(procedure) end def update_routing_enabled diff --git a/app/models/procedure.rb b/app/models/procedure.rb index c278c17b0..98d47d10b 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -323,6 +323,7 @@ class Procedure < ApplicationRecord validates :api_entreprise_token, jwt_token: true, allow_blank: true validates :api_particulier_token, format: { with: /\A[A-Za-z0-9\-_=.]{15,}\z/ }, allow_blank: true + validates :routing_criteria_name, presence: true, allow_blank: false before_save :update_juridique_required after_initialize :ensure_path_exists From c921e6e1ee0069823bb12319c8a6d93b3406bfc3 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 10 Oct 2022 10:55:31 +0200 Subject: [PATCH 06/58] fix(ProcedureExportService): downloadable_sorted_batch is scoped by export, no need to re-filter them via downloadablable_sorted_batch otherwise export for supprimes_recemment does not includes dossier.supprimes_recemment --- app/models/dossier.rb | 26 ++++++++++++-------------- spec/models/dossier_spec.rb | 5 ++--- spec/models/export_spec.rb | 25 +++++++++++++++++++++++-- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 55c3574a0..348e0cd6c 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -241,19 +241,8 @@ class Dossier < ApplicationRecord .joins(:traitements) .where(traitements: { processed_at: date.beginning_of_month..date.end_of_month }) end - scope :downloadable_sorted, -> { - state_not_brouillon - .visible_by_administration - .includes( - :user, - :individual, - :followers_instructeurs, - :traitement, - :groupe_instructeur, - :etablissement, - procedure: [:groupe_instructeurs], - avis: [:claimant, :expert] - ).order(depose_at: 'asc') + scope :ordered_for_export, -> { + order(depose_at: 'asc') } scope :en_cours, -> { not_archived.state_en_construction_ou_instruction } scope :without_followers, -> { left_outer_joins(:follows).where(follows: { id: nil }) } @@ -434,7 +423,16 @@ class Dossier < ApplicationRecord end def self.downloadable_sorted_batch - DossierPreloader.new(downloadable_sorted).in_batches + DossierPreloader.new(includes( + :user, + :individual, + :followers_instructeurs, + :traitement, + :groupe_instructeur, + :etablissement, + procedure: [:groupe_instructeurs], + avis: [:claimant, :expert] + ).ordered_for_export).in_batches end def user_deleted? diff --git a/spec/models/dossier_spec.rb b/spec/models/dossier_spec.rb index 06a48df62..6e8ec901b 100644 --- a/spec/models/dossier_spec.rb +++ b/spec/models/dossier_spec.rb @@ -597,14 +597,13 @@ describe Dossier do end end - describe '.downloadable_sorted' do + describe '.ordered_for_export' do let(:procedure) { create(:procedure) } - let!(:dossier) { create(:dossier, :with_entreprise, procedure: procedure, state: Dossier.states.fetch(:brouillon)) } let!(:dossier2) { create(:dossier, :with_entreprise, procedure: procedure, state: Dossier.states.fetch(:en_construction), depose_at: Time.zone.parse('03/01/2010')) } let!(:dossier3) { create(:dossier, :with_entreprise, procedure: procedure, state: Dossier.states.fetch(:en_instruction), depose_at: Time.zone.parse('01/01/2010')) } let!(:dossier4) { create(:dossier, :with_entreprise, procedure: procedure, state: Dossier.states.fetch(:en_instruction), archived: true, depose_at: Time.zone.parse('02/01/2010')) } - subject { procedure.dossiers.downloadable_sorted } + subject { procedure.dossiers.ordered_for_export } it { is_expected.to match([dossier3, dossier4, dossier2]) } end diff --git a/spec/models/export_spec.rb b/spec/models/export_spec.rb index d06371042..f902cd25e 100644 --- a/spec/models/export_spec.rb +++ b/spec/models/export_spec.rb @@ -67,16 +67,23 @@ RSpec.describe Export, type: :model do end describe '.dossiers_for_export' do - let!(:procedure) { create(:procedure, :published) } + let!(:procedure) { create(:procedure, :published, :with_instructeur) } let!(:dossier_brouillon) { create(:dossier, :brouillon, procedure: procedure) } let!(:dossier_en_construction) { create(:dossier, :en_construction, procedure: procedure) } let!(:dossier_en_instruction) { create(:dossier, :en_instruction, procedure: procedure) } let!(:dossier_accepte) { create(:dossier, :accepte, procedure: procedure) } - let(:export) { create(:export, groupe_instructeurs: [procedure.groupe_instructeurs.first]) } + let(:export) do + create(:export, + groupe_instructeurs: [procedure.groupe_instructeurs.first], + procedure_presentation: procedure_presentation, + statut: statut) + end context 'without procedure_presentation or since' do + let(:procedure_presentation) { nil } + let(:statut) { nil } it 'does not includes brouillons' do expect(export.send(:dossiers_for_export)).to include(dossier_en_construction) expect(export.send(:dossiers_for_export)).to include(dossier_en_instruction) @@ -84,5 +91,19 @@ RSpec.describe Export, type: :model do expect(export.send(:dossiers_for_export)).not_to include(dossier_brouillon) end end + + context 'with procedure_presentation and statut supprimes_recemment' do + let(:statut) { 'supprimes_recemment' } + let(:procedure_presentation) do + create(:procedure_presentation, + procedure: procedure, + assign_to: procedure.groupe_instructeurs.first.assign_tos.first) + end + let!(:dossier_recemment_supprime) { create(:dossier, :accepte, procedure: procedure, hidden_by_administration_at: 2.days.ago) } + + it 'includes supprimes_recemment' do + expect(export.send(:dossiers_for_export)).to include(dossier_recemment_supprime) + end + end end end From f32b05e8b41f7e04a82bc3bf1627907cfbda980b Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Mon, 3 Oct 2022 12:51:02 +0200 Subject: [PATCH 07/58] perf(dossier controller): use DossierPreloader --- app/controllers/users/dossiers_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index d260b1deb..217d95f33 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -392,7 +392,7 @@ module Users end def dossier_with_champs - dossier_scope.with_champs.find(params[:id]) + DossierPreloader.new([dossier]).all.first end def should_change_groupe_instructeur? From 5df76d9fecdac5c67338e4481f42617de84c854f Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 4 Oct 2022 17:30:54 +0200 Subject: [PATCH 08/58] refactor(dossier_preloader): remove weird `set_inverse_instance` --- app/models/dossier_preloader.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/models/dossier_preloader.rb b/app/models/dossier_preloader.rb index e643db873..4cf0767e5 100644 --- a/app/models/dossier_preloader.rb +++ b/app/models/dossier_preloader.rb @@ -92,7 +92,6 @@ class DossierPreloader parent_champ.association(:dossier).target = dossier load_champs(parent_champ, :champs, champs, dossier, children_by_parent) - parent_champ.association(:champs).set_inverse_instance(parent_champ) end end end From 01f6e5a06bdf746e74cea23a238fc2127703999f Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 4 Oct 2022 17:31:58 +0200 Subject: [PATCH 09/58] spec(dossier_preloader): add spec --- spec/models/dossier_preloader_spec.rb | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 spec/models/dossier_preloader_spec.rb diff --git a/spec/models/dossier_preloader_spec.rb b/spec/models/dossier_preloader_spec.rb new file mode 100644 index 000000000..610a932bd --- /dev/null +++ b/spec/models/dossier_preloader_spec.rb @@ -0,0 +1,36 @@ +describe DossierPreloader do + let(:types_de_champ) do + [ + { type: :text }, + { type: :repetition, children: [{ type: :text }] } + ] + end + let(:procedure) { create(:procedure, types_de_champ_public: types_de_champ) } + let(:dossier) { create(:dossier, procedure: procedure) } + let(:repetition) { subject.champs.second } + let(:first_child) { subject.champs.second.champs.first } + + describe 'all' do + subject { DossierPreloader.new([dossier]).all.first } + + before { subject } + + it do + count = 0 + + callback = lambda { |*_args| count += 1 } + ActiveSupport::Notifications.subscribed(callback, "sql.active_record") do + expect(subject.id).to eq(dossier.id) + expect(subject.champs.size).to eq(types_de_champ.size) + expect(subject.changed?).to be false + + expect(first_child.type).to eq('Champs::TextChamp') + expect(repetition.id).not_to eq(first_child.id) + expect(subject.champs.first.dossier).to eq(subject) + expect(first_child.parent).to eq(repetition) + end + + expect(count).to eq(1) + end + end +end From 1f95f68fcc960f9b38527cd403b2e72bdbe24aab Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 4 Oct 2022 17:32:45 +0200 Subject: [PATCH 10/58] refactor(dossier_preloader): assign champ.parent --- app/models/dossier_preloader.rb | 4 ++++ spec/models/dossier_preloader_spec.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/dossier_preloader.rb b/app/models/dossier_preloader.rb index 4cf0767e5..1f416da9b 100644 --- a/app/models/dossier_preloader.rb +++ b/app/models/dossier_preloader.rb @@ -80,6 +80,10 @@ class DossierPreloader def load_champs(parent, name, champs, dossier, children_by_parent) champs.each do |champ| champ.association(:dossier).target = dossier + + if parent.is_a?(Champ) + champ.association(:parent).target = parent + end end parent.association(name).target = champs.sort_by do |champ| diff --git a/spec/models/dossier_preloader_spec.rb b/spec/models/dossier_preloader_spec.rb index 610a932bd..c25a58fb2 100644 --- a/spec/models/dossier_preloader_spec.rb +++ b/spec/models/dossier_preloader_spec.rb @@ -30,7 +30,7 @@ describe DossierPreloader do expect(first_child.parent).to eq(repetition) end - expect(count).to eq(1) + expect(count).to eq(0) end end end From 59201680778b470b4a9137855540fb82695fd2a3 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 4 Oct 2022 21:31:25 +0200 Subject: [PATCH 11/58] refactor(dossier_preloader): preload piece_justificative_template --- app/models/dossier_preloader.rb | 2 +- spec/models/dossier_preloader_spec.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/dossier_preloader.rb b/app/models/dossier_preloader.rb index 1f416da9b..9e49256f7 100644 --- a/app/models/dossier_preloader.rb +++ b/app/models/dossier_preloader.rb @@ -32,7 +32,7 @@ class DossierPreloader def load_dossiers(dossiers) all_champs = Champ - .includes(:type_de_champ, piece_justificative_file_attachment: :blob) + .includes(type_de_champ: { piece_justificative_template_attachment: :blob }, piece_justificative_file_attachment: :blob) .where(dossier_id: dossiers) .to_a diff --git a/spec/models/dossier_preloader_spec.rb b/spec/models/dossier_preloader_spec.rb index c25a58fb2..70cd8db30 100644 --- a/spec/models/dossier_preloader_spec.rb +++ b/spec/models/dossier_preloader_spec.rb @@ -27,6 +27,7 @@ describe DossierPreloader do expect(first_child.type).to eq('Champs::TextChamp') expect(repetition.id).not_to eq(first_child.id) expect(subject.champs.first.dossier).to eq(subject) + expect(subject.champs.first.type_de_champ.piece_justificative_template.attached?).to eq(false) expect(first_child.parent).to eq(repetition) end From 7e03f0c8257c7e23ecd5c679862586f102d4cb1b Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Fri, 7 Oct 2022 18:29:44 +0200 Subject: [PATCH 12/58] refactor(dossier_preloader): add load_one api --- app/controllers/users/dossiers_controller.rb | 2 +- app/models/dossier_preloader.rb | 4 ++++ spec/models/dossier_preloader_spec.rb | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 217d95f33..f878a4130 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -392,7 +392,7 @@ module Users end def dossier_with_champs - DossierPreloader.new([dossier]).all.first + DossierPreloader.load_one(dossier) end def should_change_groupe_instructeur? diff --git a/app/models/dossier_preloader.rb b/app/models/dossier_preloader.rb index 9e49256f7..8a566c2cf 100644 --- a/app/models/dossier_preloader.rb +++ b/app/models/dossier_preloader.rb @@ -17,6 +17,10 @@ class DossierPreloader dossiers end + def self.load_one(dossier) + DossierPreloader.new([dossier]).all.first + end + private # returns: { revision_id : { type_de_champ_id : position } } diff --git a/spec/models/dossier_preloader_spec.rb b/spec/models/dossier_preloader_spec.rb index 70cd8db30..f1de07b97 100644 --- a/spec/models/dossier_preloader_spec.rb +++ b/spec/models/dossier_preloader_spec.rb @@ -11,7 +11,7 @@ describe DossierPreloader do let(:first_child) { subject.champs.second.champs.first } describe 'all' do - subject { DossierPreloader.new([dossier]).all.first } + subject { DossierPreloader.load_one(dossier) } before { subject } From 157c3778dfd11450a596af809c5d699397a66780 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Mon, 10 Oct 2022 12:31:22 +0200 Subject: [PATCH 13/58] refactor(dossier_preloader): add option to laod pj_template --- app/models/dossier_preloader.rb | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/app/models/dossier_preloader.rb b/app/models/dossier_preloader.rb index 8a566c2cf..8e1d0f113 100644 --- a/app/models/dossier_preloader.rb +++ b/app/models/dossier_preloader.rb @@ -11,14 +11,14 @@ class DossierPreloader dossiers end - def all + def all(pj_template: false) dossiers = @dossiers.to_a - load_dossiers(dossiers) + load_dossiers(dossiers, pj_template:) dossiers end def self.load_one(dossier) - DossierPreloader.new([dossier]).all.first + DossierPreloader.new([dossier]).all(pj_template: true).first end private @@ -34,9 +34,17 @@ class DossierPreloader end end - def load_dossiers(dossiers) + def load_dossiers(dossiers, pj_template: false) + to_include = [piece_justificative_file_attachment: :blob] + + if pj_template + to_include << { type_de_champ: { piece_justificative_template_attachment: :blob } } + else + to_include << :type_de_champ + end + all_champs = Champ - .includes(type_de_champ: { piece_justificative_template_attachment: :blob }, piece_justificative_file_attachment: :blob) + .includes(to_include) .where(dossier_id: dossiers) .to_a From 402d0dd3dbbc94a08ec26491c40096d153c53fc4 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 30 Mar 2022 18:13:15 +0200 Subject: [PATCH 14/58] Revert "refactor(react): useDeferredValue" This reverts commit cd4d7b5d36644b0fe6c29af6922aa4dd5adf41d4. --- app/javascript/components/ComboSearch.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/javascript/components/ComboSearch.tsx b/app/javascript/components/ComboSearch.tsx index 72c5816b4..28a4ea696 100644 --- a/app/javascript/components/ComboSearch.tsx +++ b/app/javascript/components/ComboSearch.tsx @@ -1,9 +1,5 @@ -import React, { - useState, - useRef, - useDeferredValue, - ChangeEventHandler -} from 'react'; +import React, { useState, useRef, ChangeEventHandler } from 'react'; +import { useDebounce } from 'use-debounce'; import { useQuery } from 'react-query'; import { Combobox, @@ -63,7 +59,7 @@ function ComboSearch({ const [, setExternalId] = useHiddenField(group, 'external_id'); const initialValue = externalValue ? externalValue : controlledValue; const [searchTerm, setSearchTerm] = useState(''); - const debouncedSearchTerm = useDeferredValue(searchTerm); + const [debouncedSearchTerm] = useDebounce(searchTerm, 300); const [value, setValue] = useState(initialValue); const resultsMap = useRef< Record From 5ab880aae74bc8b560c9a8e408ac7f1a91b7adf9 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 10 Oct 2022 17:37:26 +0200 Subject: [PATCH 15/58] chore(yarn): +use-debounce --- package.json | 1 + yarn.lock | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/package.json b/package.json index 5174f0989..e27f0e6f6 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "tiny-invariant": "^1.2.0", "trix": "^1.2.3", "turbo-polyfills": "^0.3.0", + "use-debounce": "^8.0.4", "whatwg-fetch": "^3.0.0", "yet-another-abortcontroller-polyfill": "^0.0.4", "zod": "^3.17.10" diff --git a/yarn.lock b/yarn.lock index 2faa026cb..17f92bac1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4238,6 +4238,11 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" +use-debounce@^8.0.4: + version "8.0.4" + resolved "https://registry.yarnpkg.com/use-debounce/-/use-debounce-8.0.4.tgz#27e93b2f010bd0b8ad06e9fc7de891d9ee5d6b8e" + integrity sha512-fGqsYQzl8kLHF2QpQSgIwgOgJmnh6j5L6SIzQiHdLfwp3q1egUL3btq5Bg2SJysH6A0ILLgT2IqXZKoNJr0nFw== + uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" From 2d7eca9dd29c744a68e9d4eae8f7a889e422edbe Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 10 Oct 2022 21:09:23 +0200 Subject: [PATCH 16/58] feat(combo): debounce only with address / autocomplete binded on API --- app/javascript/components/ComboAdresseSearch.tsx | 1 + app/javascript/components/ComboSearch.tsx | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/javascript/components/ComboAdresseSearch.tsx b/app/javascript/components/ComboAdresseSearch.tsx index b9c91afc3..f6a34a322 100644 --- a/app/javascript/components/ComboAdresseSearch.tsx +++ b/app/javascript/components/ComboAdresseSearch.tsx @@ -25,6 +25,7 @@ export default function ComboAdresseSearch({ minimumInputLength={2} transformResult={({ properties: { label } }) => [label, label, label]} transformResults={(_, result) => (result as RawResult).features} + debounceDelay={300} /> ); diff --git a/app/javascript/components/ComboSearch.tsx b/app/javascript/components/ComboSearch.tsx index 28a4ea696..fe4687da1 100644 --- a/app/javascript/components/ComboSearch.tsx +++ b/app/javascript/components/ComboSearch.tsx @@ -31,6 +31,7 @@ export type ComboSearchProps = { describedby?: string; className?: string; placeholder?: string; + debounceDelay?: number; }; type QueryKey = readonly [ @@ -50,6 +51,7 @@ function ComboSearch({ transformResults = (_, results) => results as Result[], id, describedby, + debounceDelay = 0, ...props }: ComboSearchProps) { invariant(id || onChange, 'ComboSearch: `id` or `onChange` are required'); @@ -59,7 +61,7 @@ function ComboSearch({ const [, setExternalId] = useHiddenField(group, 'external_id'); const initialValue = externalValue ? externalValue : controlledValue; const [searchTerm, setSearchTerm] = useState(''); - const [debouncedSearchTerm] = useDebounce(searchTerm, 300); + const [debouncedSearchTerm] = useDebounce(searchTerm, debounceDelay); const [value, setValue] = useState(initialValue); const resultsMap = useRef< Record From 45459343a79f398ebda5d9715ef0ff6c0e7e88ef Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 11 Oct 2022 09:27:26 +0200 Subject: [PATCH 17/58] =?UTF-8?q?fix(procedure.clone):=20le=20clonage=20de?= =?UTF-8?q?s=20proc=C3=A9dure=20=C3=A9tait=20bloqu=C3=A9=20car=20nous=20av?= =?UTF-8?q?ions=20des=20donn=C3=A9es=20inconsistantes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...kfill_procedure_routing_criteria_name.rake | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/tasks/deployment/20221011071912_backfill_procedure_routing_criteria_name.rake diff --git a/lib/tasks/deployment/20221011071912_backfill_procedure_routing_criteria_name.rake b/lib/tasks/deployment/20221011071912_backfill_procedure_routing_criteria_name.rake new file mode 100644 index 000000000..31d6ffed2 --- /dev/null +++ b/lib/tasks/deployment/20221011071912_backfill_procedure_routing_criteria_name.rake @@ -0,0 +1,20 @@ +namespace :after_party do + desc 'Deployment task: backfill_procedure_routing_criteria_name' + task backfill_procedure_routing_criteria_name: :environment do + puts "Running deploy task 'backfill_procedure_routing_criteria_name'" + + # Put your task implementation HERE. + procedure_without_routing_criteria_name = Procedure.where(routing_criteria_name: nil) + progress = ProgressReport.new(procedure_without_routing_criteria_name.count) + procedure_without_routing_criteria_name.in_batches do |relation| + count = relation.count + relation.update_all(routing_criteria_name: 'Votre ville') + progress.inc(count) + end + progress.finish + # Update task as completed. If you remove the line below, the task will + # run with every deploy (or every time you call after_party:run). + AfterParty::TaskRecord + .create version: AfterParty::TaskRecorder.new(__FILE__).timestamp + end +end From 39990b90e3e02a8e321133a373bb897ba9e3ec49 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 11 Oct 2022 09:29:14 +0200 Subject: [PATCH 18/58] =?UTF-8?q?correctif(traduction):=20certaines=20colo?= =?UTF-8?q?nnes=20des=20d=C3=A9marches=20n'=C3=A9taient=20pas=20traduite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/models/procedure/en.yml | 33 ++++++++++++++++++++++++++ config/locales/models/procedure/fr.yml | 1 + 2 files changed, 34 insertions(+) create mode 100644 config/locales/models/procedure/en.yml diff --git a/config/locales/models/procedure/en.yml b/config/locales/models/procedure/en.yml new file mode 100644 index 000000000..faabb27b6 --- /dev/null +++ b/config/locales/models/procedure/en.yml @@ -0,0 +1,33 @@ +en: + activerecord: + models: + procedure: + one: Procedure + other: Procedure + attributes: + procedure: + path: Public link + organisation: Service + duree_conservation_dossiers_dans_ds: Duration files will be kept + max_duree_conservation_dossiers_dans_ds: Max duration allowed to keep files + aasm_state/brouillon: Draft + aasm_state/publiee: Published + aasm_state/close: Close + aasm_state/hidden: Destroyed + declarative_with_state/en_instruction: Instruction + declarative_with_state/accepte: Accepted + api_particulier_token: Token API Particulier + lien_dpo: DPO contact + routing_criteria_name: Routee criteria name + errors: + models: + procedure: + attributes: + api_particulier_token: + invalid: 'invalid format' + draft_types_de_champ: + format: 'Public field %{message}' + draft_types_de_champ_private: + format: 'Private field %{message}' + lien_dpo: + invalid_uri_or_email: "Fill in with an email or a link" diff --git a/config/locales/models/procedure/fr.yml b/config/locales/models/procedure/fr.yml index 4ce24f240..8e8e6d567 100644 --- a/config/locales/models/procedure/fr.yml +++ b/config/locales/models/procedure/fr.yml @@ -18,6 +18,7 @@ fr: declarative_with_state/accepte: Accepté api_particulier_token: Jeton API Particulier lien_dpo: Contact du DPO + routing_criteria_name: Nommination du routage errors: models: procedure: From cf4ac28735126592d9ea29e456e47d14f2868b88 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 28 Sep 2022 17:41:29 +0200 Subject: [PATCH 19/58] style(stats): button with more space + dsfr --- app/views/stats/index.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/stats/index.html.haml b/app/views/stats/index.html.haml index 20893ac4c..e3f54b980 100644 --- a/app/views/stats/index.html.haml +++ b/app/views/stats/index.html.haml @@ -65,4 +65,4 @@ - if super_admin_signed_in? %h2.new-h2 Téléchargement - = link_to "Télécharger les statistiques (CSV)", stats_download_path(format: :csv), class: 'button secondary' + = link_to "Télécharger les statistiques (CSV)", stats_download_path(format: :csv), class: 'fr-btn fr-btn-primary mb-4' From 36589c186cd3d21d918cf1538d9ce349714f27c2 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 28 Sep 2022 19:26:44 +0200 Subject: [PATCH 20/58] style(colors): fix exact colors for some DSFR components like footer links --- app/assets/stylesheets/common.scss | 4 ++-- app/assets/stylesheets/dsfr.scss | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index d3c4c3131..1c675ac6a 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -45,12 +45,12 @@ strong { font-weight: bold; } -a[target="_blank"]::after { +a[target="_blank"]:not([class^="fr-"])::after { content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==); margin: 0 3px 0 5px; } -a { +a:not([class^="fr-"]) { color: $blue-france-500; } diff --git a/app/assets/stylesheets/dsfr.scss b/app/assets/stylesheets/dsfr.scss index 00e2f52c2..09e157743 100644 --- a/app/assets/stylesheets/dsfr.scss +++ b/app/assets/stylesheets/dsfr.scss @@ -15,9 +15,11 @@ select { background: $white; } -#footer a { - color: #333333; +.fr-footer__bottom-link { + // re-apply color unsetted by our common "a" rule setting a blue + color: var(--text-mention-grey); } + // with Marianne font, weight of font is less bolder, so bold it up .button.primary { font-weight: bold; From 1e9d5b753c895514668370ee0ef3da0afe582800 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 3 Oct 2022 13:43:29 +0200 Subject: [PATCH 21/58] refactor(footer): licence sentence in partial --- app/views/root/_footer.html.haml | 6 +----- app/views/shared/_footer_copy.html.haml | 5 +++++ app/views/users/_procedure_footer.html.haml | 6 +----- 3 files changed, 7 insertions(+), 10 deletions(-) create mode 100644 app/views/shared/_footer_copy.html.haml diff --git a/app/views/root/_footer.html.haml b/app/views/root/_footer.html.haml index 753d76d00..48d0d899d 100644 --- a/app/views/root/_footer.html.haml +++ b/app/views/root/_footer.html.haml @@ -66,8 +66,4 @@ .fr-footer__bottom = render partial: 'users/general_footer_row' - .fr-footer__bottom-copy - %p - Sauf mention contraire, tous les contenus de ce site sont sous - %a{ href: "https://github.com/etalab/licence-ouverte/blob/master/LO.md", target:"_blank" } licence etalab-2.0 - %br + = render partial: 'shared/footer_copy' diff --git a/app/views/shared/_footer_copy.html.haml b/app/views/shared/_footer_copy.html.haml new file mode 100644 index 000000000..b14146fe4 --- /dev/null +++ b/app/views/shared/_footer_copy.html.haml @@ -0,0 +1,5 @@ +.fr-footer__bottom-copy + %p + Sauf mention contraire, tous les contenus de ce site sont sous + %a{ href: "https://github.com/etalab/licence-ouverte/blob/master/LO.md", target:"_blank", class: "fr-underlined" } licence etalab-2.0 + %br diff --git a/app/views/users/_procedure_footer.html.haml b/app/views/users/_procedure_footer.html.haml index a1d8b1153..3046ececa 100644 --- a/app/views/users/_procedure_footer.html.haml +++ b/app/views/users/_procedure_footer.html.haml @@ -81,8 +81,4 @@ .fr-footer__bottom = render partial: 'users/general_footer_row', locals: { dossier: dossier } - .fr-footer__bottom-copy - %p - Sauf mention contraire, tous les contenus de ce site sont sous - %a.fr-underlined{ href: "https://github.com/etalab/licence-ouverte/blob/master/LO.md", target:"_blank" } licence etalab-2.0 - %br + = render partial: 'shared/footer_copy' From 5a50383a27b47fc5f85e3bad9b445943c13d0784 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Tue, 4 Oct 2022 13:17:25 +0200 Subject: [PATCH 22/58] style: download links (notice & template) with expected DSFR design & details Closes #7829 --- .../edit_component/edit_component.html.haml | 6 ++++-- app/helpers/application_helper.rb | 4 ++++ app/javascript/entrypoints/main.css | 1 + app/views/shared/dossiers/_edit.html.haml | 19 +++++++++++-------- config/locales/en.yml | 2 +- config/locales/fr.yml | 2 +- .../dossiers/brouillon.html.haml_spec.rb | 5 +++-- 7 files changed, 25 insertions(+), 14 deletions(-) diff --git a/app/components/attachment/edit_component/edit_component.html.haml b/app/components/attachment/edit_component/edit_component.html.haml index 9ef7028db..336ff2ec7 100644 --- a/app/components/attachment/edit_component/edit_component.html.haml +++ b/app/components/attachment/edit_component/edit_component.html.haml @@ -2,10 +2,12 @@ - if template&.attached? %p.mb-1 Veuillez télécharger, remplir et joindre - = link_to('le modèle suivant', url_for(template), target: '_blank', rel: 'noopener') + = link_to(url_for(template), download: true, class: "fr-link fr-link--icon-right fr-icon-download-line mr-2") do + le modèle suivant - if helpers.administrateur_signed_in? - %em.fr-text-mention--grey.fr-text--xs.visible-on-previous-hover + %span.ml-2.fr-text--xs.fr-text-mention--grey.visible-on-previous-hover + %span.fr-text-action-high--blue-france.fr-icon-questionnaire-line{ "aria-hidden": "true" } = t('shared.ephemeral_link') - if persisted? diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c45b81052..4d0b807f1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -128,4 +128,8 @@ module ApplicationHelper def external_link_attributes { target: "_blank", rel: "noopener noreferrer" } end + + def download_details(attachment) + "#{attachment.filename.extension.upcase} – #{number_to_human_size(attachment.byte_size)}" + end end diff --git a/app/javascript/entrypoints/main.css b/app/javascript/entrypoints/main.css index d9bd726bf..94e208363 100644 --- a/app/javascript/entrypoints/main.css +++ b/app/javascript/entrypoints/main.css @@ -12,6 +12,7 @@ @import '@gouvfr/dsfr/dist/component/breadcrumb/breadcrumb.css'; @import '@gouvfr/dsfr/dist/component/callout/callout.css'; @import '@gouvfr/dsfr/dist/component/connect/connect.css'; +@import '@gouvfr/dsfr/dist/component/download/download.css'; @import '@gouvfr/dsfr/dist/component/highlight/highlight.css'; @import '@gouvfr/dsfr/dist/component/input/input.css'; @import '@gouvfr/dsfr/dist/component/checkbox/checkbox.css'; diff --git a/app/views/shared/dossiers/_edit.html.haml b/app/views/shared/dossiers/_edit.html.haml index 0af6c75d1..e1830edfb 100644 --- a/app/views/shared/dossiers/_edit.html.haml +++ b/app/views/shared/dossiers/_edit.html.haml @@ -21,15 +21,18 @@ = t('views.shared.dossiers.edit.autosave') - if notice_url(dossier.procedure).present? - %br - = link_to t("views.shared.dossiers.edit.notice"), notice_url(dossier.procedure), - class: "fr-btn fr-btn--secondary mt-2", - title: t("views.shared.dossiers.edit.notice_title"), **external_link_attributes + .fr-download + %p + = link_to notice_url(dossier.procedure), download: true, class: "fr-download__link mr-2", title: t("views.shared.dossiers.edit.notice_title") do + = t("views.shared.dossiers.edit.notice") + - if dossier.procedure.notice.attached? + %span.fr-download__detail + = download_details(dossier.procedure.notice) - - if administrateur_signed_in? - %em.ml-1.fr-text-mention--grey.visible-on-previous-hover - %span.fr-icon-feedback-line{ "aria-hidden": "true" } - = t('shared.ephemeral_link') + - if administrateur_signed_in? + %span.fr-text--xs.fr-text-mention--grey.visible-on-previous-hover + %span.fr-text-action-high--blue-france.fr-icon-questionnaire-line{ "aria-hidden": "true" } + = t('shared.ephemeral_link') - if dossier.show_groupe_instructeur_selector? %span{ data: { controller: 'autosave' } } diff --git a/config/locales/en.yml b/config/locales/en.yml index 0f41daaff..1752bd3d3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -136,7 +136,7 @@ en: dossiers: edit: autosave: Your file is automatically saved after each modification. You can close the window at any time and pick up where you left off later. - notice: "Notice to the procedure" + notice: "Download the notice of the procedure" notice_title: "To help you complete your file, you can consult the notice to this procedure." submit_dossier: Submit the file messages: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index dcdbe74ee..d31c4a039 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -131,7 +131,7 @@ fr: dossiers: edit: autosave: Votre dossier est enregistré automatiquement après chaque modification. Vous pouvez à tout moment fermer la fenêtre et reprendre plus tard là où vous en étiez. - notice: Guide de la démarche + notice: Télécharger le guide de la démarche notice_title: "Pour vous aider à remplir votre dossier, vous pouvez consulter le guide de cette démarche." submit_dossier: Déposer le dossier messages: diff --git a/spec/views/users/dossiers/brouillon.html.haml_spec.rb b/spec/views/users/dossiers/brouillon.html.haml_spec.rb index 95d85a035..87b0c048b 100644 --- a/spec/views/users/dossiers/brouillon.html.haml_spec.rb +++ b/spec/views/users/dossiers/brouillon.html.haml_spec.rb @@ -19,8 +19,9 @@ describe 'users/dossiers/brouillon.html.haml', type: :view do end it 'affiche un lien vers la notice' do - expect(response).to have_css("a[href*='/rails/active_storage/blobs/']", text: "Guide de la démarche") + expect(response).to have_css("a[href*='/rails/active_storage/blobs/']", text: "Télécharger le guide de la démarche") expect(rendered).not_to have_text("Ce lien est éphémère") + expect(rendered).to have_text("TXT – 11 octets") end it 'affiche les boutons de validation' do @@ -33,7 +34,7 @@ describe 'users/dossiers/brouillon.html.haml', type: :view do context 'quand la démarche ne comporte pas de notice' do let(:procedure) { create(:procedure) } - it { is_expected.not_to have_link("Guide de la démarche") } + it { is_expected.not_to have_link("Télécharger le guide de la démarche") } end end From 08c207e0e499d9c184fedcc610cd9144b13120dc Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 5 Oct 2022 13:59:38 +0200 Subject: [PATCH 23/58] refactor(scss): remove legacy reset + generic rules, refactor imports --- app/assets/stylesheets/01_common.scss | 28 ++ .../stylesheets/{utils.scss => 02_utils.scss} | 0 .../stylesheets/{fonts.scss => _fonts.scss} | 0 app/assets/stylesheets/_mixins.scss | 3 + app/assets/stylesheets/_placeholders.scss | 8 + app/assets/stylesheets/_typography.scss | 12 - app/assets/stylesheets/application.scss | 5 - app/assets/stylesheets/avis.scss | 1 - app/assets/stylesheets/avis_sign_up.scss | 3 - app/assets/stylesheets/card_admin.scss | 5 +- app/assets/stylesheets/common.scss | 86 ------ app/assets/stylesheets/custom_reset.scss | 28 -- .../dossier_annotations_privees.scss | 1 - app/assets/stylesheets/dsfr.scss | 2 +- app/assets/stylesheets/layouts.scss | 4 +- app/assets/stylesheets/merci.scss | 2 - app/assets/stylesheets/new_header.scss | 244 ------------------ app/assets/stylesheets/procedure_show.scss | 1 - app/assets/stylesheets/reset.scss | 48 ---- .../stylesheets/{_tabs.scss => tabs.scss} | 0 20 files changed, 46 insertions(+), 435 deletions(-) create mode 100644 app/assets/stylesheets/01_common.scss rename app/assets/stylesheets/{utils.scss => 02_utils.scss} (100%) rename app/assets/stylesheets/{fonts.scss => _fonts.scss} (100%) delete mode 100644 app/assets/stylesheets/_typography.scss delete mode 100644 app/assets/stylesheets/common.scss delete mode 100644 app/assets/stylesheets/custom_reset.scss delete mode 100644 app/assets/stylesheets/reset.scss rename app/assets/stylesheets/{_tabs.scss => tabs.scss} (100%) diff --git a/app/assets/stylesheets/01_common.scss b/app/assets/stylesheets/01_common.scss new file mode 100644 index 000000000..7ed530f6c --- /dev/null +++ b/app/assets/stylesheets/01_common.scss @@ -0,0 +1,28 @@ +@import "placeholders"; + +turbo-events { + display: none; +} + +.page-wrapper { + position: relative; + min-height: 100%; +} + +// Mobile Safari doesn't bubble mouse events by default, unless: +// +// - the target element of the event is a link or a form field. +// - the target element, or any of its ancestors up to but not including the , has an explicit event handler set for any of the mouse events. This event handler may be an empty function. +// - the target element, or any of its ancestors up to and including the document has a cursor: pointer CSS declarations. +// +// (See https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html) +// +// This is a problem for us, because we bind a lot of click events as +// `document.on('click', '.my-element', …)` – which requires proper bubbling. +.ios .page-wrapper { + cursor: pointer; +} + +.container { + @extend %container; +} diff --git a/app/assets/stylesheets/utils.scss b/app/assets/stylesheets/02_utils.scss similarity index 100% rename from app/assets/stylesheets/utils.scss rename to app/assets/stylesheets/02_utils.scss diff --git a/app/assets/stylesheets/fonts.scss b/app/assets/stylesheets/_fonts.scss similarity index 100% rename from app/assets/stylesheets/fonts.scss rename to app/assets/stylesheets/_fonts.scss diff --git a/app/assets/stylesheets/_mixins.scss b/app/assets/stylesheets/_mixins.scss index 52d5594a6..f561d6d63 100644 --- a/app/assets/stylesheets/_mixins.scss +++ b/app/assets/stylesheets/_mixins.scss @@ -1,3 +1,5 @@ +@import "constants"; + @mixin horizontal-padding($value) { padding-left: $value; padding-right: $value; @@ -20,3 +22,4 @@ background-image: image-url($image-url); } } + diff --git a/app/assets/stylesheets/_placeholders.scss b/app/assets/stylesheets/_placeholders.scss index b30eb5a17..3b41efb99 100644 --- a/app/assets/stylesheets/_placeholders.scss +++ b/app/assets/stylesheets/_placeholders.scss @@ -1,4 +1,5 @@ @import "colors"; +@import "mixins"; @import "constants"; %horizontal-list { @@ -25,3 +26,10 @@ outline: 3px solid $blue-france-500; } } + +%container { + @include horizontal-padding($default-padding); + max-width: $page-width + 2 * $default-padding; + margin-left: auto; + margin-right: auto; +} diff --git a/app/assets/stylesheets/_typography.scss b/app/assets/stylesheets/_typography.scss deleted file mode 100644 index 14b206e2b..000000000 --- a/app/assets/stylesheets/_typography.scss +++ /dev/null @@ -1,12 +0,0 @@ -@import "colors"; - -%new-type { - font-family: "Marianne", system-ui, -apple-system, sans-serif; - color: $black; -} - -ol { - line-height: 28px; - list-style-type: decimal; - list-style-position: inside; -} diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 82fb5fc2a..e6aa30c35 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,6 +1 @@ -// = require ./reset -// = require ./custom_reset -// = require ./common -// = require ./utils -// = require ./fonts // = require_tree . diff --git a/app/assets/stylesheets/avis.scss b/app/assets/stylesheets/avis.scss index 642d11537..c825a4538 100644 --- a/app/assets/stylesheets/avis.scss +++ b/app/assets/stylesheets/avis.scss @@ -1,5 +1,4 @@ @import "colors"; -@import "common"; @import "constants"; .give-avis { diff --git a/app/assets/stylesheets/avis_sign_up.scss b/app/assets/stylesheets/avis_sign_up.scss index f202205c9..f998f836e 100644 --- a/app/assets/stylesheets/avis_sign_up.scss +++ b/app/assets/stylesheets/avis_sign_up.scss @@ -1,6 +1,3 @@ -@import "typography"; -@import "colors"; - .avis-sign-up { .left { p { diff --git a/app/assets/stylesheets/card_admin.scss b/app/assets/stylesheets/card_admin.scss index 6ca1e9431..5d09b7cbb 100644 --- a/app/assets/stylesheets/card_admin.scss +++ b/app/assets/stylesheets/card_admin.scss @@ -2,7 +2,6 @@ @import "constants"; .card-admin { - color: $black; padding-top: 10px; padding-bottom: 10px; width: 236px; @@ -45,6 +44,10 @@ margin: auto auto 0 auto; } + p { + margin-bottom: 0; + } + &:hover { color: $blue-france-500; diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss deleted file mode 100644 index 1c675ac6a..000000000 --- a/app/assets/stylesheets/common.scss +++ /dev/null @@ -1,86 +0,0 @@ -@import "colors"; -@import "constants"; -@import "mixins"; -@import "placeholders"; -@import "typography"; - -body, -input, -textarea, -select { - @extend %new-type; - font-size: 16px; - line-height: 1.42857143; -} - -dt { - margin-bottom: 0.5em; -} - -.page-wrapper { - position: relative; - min-height: 100%; -} - -// Mobile Safari doesn't bubble mouse events by default, unless: -// -// - the target element of the event is a link or a form field. -// - the target element, or any of its ancestors up to but not including the , has an explicit event handler set for any of the mouse events. This event handler may be an empty function. -// - the target element, or any of its ancestors up to and including the document has a cursor: pointer CSS declarations. -// -// (See https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html) -// -// This is a problem for us, because we bind a lot of click events as -// `document.on('click', '.my-element', …)` – which requires proper bubbling. -.ios .page-wrapper { - cursor: pointer; -} - -h1 { - font-size: 36px; - font-weight: bold; -} - -strong { - font-weight: bold; -} - -a[target="_blank"]:not([class^="fr-"])::after { - content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==); - margin: 0 3px 0 5px; -} - -a:not([class^="fr-"]) { - color: $blue-france-500; -} - -em { - font-style: italic; -} - -strong { - font-weight: bold; -} - -sup { - vertical-align: super; - font-size: 0.83em; -} - -small { - font-size: small; -} - -.container { - @include horizontal-padding($default-padding); - max-width: $page-width + 2 * $default-padding; - margin-left: auto; - margin-right: auto; -} - -.small-container { - @include horizontal-padding($default-padding); - max-width: $small-page-width + 2 * $default-padding; - margin-left: auto; - margin-right: auto; -} diff --git a/app/assets/stylesheets/custom_reset.scss b/app/assets/stylesheets/custom_reset.scss deleted file mode 100644 index e3486d5c1..000000000 --- a/app/assets/stylesheets/custom_reset.scss +++ /dev/null @@ -1,28 +0,0 @@ -@import "colors"; -@import "placeholders"; - -html, -body { - height: 100%; - background-color: $white; -} - -html { - box-sizing: border-box; -} - -*, -*::before, -*::after { - box-sizing: inherit; -} - -a { - @extend %outline; - - text-decoration: none; -} - -turbo-events { - display: none; -} diff --git a/app/assets/stylesheets/dossier_annotations_privees.scss b/app/assets/stylesheets/dossier_annotations_privees.scss index f92b704a0..84273ddf5 100644 --- a/app/assets/stylesheets/dossier_annotations_privees.scss +++ b/app/assets/stylesheets/dossier_annotations_privees.scss @@ -1,5 +1,4 @@ @import "colors"; -@import "common"; @import "constants"; #dossier-annotations-privees { diff --git a/app/assets/stylesheets/dsfr.scss b/app/assets/stylesheets/dsfr.scss index 09e157743..34b9ec6fd 100644 --- a/app/assets/stylesheets/dsfr.scss +++ b/app/assets/stylesheets/dsfr.scss @@ -17,7 +17,7 @@ select { .fr-footer__bottom-link { // re-apply color unsetted by our common "a" rule setting a blue - color: var(--text-mention-grey); + // color: var(--text-mention-grey); } // with Marianne font, weight of font is less bolder, so bold it up diff --git a/app/assets/stylesheets/layouts.scss b/app/assets/stylesheets/layouts.scss index c214c1cc2..d0343b0e4 100644 --- a/app/assets/stylesheets/layouts.scss +++ b/app/assets/stylesheets/layouts.scss @@ -1,6 +1,6 @@ @import "colors"; -@import "common"; @import "constants"; +@import "placeholders"; .two-columns { background-color: $white; @@ -10,7 +10,7 @@ } .columns-container { - @extend .container; + @extend %container; display: flex; flex-direction: column; justify-content: center; diff --git a/app/assets/stylesheets/merci.scss b/app/assets/stylesheets/merci.scss index b40f676a2..b73c2d8e6 100644 --- a/app/assets/stylesheets/merci.scss +++ b/app/assets/stylesheets/merci.scss @@ -1,5 +1,3 @@ -@import "colors"; -@import "common"; @import "constants"; .merci .monavis { diff --git a/app/assets/stylesheets/new_header.scss b/app/assets/stylesheets/new_header.scss index d8ce97ae2..176b1432e 100644 --- a/app/assets/stylesheets/new_header.scss +++ b/app/assets/stylesheets/new_header.scss @@ -1,17 +1,3 @@ -@import "colors"; -@import "common"; -@import "constants"; -@import "mixins"; -@import "utils"; - -$header-landing-breakpoint: 1040px; -$header-mobile-breakpoint: 550px; - -// FIXME: Rename when the header is generalized -.new-header { - background-color: #FFFFFF; -} - // No drop shadow when a notice is shown. .fr-header.fr-header__with-notice-info { &, @@ -19,233 +5,3 @@ $header-mobile-breakpoint: 550px; filter: none; } } - -.header-inner-content { - @extend .container; - display: flex; - justify-content: space-between; - min-height: 72px; -} - -.header-logo { - display: flex; - flex-wrap: wrap; - align-items: center; - color: $blue-france-500; - - img { - margin-right: 10px; - } - - .site-title { - font-size: 24px; - font-weight: bold; - - &.small { - @media (min-width: $header-mobile-breakpoint) { - display: none; - } - } - - &.big { - @media (max-width: $header-mobile-breakpoint) { - display: none; - } - } - } -} - -.header-tabs { - li { - @include horizontal-padding($default-padding); - display: inline-block; - } - - .tab-link { - display: inline-block; - height: 72px; - line-height: 72px; - font-size: 18px; - color: $black; - - &.active, - &:hover { - color: $blue-france-500; - border-bottom: 2px solid $blue-france-500; - - &.contact-link { - position: relative; - border-bottom: none; - - .contact-details { - display: block; - } - } - } - } -} - -.contact-details { - display: none; - position: absolute; - left: -165px; - background: #FFFFFF; - border: 2px solid $blue-france-500; - border-radius: 5px; - padding: 15px; - width: 400px; - color: $black; - z-index: 100; - font-size: initial; - line-height: 1.6; - - &::after, - &::before { - bottom: 100%; - left: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; - } - - &::after { - border-color: rgba(255, 255, 255, 0); - border-bottom-color: #FFFFFF; - border-width: 15px; - margin-left: -15px; - } - - &::before { - border-color: rgba(255, 255, 255, 0); - border-bottom-color: $blue-france-500; - border-width: 18px; - margin-left: -18px; - } - - ul { - list-style-type: disc; - } -} - -.header-right-content { - display: flex; - align-items: center; - - > li { - @include horizontal-padding(8px); - - &:last-child { - padding-right: 0; - } - } -} - -.header-search { - position: relative; - - .form input[type=text] { - padding: 9px; - padding-right: 42px; - float: right; - max-width: 300px; - min-width: 90px; - margin: 0; - } - - label.hidden { - @extend .hidden; - } - - button { - @extend %outline; - - padding: 9px; - border: none; - background: none; - cursor: pointer; - position: absolute; - right: 0; - - &:hover { - opacity: 0.8; - } - } -} - -.header-menu-opener { - position: relative; - - img { - cursor: pointer; - - &:hover { - opacity: 0.8; - } - } -} - -.header-menu-button { - border: none; - padding: 0; - line-height: 14px; - vertical-align: middle; - - &:hover { - background: none; - } - -} - -.header-menu { - display: none; - position: absolute; - right: 0; - top: 34px; - font-size: 14px; - background: #FFFFFF; - box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); - border: 1px solid $border-grey; - min-width: 270px; - max-width: 340px; - z-index: 20; - - &.open { - display: block; - } - - li { - border-bottom: 1px solid $border-grey; - - &:last-child { - border-bottom: none; - } - - .menu-item { - align-items: center; - padding: 14px; - color: $dark-grey; - overflow: hidden; - text-overflow: ellipsis; - - img { - margin-right: 14px; - } - } - - .menu-link { - display: flex; - color: $black; - - &.active { - font-weight: bold; - } - - &:hover { - background: $light-grey; - } - } - } -} diff --git a/app/assets/stylesheets/procedure_show.scss b/app/assets/stylesheets/procedure_show.scss index 660a77d14..dda16de7e 100644 --- a/app/assets/stylesheets/procedure_show.scss +++ b/app/assets/stylesheets/procedure_show.scss @@ -1,5 +1,4 @@ @import "colors"; -@import "common"; @import "constants"; .procedure-header { diff --git a/app/assets/stylesheets/reset.scss b/app/assets/stylesheets/reset.scss deleted file mode 100644 index 02fb6ffef..000000000 --- a/app/assets/stylesheets/reset.scss +++ /dev/null @@ -1,48 +0,0 @@ -/* - http://meyerweb.com/eric/tools/css/reset/ - v2.0 | 20110126 - License: none (public domain) -*/ - -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} -/* HTML5 display-role reset for older browsers */ -article, aside, details, figcaption, figure, -footer, header, hgroup, menu, nav, section { - display: block; -} -body { - line-height: 1; -} -ol, ul { - list-style: none; -} -blockquote, q { - quotes: none; -} -blockquote:before, blockquote:after, -q:before, q:after { - content: ''; - content: none; -} -table { - border-spacing: 0; -} diff --git a/app/assets/stylesheets/_tabs.scss b/app/assets/stylesheets/tabs.scss similarity index 100% rename from app/assets/stylesheets/_tabs.scss rename to app/assets/stylesheets/tabs.scss From 5c36c2e317177e7e70a3738c7bf5389d1122253a Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 5 Oct 2022 16:21:52 +0200 Subject: [PATCH 24/58] style(landing): update after reset CSS drop --- app/assets/stylesheets/landing.scss | 39 +++++-------------------- app/views/root/_testimonials.html.haml | 2 +- app/views/root/_users.html.haml | 2 +- app/views/root/administration.html.haml | 12 ++++---- app/views/root/landing.html.haml | 8 ++--- 5 files changed, 20 insertions(+), 43 deletions(-) diff --git a/app/assets/stylesheets/landing.scss b/app/assets/stylesheets/landing.scss index 47f17d410..0e19a04e2 100644 --- a/app/assets/stylesheets/landing.scss +++ b/app/assets/stylesheets/landing.scss @@ -32,13 +32,11 @@ $landing-breakpoint: 1040px; } .hero-tagline { - font-size: 40px; margin-bottom: 0px; } .hero-tagline-em { color: $blue-france-500; - font-size: 40px; font-style: normal; font-weight: bold; } @@ -55,16 +53,6 @@ $landing-breakpoint: 1040px; } } -.landing-panel-title { - width: 100%; - font-size: 30px; - font-weight: normal; - text-align: center; - margin-bottom: 40px; - margin-top: 0; - color: $g700; -} - .features-panel { background-color: $blue-france-500; } @@ -186,15 +174,17 @@ $landing-breakpoint: 1040px; } .number-value { - color: $blue-france-500; - font-weight: bold; - font-size: 36px; + color: var(--text-action-high-blue-france); + font-size: 2rem; + line-height: 2rem; + font-weight: 600; } .number-label { - font-weight: bold; - font-size: 20px; - color: $g700; + font-weight: 600; + font-size: 1.25rem; + line-height: 1.5rem; + color: var(--text-label-grey); } $users-breakpoint: 950px; @@ -320,19 +310,6 @@ $users-breakpoint: 950px; text-align: center; } -.role-panel-title { - font-size: 30px; - font-weight: bold; - line-height: 36px; - margin-bottom: 15px; - color: $g700; -} - -.role-panel-explanation { - font-size: 24px; - margin-bottom: 10px; -} - .role-administrations-image { text-align: right; diff --git a/app/views/root/_testimonials.html.haml b/app/views/root/_testimonials.html.haml index ea3cfe634..5a9916320 100644 --- a/app/views/root/_testimonials.html.haml +++ b/app/views/root/_testimonials.html.haml @@ -1,6 +1,6 @@ .landing-panel .container - %h2.landing-panel-title Ce que les utilisateurs pensent du service + %h2.center.fr-mb-4w Ce que les utilisateurs pensent du service %ul.quotes %li.quote diff --git a/app/views/root/_users.html.haml b/app/views/root/_users.html.haml index f02bee547..7ffed0f57 100644 --- a/app/views/root/_users.html.haml +++ b/app/views/root/_users.html.haml @@ -1,6 +1,6 @@ .landing-panel.users-panel .container - %h2.landing-panel-title Ils utilisent déjà #{APPLICATION_NAME} + %h2.center.fr-mb-4w Ils utilisent déjà #{APPLICATION_NAME} %ul.users %li.user diff --git a/app/views/root/administration.html.haml b/app/views/root/administration.html.haml index 83cc9690e..45edecb1f 100644 --- a/app/views/root/administration.html.haml +++ b/app/views/root/administration.html.haml @@ -6,7 +6,7 @@ .container .hero-wrapper .hero-text - %p.hero-tagline + %h1.hero-tagline %em.hero-tagline-em Dématérialisez et simplifiez vos démarches administratives @@ -17,8 +17,8 @@ .container .role-panel-wrapper.role-administrations-panel .role-panel-70 - %h1.role-panel-title Est-ce fait pour mon administration ? - %p.role-panel-explanation Découvrez notre outil et posez nous vos questions lors de notre démonstration en ligne ou lisez notre documentation + %h2 Est-ce fait pour mon administration ? + %p.fr-h5 Découvrez notre outil et posez nous vos questions lors de notre démonstration en ligne ou lisez notre documentation = link_to "Participer à notre démonstration en ligne", INSCRIPTION_WEBINAIRE_URL, class: "fr-btn fr-btn--lg fr-mr-1w fr-mb-2w", **external_link_attributes = link_to "Documentation", DOC_URL, class: "fr-btn fr-btn--secondary fr-btn--lg", **external_link_attributes @@ -33,8 +33,8 @@ %img.role-image{ :src => image_url("landing/roles/administrations.svg"), alt: "" } .role-panel-70 - %h1.role-panel-title Votre administration est prête pour dématérialiser - %p.role-panel-explanation Créez un premier formulaire de test en quelques minutes + %h2 Votre administration est prête pour dématérialiser + %p.fr-h5 Créez un premier formulaire de test en quelques minutes = link_to "Créer votre compte administrateur", DEMANDE_INSCRIPTION_ADMIN_PAGE_URL, class: "fr-btn fr-btn--lg" @@ -75,7 +75,7 @@ - cache "numbers-panel", :expires_in => 3.hours do .landing-panel.numbers-panel .container - %h2.landing-panel-title #{APPLICATION_NAME} en chiffres + %h2.center.fr-mb-4w #{APPLICATION_NAME} en chiffres %ul.numbers %li.number .number-value diff --git a/app/views/root/landing.html.haml b/app/views/root/landing.html.haml index f5da25a61..60b03d244 100644 --- a/app/views/root/landing.html.haml +++ b/app/views/root/landing.html.haml @@ -23,8 +23,8 @@ %img.role-image{ :src => image_url("landing/roles/usagers.svg"), alt: '', width: 176, height: 180, loading: 'lazy' } .role-panel-70 - %h2.role-panel-title Vous souhaitez effectuer une demande auprès d’une administration ? - %p.role-panel-explanation Réalisez vos demandes en toute simplicité et retrouvez vos dossiers en ligne + %h2 Vous souhaitez effectuer une demande auprès d’une administration ? + %p.fr-h5 Réalisez vos demandes en toute simplicité et retrouvez vos dossiers en ligne = link_to "Comment trouver ma démarche ?", COMMENT_TROUVER_MA_DEMARCHE_URL, class: "fr-btn fr-btn--lg fr-mr-1w fr-mb-2w", **external_link_attributes = link_to "Se connecter", new_user_session_path, class: "fr-btn fr-btn--secondary fr-btn--lg" @@ -32,7 +32,7 @@ - cache "numbers-panel", :expires_in => 3.hours do .landing-panel .container - %h2.landing-panel-title #{APPLICATION_NAME} en chiffres + %h2.center.fr-mb-4w #{APPLICATION_NAME} en chiffres %ul.numbers %li.number .number-value @@ -77,7 +77,7 @@ .container .cta-panel-wrapper %div - %h2.cta-panel-title.grey Administration : vous voulez dématerialiser ? + %h2.fr-h4 Administration : vous voulez dématerialiser ? %p.cta-panel-explanation.grey Proposez à vos usagers de remplir leurs dossiers en ligne %div = link_to "Découvrez notre outil", administration_path, class: "fr-btn fr-btn--lg" From 10917af523e24f55ea6413edd22aeca5345f5450 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 5 Oct 2022 16:38:49 +0200 Subject: [PATCH 25/58] style: signin button styled accordingly to UX --- app/views/layouts/_header.haml | 2 +- config/locales/views/shared/fr.yml | 2 +- spec/system/sessions/sign_in_spec.rb | 6 +++--- spec/system/users/managing_password_spec.rb | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/layouts/_header.haml b/app/views/layouts/_header.haml index a452923d1..6793235b8 100644 --- a/app/views/layouts/_header.haml +++ b/app/views/layouts/_header.haml @@ -38,7 +38,7 @@ - if request.path == new_user_registration_path %li .fr-hidden-sm.fr-unhidden-lg.fr-link--sm= t('views.shared.account.already_user_question') - %li= link_to t('views.shared.account.signin'), new_user_session_path, class: "fr-btn" + %li= link_to t('views.shared.account.signin'), new_user_session_path, class: "fr-btn fr-btn--tertiary fr-icon-account-circle-fill fr-btn--icon-left" %li - if dossier.present? && nav_bar_profile == :user diff --git a/config/locales/views/shared/fr.yml b/config/locales/views/shared/fr.yml index 43f9d124b..4bf06d14c 100644 --- a/config/locales/views/shared/fr.yml +++ b/config/locales/views/shared/fr.yml @@ -19,4 +19,4 @@ fr: already_user_question: 'Vous avez déjà un compte ?' already_user: 'J’ai déjà un compte' create: 'Créer un compte' - signin: 'Connexion' + signin: 'Se connecter' diff --git a/spec/system/sessions/sign_in_spec.rb b/spec/system/sessions/sign_in_spec.rb index bc68e01f6..85eade136 100644 --- a/spec/system/sessions/sign_in_spec.rb +++ b/spec/system/sessions/sign_in_spec.rb @@ -4,7 +4,7 @@ describe 'Signin in:' do scenario 'an existing user can sign-in' do visit root_path - click_on 'Connexion' + click_on 'Se connecter', match: :first sign_in_with user.email, 'invalid-password' expect(page).to have_content 'Courriel ou mot de passe incorrect.' @@ -16,7 +16,7 @@ describe 'Signin in:' do scenario 'an existing user can lock its account' do visit root_path - click_on 'Connexion' + click_on 'Se connecter', match: :first 5.times { sign_in_with user.email, 'bad password' } expect(user.reload.access_locked?).to be false @@ -60,7 +60,7 @@ describe 'Signin in:' do # For now only test the default behavior (an error message is displayed). scenario 'they get an error message' do visit root_path - click_on 'Connexion' + click_on 'Se connecter', match: :first sign_in_with user.email, password expect(page).to have_content('Vous devez confirmer votre compte par courriel.') diff --git a/spec/system/users/managing_password_spec.rb b/spec/system/users/managing_password_spec.rb index e7dc21e8b..bb77ddd6f 100644 --- a/spec/system/users/managing_password_spec.rb +++ b/spec/system/users/managing_password_spec.rb @@ -6,7 +6,7 @@ describe 'Managing password:', js: true do scenario 'a simple user can reset their password' do visit root_path within('.fr-header .fr-container .fr-header__tools .fr-btns-group') do - click_on 'Connexion' + click_on 'Se connecter' end click_on 'Mot de passe oublié ?' expect(page).to have_current_path(new_user_password_path) @@ -37,7 +37,7 @@ describe 'Managing password:', js: true do scenario 'an admin can reset their password', js: true do visit root_path within('.fr-header .fr-container .fr-header__tools .fr-btns-group') do - click_on 'Connexion' + click_on 'Se connecter' end click_on 'Mot de passe oublié ?' expect(page).to have_current_path(new_user_password_path) From 8bd36921e0c2f0502da5fd5a0c08a2afffd7b444 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 10:05:12 +0200 Subject: [PATCH 26/58] style(footer): drop useless br since we now have a default margin-bottom on p --- app/views/shared/_footer_copy.html.haml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/views/shared/_footer_copy.html.haml b/app/views/shared/_footer_copy.html.haml index b14146fe4..7236b4962 100644 --- a/app/views/shared/_footer_copy.html.haml +++ b/app/views/shared/_footer_copy.html.haml @@ -2,4 +2,3 @@ %p Sauf mention contraire, tous les contenus de ce site sont sous %a{ href: "https://github.com/etalab/licence-ouverte/blob/master/LO.md", target:"_blank", class: "fr-underlined" } licence etalab-2.0 - %br From be367503cfd73caba1afc4374c2496d71d2954ff Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 11:11:46 +0200 Subject: [PATCH 27/58] fix(footer): add missing title attribute on a --- app/views/shared/_footer_copy.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_footer_copy.html.haml b/app/views/shared/_footer_copy.html.haml index 7236b4962..4d4c4a782 100644 --- a/app/views/shared/_footer_copy.html.haml +++ b/app/views/shared/_footer_copy.html.haml @@ -1,4 +1,4 @@ .fr-footer__bottom-copy %p Sauf mention contraire, tous les contenus de ce site sont sous - %a{ href: "https://github.com/etalab/licence-ouverte/blob/master/LO.md", target:"_blank", class: "fr-underlined" } licence etalab-2.0 + %a{ href: "https://github.com/etalab/licence-ouverte/blob/master/LO.md", target:"_blank", class: "fr-underlined", title: "licence etalab-2.0 - nouvelle fenêtre" } licence etalab-2.0 From aea2733be13f3b143db3dbc66142a85c3cb166fa Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 11:24:56 +0200 Subject: [PATCH 28/58] refactor(css): more landing + new_footer cleanup --- app/assets/stylesheets/landing.scss | 108 +------------------------ app/assets/stylesheets/new_footer.scss | 100 ----------------------- 2 files changed, 1 insertion(+), 207 deletions(-) diff --git a/app/assets/stylesheets/landing.scss b/app/assets/stylesheets/landing.scss index 0e19a04e2..fbc28a028 100644 --- a/app/assets/stylesheets/landing.scss +++ b/app/assets/stylesheets/landing.scss @@ -3,10 +3,6 @@ @import "mixins"; @import "placeholders"; -.landing { - background-color: #FFFFFF; -} - .landing-panel { @include vertical-padding(60px); } @@ -57,10 +53,6 @@ $landing-breakpoint: 1040px; background-color: $blue-france-500; } -.features-panel-title { - color: #FFFFFF; -} - .features { @extend %horizontal-list; width: 100%; @@ -228,17 +220,6 @@ $users-breakpoint: 950px; height: 180px; } -.cta-role-title { - font-size: 30px; - font-weight: bold; - margin-top: 13px; -} - -.cta-role-explanation { - font-size: 30px; - margin-bottom: 10px; -} - .cta-panel { background-color: $blue-france-500; color: #FFFFFF; @@ -248,8 +229,7 @@ $users-breakpoint: 950px; } } -.role-panel-wrapper, -.cta-panel-wrapper { +.role-panel-wrapper { width: 100%; display: flex; flex-wrap: wrap; @@ -305,11 +285,6 @@ $users-breakpoint: 950px; } } -.half .cta-panel-title, -.half .cta-panel-explanation { - text-align: center; -} - .role-administrations-image { text-align: right; @@ -369,84 +344,3 @@ $cta-panel-button-border-size: 2px; outline: 3px solid #FFFFFF; } } - -.cta-panel-button-blue { - @include cta-panel-button; - border: $cta-panel-button-border-size solid $blue-france-700; - color: $blue-france-700; - - &:hover { - color: #FFFFFF; - background-color: $blue-france-500; - text-decoration: none; - - &:focus { - color: #FFFFFF; - } - } - - &:focus { - color: $blue-france-500; - text-decoration: none; - } -} - -@mixin role-button { - @include horizontal-padding(30px); - display: inline-block; - border-radius: 100px; - font-size: 20px; - text-align: center; - cursor: pointer; - margin-top: 20px; - line-height: 50px; -} - -.role-panel-button-primary { - @include role-button; - background-color: $blue-france-700; - color: #FFFFFF; - - &:hover { - color: #FFFFFF; - text-decoration: none; - background-color: $blue-france-500; - } - - &:focus { - color: #FFFFFF; - text-decoration: none; - } -} - -.role-panel-button-secondary { - @include role-button; - border: $cta-panel-button-border-size solid $blue-france-700; - line-height: 50px - 2 * $cta-panel-button-border-size; - color: $blue-france-700; - margin-left: 10px; - - @media (max-width: $users-breakpoint) { - margin-left: 0px; - } - - &:hover { - color: $blue-france-500; - border: $cta-panel-button-border-size solid $blue-france-500; - text-decoration: none; - } - - &:focus { - color: $light-blue; - text-decoration: none; - } -} - -.half { - width: 45%; - float: left; -} - -.first-half { - margin-right: 10%; -} diff --git a/app/assets/stylesheets/new_footer.scss b/app/assets/stylesheets/new_footer.scss index 8a036f332..0754ac125 100644 --- a/app/assets/stylesheets/new_footer.scss +++ b/app/assets/stylesheets/new_footer.scss @@ -1,7 +1,4 @@ -@import "colors"; -@import "constants"; @import "mixins"; -@import "placeholders"; .landing-footer { @include vertical-padding(72px); @@ -12,50 +9,6 @@ line-height: 24px; } -.footer-columns { - @extend %horizontal-list; - justify-content: flex-start; - margin: 0 -15px; -} - -.footer-column { - @extend %horizontal-list-item; - font-size: 14px; - vertical-align: top; - flex: 0 0 33.333333%; - min-width: 280px; - margin-bottom: 30px; - - @media (max-width: 550px) { - width: 100%; - } -} - -.footer-logos, -.footer-links { - list-style-type: none; - padding: 0; - margin: 0; -} - -.footer-header { - font-size: 14px; - font-weight: bold; - margin-bottom: 10px; -} - -.footer-link { - margin-bottom: 14px; - - &:last-of-type { - margin-bottom: 0; - } -} - -.footer-text { - margin-bottom: 14px; -} - .footer-logo:hover { opacity: 0.8; } @@ -67,56 +20,3 @@ height: 25px; margin-top: 14px; } - -.footer-logo-france { - @include ie-compatible-background-image("republique-francaise-logo.svg"); - - width: 105px; - height: 90px; -} - -.footer-link a, -.footer-text a { - color: $black; - text-decoration: none; - - &:hover, - &:focus { - color: $blue-france-700; - text-decoration: none; - } -} - -.footer-bottom-line { - text-align: center; - font-size: small; - - @media (max-width: 550px) { - text-align: left; - } -} - -.footer-row { - margin-bottom: 30px; - - // In this case, the bottom margin is defined directly on each individual column - &.footer-columns { - margin-bottom: 0; - } -} - -.footer-site-links { - li { - display: inline; - - - &::before { - content: "-"; - margin: $default-spacer; - } - - &:first-child::before { - content: none; - } - } -} From 72e79eb2d3d2eac5419d9bbc3fc9d8997bc37a49 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 11:27:04 +0200 Subject: [PATCH 29/58] fix(css): don't duplicate font declarations from DSFR. This may cause issues in exact font height computation & underline effect. --- app/assets/stylesheets/_fonts.scss | 14 -------------- app/assets/stylesheets/print.scss | 1 - 2 files changed, 15 deletions(-) delete mode 100644 app/assets/stylesheets/_fonts.scss diff --git a/app/assets/stylesheets/_fonts.scss b/app/assets/stylesheets/_fonts.scss deleted file mode 100644 index 1abf116a6..000000000 --- a/app/assets/stylesheets/_fonts.scss +++ /dev/null @@ -1,14 +0,0 @@ -@font-face { - font-family: "Marianne"; - src: asset-url("Marianne-Regular.woff2") format("woff2"), - asset-url("Marianne-Regular.woff") format("woff"); - font-weight: normal; - font-style: normal; -} - -@font-face { - font-family: "Spectrale"; - src: asset-url("Spectral-Regular.ttf") format("ttf"); - font-weight: bold; - font-style: normal; -} diff --git a/app/assets/stylesheets/print.scss b/app/assets/stylesheets/print.scss index b52db86d1..4c3901bdb 100644 --- a/app/assets/stylesheets/print.scss +++ b/app/assets/stylesheets/print.scss @@ -1,5 +1,4 @@ @import "colors"; -@import "fonts"; @media print { .new-header, From 7dd3a42cd76484e1ec9fb3c86df2db6204122212 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 11:42:43 +0200 Subject: [PATCH 30/58] fix(style): tabs --- app/assets/stylesheets/tabs.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/tabs.scss b/app/assets/stylesheets/tabs.scss index 37dd207ff..985e54a46 100644 --- a/app/assets/stylesheets/tabs.scss +++ b/app/assets/stylesheets/tabs.scss @@ -2,6 +2,10 @@ @import "mixins"; .tabs { + ul { + margin-bottom: 0; + } + li { display: inline-block; line-height: 36px; From 71996af65b2f1079d2be659092db697e386011a6 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 12:58:02 +0200 Subject: [PATCH 31/58] style(avis): use fr-badge for count instead of broken css --- app/assets/stylesheets/avis.scss | 12 ------------ app/views/experts/shared/avis/_list.html.haml | 2 +- .../instructeurs/procedures/email_usagers.html.haml | 2 +- app/views/instructeurs/shared/avis/_list.html.haml | 2 +- app/views/root/patron.html.haml | 2 +- 5 files changed, 4 insertions(+), 16 deletions(-) diff --git a/app/assets/stylesheets/avis.scss b/app/assets/stylesheets/avis.scss index c825a4538..ca4c4a941 100644 --- a/app/assets/stylesheets/avis.scss +++ b/app/assets/stylesheets/avis.scss @@ -74,18 +74,6 @@ } .list-avis { - .count { - display: inline-block; - width: 20px; - height: 20px; - border-radius: 10px; - border: 1px solid $grey; - text-align: center; - font-size: 12px; - font-weight: normal; - margin-left: 8px; - } - .one-avis { border-top: 1px solid $grey; padding: $default-padding 0; diff --git a/app/views/experts/shared/avis/_list.html.haml b/app/views/experts/shared/avis/_list.html.haml index 34c5d7ad6..5aa674410 100644 --- a/app/views/experts/shared/avis/_list.html.haml +++ b/app/views/experts/shared/avis/_list.html.haml @@ -1,7 +1,7 @@ %section.list-avis %h1.tab-title Avis des invités - %span.count= avis.count + %span.fr-badge= avis.count %ul - avis.each do |avis| diff --git a/app/views/instructeurs/procedures/email_usagers.html.haml b/app/views/instructeurs/procedures/email_usagers.html.haml index e1c965045..84e8f78b6 100644 --- a/app/views/instructeurs/procedures/email_usagers.html.haml +++ b/app/views/instructeurs/procedures/email_usagers.html.haml @@ -14,7 +14,7 @@ %section.list-avis.mt-8 %h1.tab-title Messages envoyés précedemment - %span.count= @bulk_messages.count + %span.fr-badge= @bulk_messages.count %ul - @bulk_messages.each do |message| diff --git a/app/views/instructeurs/shared/avis/_list.html.haml b/app/views/instructeurs/shared/avis/_list.html.haml index 8c1693569..eece13e45 100644 --- a/app/views/instructeurs/shared/avis/_list.html.haml +++ b/app/views/instructeurs/shared/avis/_list.html.haml @@ -1,7 +1,7 @@ %section.list-avis %h1.tab-title Avis des invités - %span.count= avis.count + %span.fr-badge= avis.count %ul - avis.each do |avis| diff --git a/app/views/root/patron.html.haml b/app/views/root/patron.html.haml index 57364e78f..57575c311 100644 --- a/app/views/root/patron.html.haml +++ b/app/views/root/patron.html.haml @@ -282,7 +282,7 @@ %section.list-avis %h1.title Avis des invités - %span.count 1 + %span.fr-badge 1 %ul %li.one-avis From 555c796d1986e03142be4af7df6a04ea63bacfea Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 12:59:02 +0200 Subject: [PATCH 32/58] style(forms): increase forms elements font-size to legacy value & fieldset style --- app/assets/stylesheets/dsfr.scss | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/dsfr.scss b/app/assets/stylesheets/dsfr.scss index 34b9ec6fd..2eefa264d 100644 --- a/app/assets/stylesheets/dsfr.scss +++ b/app/assets/stylesheets/dsfr.scss @@ -8,16 +8,16 @@ body [href]:not([class^="fr-"]) { background-image: none; } -// override default transparent background on inputs +// override default transparent background on inputs & font-size to 16px by default input, textarea, select { background: $white; -} .fr-footer__bottom-link { // re-apply color unsetted by our common "a" rule setting a blue // color: var(--text-mention-grey); + font-size: 1em; } // with Marianne font, weight of font is less bolder, so bold it up @@ -42,3 +42,9 @@ input[type="radio"] { textarea { cursor: auto; } + +fieldset { + border: 0; + padding-left: 0; + padding-bottom: 0; +} From 2ab5fbbb24624bf0b8e24d1304b1f7ab34993cfc Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 13:02:25 +0200 Subject: [PATCH 33/58] style(link): use DSFR underline style everywhere possible. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Par conséquent on commence à remplacer d'anciens "liens-boutons" (qui auraient récupéré un souligné indésirable), par un vrai boutton dsfr. Le hack fr-underlined n'est aussi plus nécessaire. --- app/assets/stylesheets/buttons.scss | 10 ++++++++++ app/assets/stylesheets/dossiers_table.scss | 4 ++++ app/assets/stylesheets/dsfr.scss | 12 ------------ app/assets/stylesheets/procedure_list.scss | 3 +++ app/assets/stylesheets/tabs.scss | 1 + .../edit_component/edit_component.html.haml | 2 +- app/views/agent_connect/agent/index.html.haml | 2 +- app/views/commencer/show.html.haml | 6 +++--- app/views/invites/_form.html.haml | 2 +- app/views/root/_footer.html.haml | 4 ++-- app/views/shared/_footer_copy.html.haml | 2 +- app/views/shared/_france_connect_login.html.haml | 2 +- app/views/shared/dossiers/_edit.html.haml | 2 +- .../users/dossiers/_identity_dropdown.html.haml | 2 +- app/views/users/dossiers/etablissement.html.haml | 4 ++-- app/views/users/dossiers/identite.html.haml | 2 +- 16 files changed, 33 insertions(+), 27 deletions(-) diff --git a/app/assets/stylesheets/buttons.scss b/app/assets/stylesheets/buttons.scss index 11a331fe5..b777f0b67 100644 --- a/app/assets/stylesheets/buttons.scss +++ b/app/assets/stylesheets/buttons.scss @@ -183,6 +183,11 @@ top: 5 * $default-spacer; cursor: default; z-index: 10; + list-style: none; + + a { + background-image: none; // remove DSFR underline + } &.left-aligned { left: 0; @@ -256,6 +261,7 @@ a { color: $dark-grey; + background-image: none; // remove DSFR underline } // Make child links fill the whole clickable area @@ -311,6 +317,10 @@ [disabled] { display: none; } + + ul { + list-style: none; + } } .link { diff --git a/app/assets/stylesheets/dossiers_table.scss b/app/assets/stylesheets/dossiers_table.scss index 7d836033c..aed150198 100644 --- a/app/assets/stylesheets/dossiers_table.scss +++ b/app/assets/stylesheets/dossiers_table.scss @@ -17,6 +17,10 @@ color: #000000; } + a { + background-image: none; // remove DSFR underline + } + .caret-icon { vertical-align: top; margin-top: 9px; diff --git a/app/assets/stylesheets/dsfr.scss b/app/assets/stylesheets/dsfr.scss index 2eefa264d..1ff018395 100644 --- a/app/assets/stylesheets/dsfr.scss +++ b/app/assets/stylesheets/dsfr.scss @@ -1,22 +1,10 @@ @import "colors"; -// Hacky override default text underline of DSFR because we don't want to underline links in our legacy UI. -// We don't match links having a dsfr class (prefixed by fr-). -// However DSFR components may contain links without fr- class on them, -// so these links can be artificially matched by adding any fr-class on them, (like fr-underlined) -body [href]:not([class^="fr-"]) { - background-image: none; -} - // override default transparent background on inputs & font-size to 16px by default input, textarea, select { background: $white; - -.fr-footer__bottom-link { - // re-apply color unsetted by our common "a" rule setting a blue - // color: var(--text-mention-grey); font-size: 1em; } diff --git a/app/assets/stylesheets/procedure_list.scss b/app/assets/stylesheets/procedure_list.scss index cc7f09898..22cd4431e 100644 --- a/app/assets/stylesheets/procedure_list.scss +++ b/app/assets/stylesheets/procedure_list.scss @@ -11,6 +11,7 @@ } a { + background-image: none; // remove DSFR underline @include vertical-padding(24px); color: $black; width: 100%; @@ -45,6 +46,8 @@ } .procedure-stats { + list-style-type: none; + li { min-height: 36px; border-left: 1px solid $border-grey; diff --git a/app/assets/stylesheets/tabs.scss b/app/assets/stylesheets/tabs.scss index 985e54a46..e47b90680 100644 --- a/app/assets/stylesheets/tabs.scss +++ b/app/assets/stylesheets/tabs.scss @@ -20,6 +20,7 @@ padding-left: 20px; padding-right: 20px; color: $black; + background-image: none; } &.active { diff --git a/app/components/attachment/edit_component/edit_component.html.haml b/app/components/attachment/edit_component/edit_component.html.haml index 336ff2ec7..7a7a51f11 100644 --- a/app/components/attachment/edit_component/edit_component.html.haml +++ b/app/components/attachment/edit_component/edit_component.html.haml @@ -2,7 +2,7 @@ - if template&.attached? %p.mb-1 Veuillez télécharger, remplir et joindre - = link_to(url_for(template), download: true, class: "fr-link fr-link--icon-right fr-icon-download-line mr-2") do + = link_to(url_for(template), download: true, class: "fr-link fr-link--icon-right fr-icon-download-line") do le modèle suivant - if helpers.administrateur_signed_in? diff --git a/app/views/agent_connect/agent/index.html.haml b/app/views/agent_connect/agent/index.html.haml index 8cb2229e5..8d48af27d 100644 --- a/app/views/agent_connect/agent/index.html.haml +++ b/app/views/agent_connect/agent/index.html.haml @@ -23,7 +23,7 @@ = t('.signin_with') %span.fr-connect__brand AgentConnect %p - = link_to t('.whats_agentconnect'), 'https://agentconnect.gouv.fr/', target: '_blank', rel: "noopener", class: "fr-underlined" + = link_to t('.whats_agentconnect'), 'https://agentconnect.gouv.fr/', target: '_blank', rel: "noopener" .france-connect-login-separator diff --git a/app/views/commencer/show.html.haml b/app/views/commencer/show.html.haml index 7bf4f027f..9053e41f8 100644 --- a/app/views/commencer/show.html.haml +++ b/app/views/commencer/show.html.haml @@ -37,8 +37,8 @@ - else %h2.huge-title= t('views.commencer.show.existing_dossiers') - = link_to t('views.commencer.show.show_dossiers'), dossiers_path, class: ['button large expand primary'] - = link_to t('views.commencer.show.start_new_file'), url_for_new_dossier(@revision), class: ['button large expand'] + = link_to t('views.commencer.show.show_dossiers'), dossiers_path, class: "fr-btn fr-btn--lg fr-my-2w" + = link_to t('views.commencer.show.start_new_file'), url_for_new_dossier(@revision), class: "fr-btn fr-btn--lg fr-btn--secondary fr-my-2w" - if @procedure.feature_enabled?(:dossier_pdf_vide) - pdf_link = @revision.draft? ? commencer_dossier_vide_test_path(path: @procedure.path) : commencer_dossier_vide_path(path: @procedure.path) @@ -46,4 +46,4 @@ %p= t('views.commencer.show.want_empty_pdf', service: @procedure&.service&.nom, adresse: @procedure&.service&.adresse) %br - = link_to t('views.commencer.show.download_empty_pdf'), pdf_link, class: ['button large expand'] + = link_to t('views.commencer.show.download_empty_pdf'), pdf_link, class: "fr-btn fr-btn--lg fr-btn--secondary fr-my-2w" diff --git a/app/views/invites/_form.html.haml b/app/views/invites/_form.html.haml index 4101971f9..8743ca2fb 100644 --- a/app/views/invites/_form.html.haml +++ b/app/views/invites/_form.html.haml @@ -26,4 +26,4 @@ = label_tag :invite_message, t('views.invites.form.invite_message') = text_area_tag :invite_message, '', class: 'small', placeholder: t('views.invites.form.invite_message') .col - = submit_tag t('views.invites.form.send_invitation'), class: 'button accepted' + = submit_tag t('views.invites.form.send_invitation'), class: 'fr-btn fr-btn--secondary' diff --git a/app/views/root/_footer.html.haml b/app/views/root/_footer.html.haml index 48d0d899d..7233d5599 100644 --- a/app/views/root/_footer.html.haml +++ b/app/views/root/_footer.html.haml @@ -50,9 +50,9 @@ .fr-footer__content %p.fr-footer__content-desc = t('links.footer.description_1') - = link_to t('links.footer.link_1_label'), t('links.footer.link_1_url'), target: '_blank', class: "fr-underlined" + = link_to t('links.footer.link_1_label'), t('links.footer.link_1_url'), target: '_blank' %p.fr-footer__content-desc - = link_to t('links.footer.link_2_label'), t("links.footer.code.url"), target: '_blank', class: "fr-underlined" + = link_to t('links.footer.link_2_label'), t("links.footer.code.url"), target: '_blank' = t('links.footer.description_2') %ul.fr-footer__content-list %li.fr-footer__content-item diff --git a/app/views/shared/_footer_copy.html.haml b/app/views/shared/_footer_copy.html.haml index 4d4c4a782..fd3a6d46b 100644 --- a/app/views/shared/_footer_copy.html.haml +++ b/app/views/shared/_footer_copy.html.haml @@ -1,4 +1,4 @@ .fr-footer__bottom-copy %p Sauf mention contraire, tous les contenus de ce site sont sous - %a{ href: "https://github.com/etalab/licence-ouverte/blob/master/LO.md", target:"_blank", class: "fr-underlined", title: "licence etalab-2.0 - nouvelle fenêtre" } licence etalab-2.0 + %a{ href: "https://github.com/etalab/licence-ouverte/blob/master/LO.md", target:"_blank", title: "licence etalab-2.0 - nouvelle fenêtre" } licence etalab-2.0 diff --git a/app/views/shared/_france_connect_login.html.haml b/app/views/shared/_france_connect_login.html.haml index 6d9d18de5..897ba2010 100644 --- a/app/views/shared/_france_connect_login.html.haml +++ b/app/views/shared/_france_connect_login.html.haml @@ -11,7 +11,7 @@ = t('views.shared.france_connect_login.login_button') %span.fr-connect__brand FranceConnect %p - = link_to t('views.shared.france_connect_login.help_link'), "https://franceconnect.gouv.fr/", target: "_blank", rel: "noopener", class: "fr-underlined" + = link_to t('views.shared.france_connect_login.help_link'), "https://franceconnect.gouv.fr/", target: "_blank", rel: "noopener" .france-connect-login-separator = t('views.shared.france_connect_login.separator') diff --git a/app/views/shared/dossiers/_edit.html.haml b/app/views/shared/dossiers/_edit.html.haml index e1830edfb..16d9f7843 100644 --- a/app/views/shared/dossiers/_edit.html.haml +++ b/app/views/shared/dossiers/_edit.html.haml @@ -56,7 +56,7 @@ = f.button t('views.shared.dossiers.edit.submit_dossier'), name: :submit_draft, value: true, - class: 'button send primary', + class: 'fr-btn fr-btn--sm', disabled: !current_user.owns?(dossier), data: { 'disable-with': "Envoi en cours…" } diff --git a/app/views/users/dossiers/_identity_dropdown.html.haml b/app/views/users/dossiers/_identity_dropdown.html.haml index d814fd0e4..3da4cd863 100644 --- a/app/views/users/dossiers/_identity_dropdown.html.haml +++ b/app/views/users/dossiers/_identity_dropdown.html.haml @@ -7,7 +7,7 @@ = render partial: "shared/dossiers/identite_individual", locals: { individual: dossier.individual } .center - = link_to t('views.shared.dossiers.demande.edit_identity'), identite_dossier_path(dossier), class: 'button' + = link_to t('views.shared.dossiers.demande.edit_identity'), identite_dossier_path(dossier), class: 'fr-btn fr-btn--secondary' - elsif dossier.etablissement = render partial: "shared/dossiers/identite_entreprise", locals: { etablissement: dossier.etablissement, short_identity: true, profile: "usager" } diff --git a/app/views/users/dossiers/etablissement.html.haml b/app/views/users/dossiers/etablissement.html.haml index bbedeb3d2..1245da6dd 100644 --- a/app/views/users/dossiers/etablissement.html.haml +++ b/app/views/users/dossiers/etablissement.html.haml @@ -41,5 +41,5 @@ = render partial: 'users/dossiers/etablissement/infos_entreprise', locals: { etablissement: etablissement } .actions - = link_to 'Utiliser un autre numéro SIRET', siret_dossier_path(@dossier), class: 'button' - = link_to 'Continuer avec ces informations', brouillon_dossier_path(@dossier), class: 'button primary' + = link_to 'Utiliser un autre numéro SIRET', siret_dossier_path(@dossier), class: 'fr-btn fr-btn--secondary' + = link_to 'Continuer avec ces informations', brouillon_dossier_path(@dossier), class: 'fr-btn' diff --git a/app/views/users/dossiers/identite.html.haml b/app/views/users/dossiers/identite.html.haml index a88f947ef..977c0bd31 100644 --- a/app/views/users/dossiers/identite.html.haml +++ b/app/views/users/dossiers/identite.html.haml @@ -32,4 +32,4 @@ = f.label :birthdate = f.date_field :birthdate, value: @dossier.individual.birthdate, placeholder: 'format : AAAA-MM-JJ', required: true, class: "small" - = f.submit t('views.users.dossiers.identite.continue'), class: "button large primary expand" + = f.submit t('views.users.dossiers.identite.continue'), class: "fr-btn fr-btn--lg" From 0e1077487aa1fbee79dda08d7e1f63d07226495c Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 13:03:17 +0200 Subject: [PATCH 34/58] style(autosave): better font-size & link style --- app/views/shared/dossiers/_autosave.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/shared/dossiers/_autosave.html.haml b/app/views/shared/dossiers/_autosave.html.haml index 583f4ee52..74193a643 100644 --- a/app/views/shared/dossiers/_autosave.html.haml +++ b/app/views/shared/dossiers/_autosave.html.haml @@ -1,11 +1,11 @@ .autosave.autosave-state-idle{ data: { controller: 'autosave-status' } } - %p.autosave-explanation + %p.autosave-explanation.fr-text--sm %span.autosave-explanation-text - if dossier.brouillon? = t('views.users.dossiers.autosave.draft_explanation') - else = t('views.users.dossiers.autosave.explanation') - = link_to t('views.users.dossiers.autosave.more_information'), FAQ_AUTOSAVE_URL, target: '_blank', rel: 'noopener', class: 'autosave-more-infos' + = link_to t('views.users.dossiers.autosave.more_information'), FAQ_AUTOSAVE_URL, target: '_blank', rel: 'noopener', class: 'autosave-more-infos fr-link fr-link--sm' %p.autosave-status.succeeded %span.autosave-icon.icon.accept @@ -14,7 +14,7 @@ = t('views.users.dossiers.autosave.draft_confirmation') - else = t('views.users.dossiers.autosave.confirmation') - = link_to t('views.users.dossiers.autosave.more_information'), FAQ_AUTOSAVE_URL, target: '_blank', rel: 'noopener', class: 'autosave-more-infos' + = link_to t('views.users.dossiers.autosave.more_information'), FAQ_AUTOSAVE_URL, target: '_blank', rel: 'noopener', class: 'autosave-more-infos fr-link fr-link--sm' %p.autosave-status.failed %span.autosave-icon ⚠️ From 278b58ef78808af31cac6c989cfade7e678f5054 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 14:03:02 +0200 Subject: [PATCH 35/58] style(instructeurs): restyle dossier actions --- app/assets/stylesheets/dossiers_table.scss | 3 + .../dossiers/_header_actions.html.haml | 55 +++++++++---------- .../dossiers/_state_button.html.haml | 2 +- .../procedures/_dossier_actions.html.haml | 10 ++-- .../procedures/email_notifications.html.haml | 4 +- .../instructeurs/procedures/show.html.haml | 17 +++--- 6 files changed, 46 insertions(+), 45 deletions(-) diff --git a/app/assets/stylesheets/dossiers_table.scss b/app/assets/stylesheets/dossiers_table.scss index aed150198..4d414b15c 100644 --- a/app/assets/stylesheets/dossiers_table.scss +++ b/app/assets/stylesheets/dossiers_table.scss @@ -85,6 +85,9 @@ .follow-col { width: 200px; + .fr-btn { + margin-bottom: 0; + } } } diff --git a/app/views/instructeurs/dossiers/_header_actions.html.haml b/app/views/instructeurs/dossiers/_header_actions.html.haml index a2c0b7704..88e3de189 100644 --- a/app/views/instructeurs/dossiers/_header_actions.html.haml +++ b/app/views/instructeurs/dossiers/_header_actions.html.haml @@ -1,32 +1,31 @@ -%span.dropdown.print-menu-opener{ data: { controller: 'menu-button' } } - %button.button.dropdown-button.icon-only{ title: 'imprimer', 'aria-label': 'imprimer', data: { menu_button_target: 'button' } } - %span.icon.printer - %ul#print-menu.print-menu.dropdown-content{ data: { menu_button_target: 'menu' } } - %li - = link_to "Tout le dossier", print_instructeur_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link" - %li - = link_to "Uniquement cet onglet", "#", onclick: "window.print()", class: "menu-item menu-link" - %li - = link_to "Export PDF", instructeur_dossier_path(dossier.procedure, dossier, format: :pdf), target: "_blank", rel: "noopener", class: "menu-item menu-link" - - if dossier.geo_data? +%ul.fr-btns-group.fr-btns-group--sm.fr-btns-group--inline-md.fr-btns-group--icon-right + %li.dropdown.print-menu-opener{ data: { controller: 'menu-button' } } + %button.fr-btn.fr-btn--secondary.fr-icon-printer-line.dropdown-button{ title: 'imprimer', 'aria-label': 'Imprimer', data: { menu_button_target: 'button' } } Imprimer + %ul#print-menu.print-menu.dropdown-content{ data: { menu_button_target: 'menu' } } %li - = link_to "Export GeoJSON", geo_data_instructeur_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link" + = link_to "Tout le dossier", print_instructeur_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link" + %li + = link_to "Uniquement cet onglet", "#", onclick: "window.print()", class: "menu-item menu-link" + %li + = link_to "Export PDF", instructeur_dossier_path(dossier.procedure, dossier, format: :pdf), target: "_blank", rel: "noopener", class: "menu-item menu-link" + - if dossier.geo_data? + %li + = link_to "Export GeoJSON", geo_data_instructeur_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link" -%span.dropdown.print-menu-opener{ data: { controller: 'menu-button' } } - %button.button.dropdown-button.icon-only{ data: { menu_button_target: 'button' } } - %span.icon.attached - %ul#print-pj-menu.print-menu.dropdown-content{ data: { menu_button_target: 'menu' } } - %li= link_to "Télécharger le dossier et toutes ses pièces jointes", telecharger_pjs_instructeur_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link" + %li.dropdown.print-menu-opener{ data: { controller: 'menu-button' } } + %button.fr-btn.fr-btn--secondary.fr-icon-download-line.dropdown-button{ data: { menu_button_target: 'button', 'aria-label': 'Télécharger' } } Télécharger + %ul#print-pj-menu.print-menu.dropdown-content{ data: { menu_button_target: 'menu' } } + %li= link_to "Télécharger le dossier et toutes ses pièces jointes", telecharger_pjs_instructeur_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link" -= render partial: "instructeurs/procedures/dossier_actions", - locals: { procedure_id: dossier.procedure.id, - dossier_id: dossier.id, - state: dossier.state, - archived: dossier.archived, - dossier_is_followed: current_instructeur&.follow?(dossier), - close_to_expiration: dossier.close_to_expiration?, - hidden_by_administration: dossier.hidden_by_administration? } + %li + = render partial: "instructeurs/procedures/dossier_actions", + locals: { procedure_id: dossier.procedure.id, + dossier_id: dossier.id, + state: dossier.state, + archived: dossier.archived, + dossier_is_followed: current_instructeur&.follow?(dossier), + close_to_expiration: dossier.close_to_expiration?, + hidden_by_administration: dossier.hidden_by_administration? } - -.state-button - = render partial: "state_button", locals: { dossier: dossier } + %li.state-button + = render partial: "state_button", locals: { dossier: dossier } diff --git a/app/views/instructeurs/dossiers/_state_button.html.haml b/app/views/instructeurs/dossiers/_state_button.html.haml index f1b9580f6..875af4cc8 100644 --- a/app/views/instructeurs/dossiers/_state_button.html.haml +++ b/app/views/instructeurs/dossiers/_state_button.html.haml @@ -1,6 +1,6 @@ .dropdown{ data: { controller: 'menu-button', popover: 'true' } } -# Dropdown button title - %button.button.primary.dropdown-button{ class: button_or_label_class(dossier), data: { menu_button_target: 'button' } } + %button.fr-btn.dropdown-button{ class: button_or_label_class(dossier), data: { menu_button_target: 'button' } } = dossier_display_state dossier -# Dropdown content diff --git a/app/views/instructeurs/procedures/_dossier_actions.html.haml b/app/views/instructeurs/procedures/_dossier_actions.html.haml index 7c4cc08c8..68765a6e6 100644 --- a/app/views/instructeurs/procedures/_dossier_actions.html.haml +++ b/app/views/instructeurs/procedures/_dossier_actions.html.haml @@ -1,9 +1,9 @@ - if hidden_by_administration - = link_to restore_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: "button" do + = link_to restore_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: "fr-btn fr-btn--secondary" do = t('views.instructeurs.dossiers.restore') - elsif close_to_expiration || Dossier::TERMINE.include?(state) .dropdown.user-dossier-actions{ data: { controller: 'menu-button' } } - %button.button.dropdown-button{ data: { menu_button_target: 'button' } } + %button.fr-btn.dropdown-button{ data: { menu_button_target: 'button' } } Actions .dropdown-content.fade-in-down{ data: { menu_button_target: 'menu' }, id: "dossier_#{dossier_id}_actions_menu" } %ul.dropdown-items @@ -33,10 +33,8 @@ - elsif Dossier::EN_CONSTRUCTION_OU_INSTRUCTION.include?(state) - if dossier_is_followed - = link_to unfollow_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: 'button' do - %span.icon.unfollow> + = link_to unfollow_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: 'fr-btn fr-btn--secondary fr-icon-star-fill' do = t('views.instructeurs.dossiers.stop_follow') - else - = link_to follow_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: 'button' do - %span.icon.follow> + = link_to follow_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: 'fr-btn fr-btn--secondary fr-icon-star-line' do = t('views.instructeurs.dossiers.follow_file') diff --git a/app/views/instructeurs/procedures/email_notifications.html.haml b/app/views/instructeurs/procedures/email_notifications.html.haml index 2a1f9fa39..7642f6041 100644 --- a/app/views/instructeurs/procedures/email_notifications.html.haml +++ b/app/views/instructeurs/procedures/email_notifications.html.haml @@ -89,5 +89,5 @@ = t('.utils.negative') .send-wrapper - = link_to t('.buttons.back_to_procedure'), instructeur_procedure_path(@procedure), class: 'button mr-1' - = form.submit t('.buttons.save'), class: "button primary" + = link_to t('.buttons.back_to_procedure'), instructeur_procedure_path(@procedure), class: 'fr-btn fr-btn--secondary fr-mr-2w' + = form.submit t('.buttons.save'), class: "fr-btn" diff --git a/app/views/instructeurs/procedures/show.html.haml b/app/views/instructeurs/procedures/show.html.haml index 1ea7b6df5..0a226c1a8 100644 --- a/app/views/instructeurs/procedures/show.html.haml +++ b/app/views/instructeurs/procedures/show.html.haml @@ -134,14 +134,15 @@ - else %a.cell-link{ href: path }= status_badge(p.state) - %td.action-col.follow-col= render partial: 'dossier_actions', - locals: { procedure_id: @procedure.id, - dossier_id: p.dossier_id, - state: p.state, - archived: p.archived, - dossier_is_followed: @followed_dossiers_id.include?(p.dossier_id), - close_to_expiration: @statut == 'expirant', - hidden_by_administration: @statut == 'supprimes_recemment' } + %td.action-col.follow-col + %ul.inline.fr-btns-group.fr-btns-group--sm.fr-btns-group--inline.fr-btns-group--icon-right + = render partial: 'dossier_actions', locals: { procedure_id: @procedure.id, + dossier_id: p.dossier_id, + state: p.state, + archived: p.archived, + dossier_is_followed: @followed_dossiers_id.include?(p.dossier_id), + close_to_expiration: @statut == 'expirant', + hidden_by_administration: @statut == 'supprimes_recemment' } = pagination - else From fd3b30d8e6bdfa0c62997bf2857b65d58dace4a6 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 14:25:54 +0200 Subject: [PATCH 36/58] style(messagerie): improve font-size & styles --- app/assets/stylesheets/message.scss | 6 ------ .../dossiers/message_component/message_component.html.haml | 6 +++--- app/views/instructeurs/dossiers/_header_actions.html.haml | 4 ++-- .../dossiers/_state_button_motivation.html.haml | 2 +- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/app/assets/stylesheets/message.scss b/app/assets/stylesheets/message.scss index a11507ede..488e3f516 100644 --- a/app/assets/stylesheets/message.scss +++ b/app/assets/stylesheets/message.scss @@ -25,12 +25,6 @@ font-weight: bold; } - .guest, - .date { - font-size: 12px; - color: $dark-grey; - } - .date { float: right; } diff --git a/app/components/dossiers/message_component/message_component.html.haml b/app/components/dossiers/message_component/message_component.html.haml index 1e75d85b4..980ef7398 100644 --- a/app/components/dossiers/message_component/message_component.html.haml +++ b/app/components/dossiers/message_component/message_component.html.haml @@ -1,12 +1,12 @@ = image_tag(icon_path, class: 'person-icon', alt: '') .width-100 - %h2 + %h2.fr-h6 %span.mail = commentaire_issuer - if commentaire_from_guest? - %span.guest= t('.guest') - %span.date{ class: highlight_if_unseen_class, data: scroll_to_target } + %span.fr-text--xs.fr-text-mention--grey.font-weight-normal= t('.guest') + %span.date{ class: ["fr-text--xs", "fr-text-mention--grey", "font-weight-normal", highlight_if_unseen_class], data: scroll_to_target } = commentaire_date .rich-text= commentaire_body diff --git a/app/views/instructeurs/dossiers/_header_actions.html.haml b/app/views/instructeurs/dossiers/_header_actions.html.haml index 88e3de189..9a03b37ce 100644 --- a/app/views/instructeurs/dossiers/_header_actions.html.haml +++ b/app/views/instructeurs/dossiers/_header_actions.html.haml @@ -1,6 +1,6 @@ %ul.fr-btns-group.fr-btns-group--sm.fr-btns-group--inline-md.fr-btns-group--icon-right %li.dropdown.print-menu-opener{ data: { controller: 'menu-button' } } - %button.fr-btn.fr-btn--secondary.fr-icon-printer-line.dropdown-button{ title: 'imprimer', 'aria-label': 'Imprimer', data: { menu_button_target: 'button' } } Imprimer + %button.fr-btn.fr-btn--tertiary.fr-icon-printer-line.dropdown-button{ title: 'imprimer', 'aria-label': 'Imprimer', data: { menu_button_target: 'button' } } Imprimer %ul#print-menu.print-menu.dropdown-content{ data: { menu_button_target: 'menu' } } %li = link_to "Tout le dossier", print_instructeur_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link" @@ -13,7 +13,7 @@ = link_to "Export GeoJSON", geo_data_instructeur_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link" %li.dropdown.print-menu-opener{ data: { controller: 'menu-button' } } - %button.fr-btn.fr-btn--secondary.fr-icon-download-line.dropdown-button{ data: { menu_button_target: 'button', 'aria-label': 'Télécharger' } } Télécharger + %button.fr-btn.fr-btn--tertiary.fr-icon-download-line.dropdown-button{ data: { menu_button_target: 'button', 'aria-label': 'Télécharger' } } Télécharger %ul#print-pj-menu.print-menu.dropdown-content{ data: { menu_button_target: 'menu' } } %li= link_to "Télécharger le dossier et toutes ses pièces jointes", telecharger_pjs_instructeur_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link" diff --git a/app/views/instructeurs/dossiers/_state_button_motivation.html.haml b/app/views/instructeurs/dossiers/_state_button_motivation.html.haml index 46b55477d..4805192c5 100644 --- a/app/views/instructeurs/dossiers/_state_button_motivation.html.haml +++ b/app/views/instructeurs/dossiers/_state_button_motivation.html.haml @@ -1,5 +1,5 @@ .motivation.hidden{ class: popup_class } - %h3 + %h3.fr-h5 %span.icon{ class: popup_class } #{popup_title} From 0a2460ba71feb96f68585d4bc585977c3babe7bf Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 14:42:14 +0200 Subject: [PATCH 37/58] style(admin): fix various links / buttons style --- app/assets/stylesheets/admin-procedures-list.scss | 4 ++-- app/assets/stylesheets/procedure_admin.scss | 8 ++++++++ .../procedures/_procedures_list.html.haml | 14 +++++++------- .../administrateurs/procedures/index.html.haml | 2 +- .../administrateurs/procedures/show.html.haml | 4 ++-- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/app/assets/stylesheets/admin-procedures-list.scss b/app/assets/stylesheets/admin-procedures-list.scss index 16b41aff6..8369465a0 100644 --- a/app/assets/stylesheets/admin-procedures-list.scss +++ b/app/assets/stylesheets/admin-procedures-list.scss @@ -11,7 +11,7 @@ .admin-procedures-list-row.infos { align-items: flex-start; - a { - color: $blue-france-500; + a:not(:hover) { + background-image: none; // remove DSFR underline } } diff --git a/app/assets/stylesheets/procedure_admin.scss b/app/assets/stylesheets/procedure_admin.scss index 0ca1fb781..0ac90e1f7 100644 --- a/app/assets/stylesheets/procedure_admin.scss +++ b/app/assets/stylesheets/procedure_admin.scss @@ -2,6 +2,10 @@ .procedure-grid { display: flex; flex-wrap: wrap; + + & > a { + background-image: none; // remove DSFR underline + } } .procedure-admin-container { @@ -12,6 +16,10 @@ .button { margin-right: 10px; } + + a { + background-image: none; // remove DSFR underline + } } .procedure-admin-listing-container { diff --git a/app/views/administrateurs/procedures/_procedures_list.html.haml b/app/views/administrateurs/procedures/_procedures_list.html.haml index 1b360814d..7c0d12d9b 100644 --- a/app/views/administrateurs/procedures/_procedures_list.html.haml +++ b/app/views/administrateurs/procedures/_procedures_list.html.haml @@ -6,7 +6,7 @@ .flex.column.ml-1 .card-title = link_to procedure.libelle, admin_procedure_path(procedure), style: 'color: black;' - = link_to(procedure_lien(procedure), procedure_lien(procedure), class: 'mb-1') + = link_to(procedure_lien(procedure), procedure_lien(procedure), class: 'fr-link fr-mb-1w') .admin-procedures-list-timestamps %p.notice N° #{procedure.id} @@ -36,13 +36,13 @@ %span.icon.folder %span.badge.baseline= procedure.dossiers.state_not_brouillon.visible_by_administration.count - %div + %ul.fr-btns-group.fr-btns-group--sm.fr-btns-group--inline.fr-btns-group--icon-right - unless procedure.discarded? - = link_to admin_procedure_path(procedure), class: 'button mr-1 edit-procedure' do - %span.icon.edit - Modifier - .dropdown{ data: { controller: 'menu-button' } } - %button.button.dropdown-button.procedures-actions-btn{ data: { menu_button_target: 'button' } } + %li + = link_to admin_procedure_path(procedure), class: 'fr-btn fr-icon-draft-line fr-btn--tertiary' do + Modifier + %li.dropdown{ data: { controller: 'menu-button' } } + %button.fr-btn.fr-btn--tertiary.dropdown-button.procedures-actions-btn{ data: { menu_button_target: 'button' } } Actions .dropdown-content.fade-in-down{ data: { menu_button_target: 'menu' }, id: dom_id(procedure, :actions_menu) } %ul.dropdown-items.pl-0 diff --git a/app/views/administrateurs/procedures/index.html.haml b/app/views/administrateurs/procedures/index.html.haml index 447624c63..bb261a189 100644 --- a/app/views/administrateurs/procedures/index.html.haml +++ b/app/views/administrateurs/procedures/index.html.haml @@ -1,6 +1,6 @@ .sub-header .procedure-admin-listing-container - = link_to "Nouvelle Démarche", new_from_existing_admin_procedures_path, id: 'new-procedure', class: 'button primary' + = link_to "Nouvelle Démarche", new_from_existing_admin_procedures_path, id: 'new-procedure', class: 'fr-btn' .container %nav.tabs diff --git a/app/views/administrateurs/procedures/show.html.haml b/app/views/administrateurs/procedures/show.html.haml index f742ce1ab..5df800982 100644 --- a/app/views/administrateurs/procedures/show.html.haml +++ b/app/views/administrateurs/procedures/show.html.haml @@ -49,8 +49,8 @@ = t(:has_changes, scope: [:administrateurs, :revision_changes]) = render partial: 'revision_changes', locals: { changes: @procedure.revision_changes } .flex.mt-2.justify-end - = button_to "Réinitialiser les modifications", admin_procedure_reset_draft_path(@procedure), class: 'button mr-1', method: :put - = link_to 'Publier les modifications', admin_procedure_publication_path(@procedure), class: 'button primary', id: 'publish-procedure-link', data: { disable_with: "Publication..." } + = button_to "Réinitialiser les modifications", admin_procedure_reset_draft_path(@procedure), class: 'fr-btn fr-btn--secondary fr-mr-2w', method: :put + = link_to 'Publier les modifications', admin_procedure_publication_path(@procedure), class: 'fr-btn', id: 'publish-procedure-link', data: { disable_with: "Publication..." } - if !@procedure.procedure_expires_when_termine_enabled? = render partial: 'administrateurs/procedures/suggest_expires_when_termine', locals: { procedure: @procedure } From fa9bc5d18581aaaf754737f80970dd6e88241c71 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 15:10:20 +0200 Subject: [PATCH 38/58] style(admin): multiple style improvements, essentially links & buttons --- app/assets/stylesheets/archive.scss | 4 ++++ app/assets/stylesheets/attachment.scss | 8 ++++++++ app/assets/stylesheets/procedure_champs_editor.scss | 3 --- app/views/administrateurs/_breadcrumbs.html.haml | 4 ++-- .../administrateurs/attestation_templates/edit.html.haml | 4 ++-- .../groupe_instructeurs/_instructeurs.html.haml | 6 +++--- .../groupe_instructeurs/_routing.html.haml | 4 ++-- app/views/administrateurs/mail_templates/index.html.haml | 2 +- app/views/administrateurs/procedures/edit.html.haml | 4 ++-- app/views/administrateurs/procedures/new.html.haml | 4 ++-- app/views/users/dossiers/_merci.html.haml | 4 ++-- config/locales/views/layouts/_breadcrumb.en.yml | 2 +- config/locales/views/layouts/_breadcrumb.fr.yml | 2 +- 13 files changed, 30 insertions(+), 21 deletions(-) diff --git a/app/assets/stylesheets/archive.scss b/app/assets/stylesheets/archive.scss index 676c6cbe9..91da1e4ca 100644 --- a/app/assets/stylesheets/archive.scss +++ b/app/assets/stylesheets/archive.scss @@ -12,4 +12,8 @@ table.archive-table { td { padding: 3 * $default-spacer $default-spacer; } + + a.button { + background-image: none; // remove DSFR underline + } } diff --git a/app/assets/stylesheets/attachment.scss b/app/assets/stylesheets/attachment.scss index 20d21a2fc..537d4adbf 100644 --- a/app/assets/stylesheets/attachment.scss +++ b/app/assets/stylesheets/attachment.scss @@ -11,6 +11,14 @@ .button { text-transform: lowercase; + background-image: none; // remove DSFR underline + } + +} + +.attachment-link { + a:not(:hover) { + background-image: none; // remove DSFR underline } } diff --git a/app/assets/stylesheets/procedure_champs_editor.scss b/app/assets/stylesheets/procedure_champs_editor.scss index 8c26e2c40..b8d524eff 100644 --- a/app/assets/stylesheets/procedure_champs_editor.scss +++ b/app/assets/stylesheets/procedure_champs_editor.scss @@ -158,9 +158,6 @@ font-size: 14px; a { - text-decoration: underline; - text-decoration-style: dotted; - // Remove the icon indicating an external link (for less visual noise) &[target="_blank"]::after { display: none; diff --git a/app/views/administrateurs/_breadcrumbs.html.haml b/app/views/administrateurs/_breadcrumbs.html.haml index a31bbd9dc..80c59b2c5 100644 --- a/app/views/administrateurs/_breadcrumbs.html.haml +++ b/app/views/administrateurs/_breadcrumbs.html.haml @@ -17,8 +17,8 @@ - if defined?(preview) && preview .mb-2 - = link_to t('preview', scope: [:layouts, :breadcrumb]), apercu_admin_procedure_path(@procedure), target: "_blank", rel: "noopener", class: 'button' - = link_to t('continue', scope: [:layouts, :breadcrumb]), admin_procedure_path(@procedure), title: t('continue_title', scope: [:layouts, :breadcrumb]), class: 'button accepted' + = link_to t('preview', scope: [:layouts, :breadcrumb]), apercu_admin_procedure_path(@procedure), target: "_blank", rel: "noopener", class: 'fr-btn fr-btn--secondary' + = link_to t('continue', scope: [:layouts, :breadcrumb]), admin_procedure_path(@procedure), title: t('continue_title', scope: [:layouts, :breadcrumb]), class: 'fr-btn fr-ml-2w fr-btn--icon-right fr-icon-arrow-right-fill' - if defined?(metadatas) .metadatas.pb-3 diff --git a/app/views/administrateurs/attestation_templates/edit.html.haml b/app/views/administrateurs/attestation_templates/edit.html.haml index 51369375e..e70e0168a 100644 --- a/app/views/administrateurs/attestation_templates/edit.html.haml +++ b/app/views/administrateurs/attestation_templates/edit.html.haml @@ -36,8 +36,8 @@ %span.toggle-switch-label.off Attestation désactivée .actions-right - = link_to 'Annuler', edit_admin_procedure_attestation_template_path(id: @procedure), class: 'button', data: { confirm: 'Êtes-vous sûr de vouloir annuler les modifications effectuées ?'} - = f.button 'Enregistrer', class: 'button primary send' + = link_to 'Annuler', edit_admin_procedure_attestation_template_path(id: @procedure), class: 'fr-btn fr-btn--secondary fr-mr-2w', data: { confirm: 'Êtes-vous sûr de vouloir annuler les modifications effectuées ?'} + = f.button 'Enregistrer', class: 'fr-btn' .procedure-form__column--preview .procedure-form__preview.sticky--top diff --git a/app/views/administrateurs/groupe_instructeurs/_instructeurs.html.haml b/app/views/administrateurs/groupe_instructeurs/_instructeurs.html.haml index ccd414e93..c9a42f9ef 100644 --- a/app/views/administrateurs/groupe_instructeurs/_instructeurs.html.haml +++ b/app/views/administrateurs/groupe_instructeurs/_instructeurs.html.haml @@ -18,7 +18,7 @@ label: 'Emails', acceptNewValues: true) - = f.submit 'Affecter', class: 'button primary send', disabled: disabled_as_super_admin + = f.submit 'Affecter', class: 'fr-btn', disabled: disabled_as_super_admin %table.table.mt-2 %thead @@ -32,11 +32,11 @@ #{instructeur.email} - confirmation_message = procedure.routee? ? "Êtes-vous sûr de vouloir retirer l’instructeur « #{instructeur.email} » du groupe « #{groupe_instructeur.label} » ?" : "Êtes-vous sûr de vouloir retirer l’instructeur « #{instructeur.email} » de la démarche ?" - %td.actions= button_to 'retirer', + %td.actions= button_to 'Retirer', { action: :remove_instructeur, id: groupe_instructeur.id }, { method: :delete, data: { confirm: confirmation_message }, params: { instructeur: { id: instructeur.id }}, - class: 'button' } + class: 'fr-btn fr-btn--secondary' } = paginate instructeurs diff --git a/app/views/administrateurs/groupe_instructeurs/_routing.html.haml b/app/views/administrateurs/groupe_instructeurs/_routing.html.haml index 75128b56c..471f580d0 100644 --- a/app/views/administrateurs/groupe_instructeurs/_routing.html.haml +++ b/app/views/administrateurs/groupe_instructeurs/_routing.html.haml @@ -6,9 +6,9 @@ - if procedure.routee? - if procedure.routing_enabled? && procedure.groupe_instructeurs.size == 1 - = link_to t('.button.routing_disable'), update_routing_enabled_admin_procedure_groupe_instructeurs_path(procedure, routing: :disable), class: 'button primary mt-1', method: 'patch' + = link_to t('.button.routing_disable'), update_routing_enabled_admin_procedure_groupe_instructeurs_path(procedure, routing: :disable), class: 'fr-btn', method: 'patch' - else - = link_to t('.button.routing_enable'), update_routing_enabled_admin_procedure_groupe_instructeurs_path(procedure, routing: :enable), class: 'button primary mt-1', method: 'patch' + = link_to t('.button.routing_enable'), update_routing_enabled_admin_procedure_groupe_instructeurs_path(procedure, routing: :enable), class: 'fr-btn', method: 'patch' .card %h2.card-title L‘autogestion des instructeurs %p.notice= t('.self_managment_notice_html') diff --git a/app/views/administrateurs/mail_templates/index.html.haml b/app/views/administrateurs/mail_templates/index.html.haml index fa3095faf..88412f14d 100644 --- a/app/views/administrateurs/mail_templates/index.html.haml +++ b/app/views/administrateurs/mail_templates/index.html.haml @@ -15,4 +15,4 @@ %span.badge.baseline modifié le #{mail_template.updated_at.strftime('%d-%m-%Y')} %div - = link_to 'Modifier', edit_admin_procedure_mail_template_path(@procedure, mail_template.class.const_get(:SLUG)), class: 'button' + = link_to 'Modifier', edit_admin_procedure_mail_template_path(@procedure, mail_template.class.const_get(:SLUG)), class: 'fr-btn' diff --git a/app/views/administrateurs/procedures/edit.html.haml b/app/views/administrateurs/procedures/edit.html.haml index b39d688e4..81d97a080 100644 --- a/app/views/administrateurs/procedures/edit.html.haml +++ b/app/views/administrateurs/procedures/edit.html.haml @@ -17,8 +17,8 @@ .procedure-form__actions.sticky--bottom .actions-right - = link_to 'Annuler', admin_procedure_path(id: @procedure), class: 'button', data: { confirm: 'Êtes-vous sûr de vouloir annuler les modifications effectuées ?'} - = f.button 'Enregistrer', class: 'button primary send' + = link_to 'Annuler', admin_procedure_path(id: @procedure), class: 'fr-btn fr-btn--secondary fr-mr-2w', data: { confirm: 'Êtes-vous sûr de vouloir annuler les modifications effectuées ?'} + = f.button 'Enregistrer', class: 'fr-btn' .procedure-form__column--preview .procedure-form__preview.sticky--top diff --git a/app/views/administrateurs/procedures/new.html.haml b/app/views/administrateurs/procedures/new.html.haml index e5c57ad64..ba0586866 100644 --- a/app/views/administrateurs/procedures/new.html.haml +++ b/app/views/administrateurs/procedures/new.html.haml @@ -17,8 +17,8 @@ .procedure-form__actions.sticky--bottom .actions-right - = link_to 'Annuler', admin_procedures_path, class: 'button', data: { confirm: 'Êtes-vous sûr de vouloir annuler la création de cette démarche ?'} - = f.button 'Créer la démarche', class: 'button primary send' + = link_to 'Annuler', admin_procedures_path, class: 'fr-btn fr-btn--secondary fr-mr-2w', data: { confirm: 'Êtes-vous sûr de vouloir annuler la création de cette démarche ?'} + = f.button 'Créer la démarche', class: 'fr-btn' .procedure-form__column--preview .procedure-form__preview.sticky--top diff --git a/app/views/users/dossiers/_merci.html.haml b/app/views/users/dossiers/_merci.html.haml index cf978b6db..1b1d9c8de 100644 --- a/app/views/users/dossiers/_merci.html.haml +++ b/app/views/users/dossiers/_merci.html.haml @@ -19,8 +19,8 @@ %p.m-2= procedure.active_dossier_submitted_message.message_on_submit_by_usager .flex.column.align-center - = link_to t('views.users.dossiers.merci.acces_dossier'), dossier ? dossier_path(dossier) : "#dossier" , class: 'button large primary mt-4' - = link_to t('views.users.dossiers.merci.submit_dossier'), procedure_lien(procedure), class: 'mt-4' + = link_to t('views.users.dossiers.merci.acces_dossier'), dossier ? dossier_path(dossier) : "#dossier" , class: 'fr-btn fr-btn--xl fr-mt-5w' + = link_to t('views.users.dossiers.merci.submit_dossier'), procedure_lien(procedure), class: 'fr-btn fr-btn--secondary fr-mt-3w' .monavis != procedure.monavis_embed diff --git a/config/locales/views/layouts/_breadcrumb.en.yml b/config/locales/views/layouts/_breadcrumb.en.yml index fb74a8b05..dfd8fdf86 100644 --- a/config/locales/views/layouts/_breadcrumb.en.yml +++ b/config/locales/views/layouts/_breadcrumb.en.yml @@ -5,7 +5,7 @@ en: you_are_here: "You are here" show: Show breadcrumb preview: "Preview the form" - continue: "Continue >" + continue: "Continue" continue_title: "You can comeback using this link" created_at: "Created at %{date} - n° %{number}" closed_at: "Closed at %{date}" diff --git a/config/locales/views/layouts/_breadcrumb.fr.yml b/config/locales/views/layouts/_breadcrumb.fr.yml index ca496ba6c..9febfe3fc 100644 --- a/config/locales/views/layouts/_breadcrumb.fr.yml +++ b/config/locales/views/layouts/_breadcrumb.fr.yml @@ -5,7 +5,7 @@ fr: you_are_here: "Vous êtes ici" show: "Voir le fil d’Ariane" preview: "Prévisualiser le formulaire" - continue: "Continuer >" + continue: "Continuer" continue_title: "Vous pourrez revenir ici par la suite" created_at: "Créée le %{date} - n° %{number}" closed_at: "Close le %{date}" From 0480a0336d1759a81b62288af955c42151f34412 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 17:01:29 +0200 Subject: [PATCH 39/58] fix(scss): lint errors --- app/assets/stylesheets/dossiers_table.scss | 1 + app/assets/stylesheets/dsfr.scss | 2 +- app/assets/stylesheets/procedure_admin.scss | 3 +-- app/assets/stylesheets/procedure_list.scss | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/dossiers_table.scss b/app/assets/stylesheets/dossiers_table.scss index 4d414b15c..9e879c381 100644 --- a/app/assets/stylesheets/dossiers_table.scss +++ b/app/assets/stylesheets/dossiers_table.scss @@ -85,6 +85,7 @@ .follow-col { width: 200px; + .fr-btn { margin-bottom: 0; } diff --git a/app/assets/stylesheets/dsfr.scss b/app/assets/stylesheets/dsfr.scss index 1ff018395..b96a48cac 100644 --- a/app/assets/stylesheets/dsfr.scss +++ b/app/assets/stylesheets/dsfr.scss @@ -32,7 +32,7 @@ textarea { } fieldset { - border: 0; + border: none; padding-left: 0; padding-bottom: 0; } diff --git a/app/assets/stylesheets/procedure_admin.scss b/app/assets/stylesheets/procedure_admin.scss index 0ac90e1f7..707de6a80 100644 --- a/app/assets/stylesheets/procedure_admin.scss +++ b/app/assets/stylesheets/procedure_admin.scss @@ -1,9 +1,8 @@ - .procedure-grid { display: flex; flex-wrap: wrap; - & > a { + > a { background-image: none; // remove DSFR underline } } diff --git a/app/assets/stylesheets/procedure_list.scss b/app/assets/stylesheets/procedure_list.scss index 22cd4431e..de047e700 100644 --- a/app/assets/stylesheets/procedure_list.scss +++ b/app/assets/stylesheets/procedure_list.scss @@ -11,8 +11,8 @@ } a { - background-image: none; // remove DSFR underline @include vertical-padding(24px); + background-image: none; // remove DSFR underline color: $black; width: 100%; From df1d7ae2bd98b10c1af50e51655945b635332db2 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 18:08:00 +0200 Subject: [PATCH 40/58] style(procedures): dsfr compat instructeurs/expert procedures list --- app/assets/stylesheets/procedure_list.scss | 40 ++--- app/helpers/procedure_helper.rb | 8 +- app/views/experts/avis/index.html.haml | 67 ++++---- .../instructeurs/procedures/_list.html.haml | 144 +++++++++--------- 4 files changed, 124 insertions(+), 135 deletions(-) diff --git a/app/assets/stylesheets/procedure_list.scss b/app/assets/stylesheets/procedure_list.scss index de047e700..fc7a50e93 100644 --- a/app/assets/stylesheets/procedure_list.scss +++ b/app/assets/stylesheets/procedure_list.scss @@ -4,26 +4,11 @@ .procedure-list { .procedure-item { - border-bottom: 1px solid $border-grey; + background-color: rgba(0, 0, 0, 0.02); + } - &:last-child { - border-bottom: none; - } - - a { - @include vertical-padding(24px); - background-image: none; // remove DSFR underline - color: $black; - width: 100%; - - &:hover { - background-color: $light-grey; - - .procedure-title { - text-decoration: underline; - } - } - } + .procedure-logo-link { + background-image: none; } .procedure-logo { @@ -35,32 +20,29 @@ background-position: 95% 50%; } - .procedure-title { - min-height: 40px; - font-size: 20px; - margin-bottom: 16px; - } - .procedure-status { margin-left: auto; } .procedure-stats { list-style-type: none; + padding-inline-start: 0; li { min-height: 36px; - border-left: 1px solid $border-grey; width: 90px; position: relative; + border-left: 1px solid $border-grey; + + &:first-child { + border-left: none; + } + &:hover { background-color: rgba(0, 0, 0, 0.05); } - &:last-child { - border-right: 1px solid $border-grey; - } .stats-number, .stats-legend { diff --git a/app/helpers/procedure_helper.rb b/app/helpers/procedure_helper.rb index 2fc0a781e..7184f39e6 100644 --- a/app/helpers/procedure_helper.rb +++ b/app/helpers/procedure_helper.rb @@ -8,11 +8,17 @@ module ProcedureHelper end def procedure_libelle(procedure) - parts = procedure.brouillon? ? [tag.span(t('helpers.procedure.testing_procedure'), class: 'badge')] : [] + parts = procedure.brouillon? ? [procedure_badge(procedure)] : [] parts << procedure.libelle safe_join(parts, ' ') end + def procedure_badge(procedure) + return nil unless procedure.brouillon? + + tag.span(t('helpers.procedure.testing_procedure'), class: 'fr-badge') + end + def procedure_publish_label(procedure, key) # i18n-tasks-use t('modal.publish.body.publish') # i18n-tasks-use t('modal.publish.body.reopen') diff --git a/app/views/experts/avis/index.html.haml b/app/views/experts/avis/index.html.haml index 75c482834..b3d2dd845 100644 --- a/app/views/experts/avis/index.html.haml +++ b/app/views/experts/avis/index.html.haml @@ -5,39 +5,40 @@ %ul.procedure-list - @avis_by_procedure.each do |p, procedure_avis| - %li.procedure-item.flex.align-start - = link_to(procedure_instructeur_avis_index_path(p)) do - .flex - + %li.procedure-item.flex.align-start.fr-my-3w.fr-p-2w + .flex + = link_to instructeur_procedure_path(p), class: 'procedure-logo-link' do .procedure-logo{ style: "background-image: url(#{p.logo_url})" } - .procedure-details - %p.procedure-title - = procedure_libelle p - %ul.procedure-stats.flex - %li - %object - = link_to(procedure_instructeur_avis_index_path(p, statut: Instructeurs::AvisController::A_DONNER_STATUS)) do - - without_answer_count = procedure_avis.select { |a| a.answer.nil? }.size - - if without_answer_count > 0 - %span.notifications{ 'aria-label': "notifications" } - .stats-number - = without_answer_count - .stats-legend - avis à donner - %li - %object - = link_to(procedure_instructeur_avis_index_path(p, statut: Instructeurs::AvisController::DONNES_STATUS)) do - - with_answer_count = procedure_avis.select { |a| a.answer.present? }.size - .stats-number= with_answer_count - .stats-legend - = pluralize(with_answer_count, "avis donné") + .procedure-details + %p.fr-mb-2w + = procedure_badge(p) + = link_to(p.libelle, procedure_instructeur_avis_index_path(p), class: "fr-link fr-ml-1w") - - if p.close? - .procedure-status - %span.label - = t('helpers.procedure.close') - - elsif p.depubliee? - .procedure-status - %span.label - = t('helpers.procedure.unpublished') + %ul.procedure-stats.flex + %li + %object + = link_to(procedure_instructeur_avis_index_path(p, statut: Instructeurs::AvisController::A_DONNER_STATUS)) do + - without_answer_count = procedure_avis.select { |a| a.answer.nil? }.size + - if without_answer_count > 0 + %span.notifications{ 'aria-label': "notifications" } + .stats-number + = without_answer_count + .stats-legend + avis à donner + %li + %object + = link_to(procedure_instructeur_avis_index_path(p, statut: Instructeurs::AvisController::DONNES_STATUS)) do + - with_answer_count = procedure_avis.select { |a| a.answer.present? }.size + .stats-number= with_answer_count + .stats-legend + = pluralize(with_answer_count, "avis donné") + + - if p.close? + .procedure-status + %span.label + = t('helpers.procedure.close') + - elsif p.depubliee? + .procedure-status + %span.label + = t('helpers.procedure.unpublished') diff --git a/app/views/instructeurs/procedures/_list.html.haml b/app/views/instructeurs/procedures/_list.html.haml index 863894e90..9d7b57431 100644 --- a/app/views/instructeurs/procedures/_list.html.haml +++ b/app/views/instructeurs/procedures/_list.html.haml @@ -1,81 +1,81 @@ -%li.procedure-item.flex.align-start - = link_to(instructeur_procedure_path(p)) do - .flex - +%li.procedure-item.flex.align-start.fr-my-3w.fr-p-2w + .flex + = link_to instructeur_procedure_path(p), class: 'procedure-logo-link' do .procedure-logo{ style: "background-image: url(#{p.logo_url})" } - .procedure-details - %p.procedure-title - = procedure_libelle p - %ul.procedure-stats.flex - %li - %object - = link_to(instructeur_procedure_path(p, statut: 'a-suivre')) do - - a_suivre_count = dossiers_a_suivre_count_per_procedure[p.id] || 0 - .stats-number - = number_with_html_delimiter(a_suivre_count) - .stats-legend - = t('instructeurs.dossiers.labels.to_follow') - %li - %object - = link_to(instructeur_procedure_path(p, statut: 'suivis')) do - - if procedure_ids_en_cours_with_notifications.include?(p.id) - %span.notifications{ 'aria-label': "notifications" } - - followed_count = followed_dossiers_count_per_procedure[p.id] || 0 - .stats-number - = number_with_html_delimiter(followed_count) - .stats-legend - = t('pluralize.followed', count: followed_count) - %li - %object - = link_to(instructeur_procedure_path(p, statut: 'traites')) do - - if procedure_ids_termines_with_notifications.include?(p.id) - %span.notifications{ 'aria-label': "notifications" } - - termines_count = dossiers_termines_count_per_procedure[p.id] || 0 - .stats-number - = number_with_html_delimiter(termines_count) - .stats-legend - = t('pluralize.processed', count: termines_count) - %li - %object - = link_to(instructeur_procedure_path(p, statut: 'tous')) do - - dossier_count = dossiers_count_per_procedure[p.id] || 0 - .stats-number - = number_with_html_delimiter(dossier_count) - .stats-legend - = t('pluralize.case', count: dossier_count) + .procedure-details + %p.fr-mb-2w + = procedure_badge(p) + = link_to(p.libelle, instructeur_procedure_path(p), class: "fr-link fr-ml-1w") + %ul.procedure-stats.flex + %li + %object + = link_to(instructeur_procedure_path(p, statut: 'a-suivre')) do + - a_suivre_count = dossiers_a_suivre_count_per_procedure[p.id] || 0 + .stats-number + = number_with_html_delimiter(a_suivre_count) + .stats-legend + = t('instructeurs.dossiers.labels.to_follow') + %li + %object + = link_to(instructeur_procedure_path(p, statut: 'suivis')) do + - if procedure_ids_en_cours_with_notifications.include?(p.id) + %span.notifications{ 'aria-label': "notifications" } + - followed_count = followed_dossiers_count_per_procedure[p.id] || 0 + .stats-number + = number_with_html_delimiter(followed_count) + .stats-legend + = t('pluralize.followed', count: followed_count) + %li + %object + = link_to(instructeur_procedure_path(p, statut: 'traites')) do + - if procedure_ids_termines_with_notifications.include?(p.id) + %span.notifications{ 'aria-label': "notifications" } + - termines_count = dossiers_termines_count_per_procedure[p.id] || 0 + .stats-number + = number_with_html_delimiter(termines_count) + .stats-legend + = t('pluralize.processed', count: termines_count) + %li + %object + = link_to(instructeur_procedure_path(p, statut: 'tous')) do + - dossier_count = dossiers_count_per_procedure[p.id] || 0 + .stats-number + = number_with_html_delimiter(dossier_count) + .stats-legend + = t('pluralize.case', count: dossier_count) + %li + %object + = link_to(instructeur_procedure_path(p, statut: 'supprimes_recemment')) do + - dossier_count = dossiers_supprimes_recemment_count_per_procedure[p.id] || 0 + .stats-number + = number_with_html_delimiter(dossier_count) + .stats-legend + = t('pluralize.dossiers_supprimes_recemment', count: dossier_count) + + - if p.procedure_expires_when_termine_enabled %li %object - = link_to(instructeur_procedure_path(p, statut: 'supprimes_recemment')) do - - dossier_count = dossiers_supprimes_recemment_count_per_procedure[p.id] || 0 + = link_to(instructeur_procedure_path(p, statut: 'expirant')) do + - expirant_count = dossiers_expirant_count_per_procedure[p.id] || 0 .stats-number - = number_with_html_delimiter(dossier_count) + = number_with_html_delimiter(expirant_count) .stats-legend - = t('pluralize.dossiers_supprimes_recemment', count: dossier_count) + = t('pluralize.dossiers_close_to_expiration', count: expirant_count) - - if p.procedure_expires_when_termine_enabled - %li - %object - = link_to(instructeur_procedure_path(p, statut: 'expirant')) do - - expirant_count = dossiers_expirant_count_per_procedure[p.id] || 0 - .stats-number - = number_with_html_delimiter(expirant_count) - .stats-legend - = t('pluralize.dossiers_close_to_expiration', count: expirant_count) + %li + %object + = link_to(instructeur_procedure_path(p, statut: 'archives')) do + - archived_count = dossiers_archived_count_per_procedure[p.id] || 0 + .stats-number + = number_with_html_delimiter(archived_count) + .stats-legend + = t('pluralize.archived', count: archived_count) - %li - %object - = link_to(instructeur_procedure_path(p, statut: 'archives')) do - - archived_count = dossiers_archived_count_per_procedure[p.id] || 0 - .stats-number - = number_with_html_delimiter(archived_count) - .stats-legend - = t('pluralize.archived', count: archived_count) - - - if p.close? - .procedure-status - %span.label Close - - elsif p.depubliee? - .procedure-status - %span.label Dépubliée + - if p.close? + .procedure-status + %span.label Close + - elsif p.depubliee? + .procedure-status + %span.label Dépubliée From c5092fda1214b0911c920a8644dee49c413e0719 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 18:08:26 +0200 Subject: [PATCH 41/58] style(expert): fix avis weight/font-size --- app/assets/stylesheets/avis.scss | 6 ------ app/views/experts/avis/instruction.html.haml | 6 +++--- app/views/experts/shared/avis/_list.html.haml | 16 ++++++++-------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/app/assets/stylesheets/avis.scss b/app/assets/stylesheets/avis.scss index ca4c4a941..1c93b064c 100644 --- a/app/assets/stylesheets/avis.scss +++ b/app/assets/stylesheets/avis.scss @@ -115,12 +115,6 @@ } } - .date, - .waiting { - font-size: 12px; - color: $dark-grey; - } - .date { float: right; } diff --git a/app/views/experts/avis/instruction.html.haml b/app/views/experts/avis/instruction.html.haml index e5eeb8800..b566e9c2c 100644 --- a/app/views/experts/avis/instruction.html.haml +++ b/app/views/experts/avis/instruction.html.haml @@ -7,8 +7,8 @@ %h1.tab-title Donner votre avis %h2.claimant Demandeur : - %span.email= safe_claimant_email(@avis.claimant) - %span.date Demande d’avis envoyée le #{l(@avis.created_at, format: '%d/%m/%y')} + %span.email.font-weight-normal= safe_claimant_email(@avis.claimant) + %span.date.font-weight-normal Demande d’avis envoyée le #{l(@avis.created_at, format: '%d/%m/%y')} %p.introduction= @avis.introduction - if @avis.introduction_file.attached? @@ -29,7 +29,7 @@ %span Cet avis est partagé avec les autres experts .send-wrapper - = f.submit 'Envoyer votre avis', class: 'button send' + = f.submit 'Envoyer votre avis', class: 'fr-btn' - if !@dossier.termine? && !@avis.procedure.feature_enabled?(:expert_not_allowed_to_invite) = render partial: "experts/shared/avis/form", locals: { url: avis_expert_avis_path(@avis.procedure, @avis), linked_dossiers: @dossier.linked_dossiers_for(current_expert), must_be_confidentiel: @avis.confidentiel?, avis: @new_avis } diff --git a/app/views/experts/shared/avis/_list.html.haml b/app/views/experts/shared/avis/_list.html.haml index 5aa674410..5a6e5d53f 100644 --- a/app/views/experts/shared/avis/_list.html.haml +++ b/app/views/experts/shared/avis/_list.html.haml @@ -7,30 +7,30 @@ - avis.each do |avis| %li.one-avis.flex.align-start .width-100 - %h2.claimant + %h2.claimant.fr-h6 = "#{t('claimant', scope: 'activerecord.attributes.avis')} :" - %span.email= (safe_claimant_email(avis.claimant) == current_expert.email) ? 'Vous' : safe_claimant_email(avis.claimant) + %span.fr-text--xs.fr-text-mention--grey.font-weight-normal= (safe_claimant_email(avis.claimant) == current_expert.email) ? 'Vous' : safe_claimant_email(avis.claimant) - if avis.confidentiel? - %span.confidentiel + %span.confidentiel.font-weight-normal = t('confidentiel', scope: 'activerecord.attributes.avis') %span.icon.lock{ title: t('confidentiel', scope: 'helpers.hint') } - %span.date{ class: highlight_if_unseen_class(avis_seen_at, avis.created_at) } + %span.date.fr-text--xs.fr-text-mention--grey.font-weight-normal{ class: highlight_if_unseen_class(avis_seen_at, avis.created_at) } = t('demande_envoyee_le', scope: 'views.shared.avis', date: l(avis.created_at, format: '%d/%m/%y à %H:%M')) %p= avis.introduction .answer.flex.align-start %span.icon.bubble.avis-icon .width-100 - %h2.instructeur + %h2.instructeur.fr-h6 = (avis.expert.email == current_expert.email) ? 'Vous' : avis.expert.email - if avis.answer.present? - if avis.revoked? - %span.waiting{ class: highlight_if_unseen_class(avis_seen_at, avis.revoked_at) } + %span.waiting.font-weight-normal{ class: highlight_if_unseen_class(avis_seen_at, avis.revoked_at) } = t('demande_revoquee_le', scope: 'views.shared.avis', date: l(avis.revoked_at, format: '%d/%m/%y à %H:%M')) - %span.date{ class: highlight_if_unseen_class(avis_seen_at, avis.updated_at) } + %span.date.fr-text--xs.fr-text-mention--grey.font-weight-normal{ class: highlight_if_unseen_class(avis_seen_at, avis.updated_at) } = t('reponse_donnee_le', scope: 'views.shared.avis', date: l(avis.updated_at, format: '%d/%m/%y à %H:%M')) - else - %span.waiting + %span.waiting.font-weight-normal = t('en_attente', scope: 'views.shared.avis') - if avis.piece_justificative_file.attached? = render Attachment::ShowComponent.new(attachment: avis.piece_justificative_file.attachment) From 10802d15cc3fa900fae89816f89b38f7f25c9c8d Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 19:27:23 +0200 Subject: [PATCH 42/58] style(instructeur/procedure): re-style header procedure title & dossier number --- app/assets/stylesheets/sub_header.scss | 9 +++++++++ app/views/experts/avis/_header.html.haml | 4 +++- app/views/instructeurs/avis/_header.html.haml | 4 +++- app/views/instructeurs/dossiers/_header.html.haml | 6 ++---- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/sub_header.scss b/app/assets/stylesheets/sub_header.scss index a6602dc45..2bc9abb9d 100644 --- a/app/assets/stylesheets/sub_header.scss +++ b/app/assets/stylesheets/sub_header.scss @@ -10,4 +10,13 @@ .container { margin-bottom: -1px; } + + .breadcrumbs { + list-style: none; + padding-inline-start: 0; + + a:not(:hover) { + background-image: none; // remove DSFR underline + } + } } diff --git a/app/views/experts/avis/_header.html.haml b/app/views/experts/avis/_header.html.haml index 0b4e448f0..1fe7ea5e0 100644 --- a/app/views/experts/avis/_header.html.haml +++ b/app/views/experts/avis/_header.html.haml @@ -3,7 +3,9 @@ .flex.justify-between %ul.breadcrumbs %li= link_to('Avis', expert_all_avis_path) - %li= link_to(dossier.procedure.libelle.truncate_words(10), procedure_expert_avis_index_path(avis.procedure)) + %li + = link_to(dossier.procedure.libelle.truncate_words(10), procedure_expert_avis_index_path(avis.procedure), class: "fr-link") + = procedure_badge(dossier.procedure) %li= link_to("Dossier nº #{dossier.id}", expert_avis_path(avis.procedure, avis)) .header-actions diff --git a/app/views/instructeurs/avis/_header.html.haml b/app/views/instructeurs/avis/_header.html.haml index 4135c8d58..5e5adba89 100644 --- a/app/views/instructeurs/avis/_header.html.haml +++ b/app/views/instructeurs/avis/_header.html.haml @@ -2,7 +2,9 @@ .container %ul.breadcrumbs %li= link_to('Avis', instructeur_all_avis_path) - %li= link_to(dossier.procedure.libelle, procedure_instructeur_avis_index_path(avis.procedure)) + %li + = link_to(procedure.libelle, procedure_instructeur_avis_index_path(avis.procedure), class: "fr-link") + = procedure_badge(dossier.procedure) %li= link_to("Dossier nº #{dossier.id}", instructeur_avis_path(avis.procedure, avis)) %nav.tabs diff --git a/app/views/instructeurs/dossiers/_header.html.haml b/app/views/instructeurs/dossiers/_header.html.haml index ce3536509..023676a0b 100644 --- a/app/views/instructeurs/dossiers/_header.html.haml +++ b/app/views/instructeurs/dossiers/_header.html.haml @@ -3,10 +3,8 @@ .flex.justify-between %ul.breadcrumbs %li - = link_to instructeur_procedure_path(dossier.procedure), title: dossier.procedure.libelle do - - if dossier.procedure.brouillon? - %span.badge démarche en test - = dossier.procedure.libelle.truncate_words(10) + = link_to dossier.procedure.libelle.truncate_words(10), instructeur_procedure_path(dossier.procedure), title: dossier.procedure.libelle, class: "fr-link" + = procedure_badge(dossier.procedure) %li = "Dossier nº #{dossier.id}" From 3e8f040d49e6c5f25dfd9b70f17fb5d213774610 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 19:36:03 +0200 Subject: [PATCH 43/58] style(usager/dossier): fix summary actions style --- app/views/users/dossiers/show/_latest_message.html.haml | 3 +-- app/views/users/dossiers/show/_papertrail.html.haml | 5 ++--- config/locales/fr.yml | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/views/users/dossiers/show/_latest_message.html.haml b/app/views/users/dossiers/show/_latest_message.html.haml index 6fc81ff8e..278249d3c 100644 --- a/app/views/users/dossiers/show/_latest_message.html.haml +++ b/app/views/users/dossiers/show/_latest_message.html.haml @@ -6,6 +6,5 @@ .message.inverted-background = render Dossiers::MessageComponent.new(commentaire: latest_message, connected_user: current_user) - = link_to messagerie_dossier_url(dossier, anchor: 'new_commentaire'), class: 'button send' do - %span.icon.reply + = link_to messagerie_dossier_url(dossier, anchor: 'new_commentaire'), class: 'fr-btn fr-btn--icon-left fr-icon-discuss-line' do = commentaire_answer_action(latest_message, current_user) diff --git a/app/views/users/dossiers/show/_papertrail.html.haml b/app/views/users/dossiers/show/_papertrail.html.haml index 9146f6e89..191f8c34b 100644 --- a/app/views/users/dossiers/show/_papertrail.html.haml +++ b/app/views/users/dossiers/show/_papertrail.html.haml @@ -1,4 +1,3 @@ -.papertrail.mb-2 - = link_to papertrail_dossier_url(dossier, format: :pdf), class: "button", download: t('.filename'), target: "_blank" do - %span.icon.justificatif +.papertrail.center.fr-my-5w + = link_to papertrail_dossier_url(dossier, format: :pdf), class: "fr-link", download: t('.filename'), target: "_blank" do = t('.get_papertrail') diff --git a/config/locales/fr.yml b/config/locales/fr.yml index d31c4a039..290848b7c 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -47,7 +47,7 @@ fr: unpublished: Dépubliée commentaire: send_message_to_instructeur: "Envoyer un message à l’instructeur" - reply_in_mailbox: "Répondre dans la messagerie." + reply_in_mailbox: "Répondre dans la messagerie" layouts: commencer: no_procedure: From 9992ab9e099382e5b15ddac3e10b4c0e08361fb6 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 22:42:13 +0200 Subject: [PATCH 44/58] style(admin): new procedure btn styles --- .../procedure/search_component/search_component.html.haml | 2 +- .../administrateurs/procedures/new_from_existing.html.haml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/procedure/search_component/search_component.html.haml b/app/components/procedure/search_component/search_component.html.haml index fde14bd1a..323a7665f 100644 --- a/app/components/procedure/search_component/search_component.html.haml +++ b/app/components/procedure/search_component/search_component.html.haml @@ -7,6 +7,6 @@ = text_field_tag :query, params[:query], required: true, placeholder: 'politique de la ville', minlength: "3" - = submit_tag 'Rechercher', class: 'button primary' + = submit_tag 'Rechercher', class: 'fr-btn' = render Procedure::ResultsComponent.new(grouped_procedures: @grouped_procedures) diff --git a/app/views/administrateurs/procedures/new_from_existing.html.haml b/app/views/administrateurs/procedures/new_from_existing.html.haml index 6f20bd594..76ccd4178 100644 --- a/app/views/administrateurs/procedures/new_from_existing.html.haml +++ b/app/views/administrateurs/procedures/new_from_existing.html.haml @@ -34,11 +34,11 @@ .form .send-wrapper - %a#from-scratch.button.primary{ href: new_admin_procedure_path } + %a#from-scratch.fr-btn.fr-btn--lg{ href: new_admin_procedure_path } Créer une nouvelle démarche de zéro .card - %h2.header-section + %h2.fr-h4.header-section Créer une nouvelle démarche à partir d’une démarche existante = render Procedure::SearchComponent.new(grouped_procedures: @grouped_procedures) From d821a3e40c690468497ea8a2c4b41a6457d5c0fa Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 6 Oct 2022 22:51:34 +0200 Subject: [PATCH 45/58] style(new_session): fix buttons style --- app/views/agent_connect/agent/index.html.haml | 4 ++-- app/views/commencer/show.html.haml | 16 ++++++++-------- app/views/devise/passwords/new.html.haml | 2 +- .../layouts/commencer/_no_procedure.html.haml | 2 +- app/views/users/sessions/new.html.haml | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/views/agent_connect/agent/index.html.haml b/app/views/agent_connect/agent/index.html.haml index 8d48af27d..bc412fe15 100644 --- a/app/views/agent_connect/agent/index.html.haml +++ b/app/views/agent_connect/agent/index.html.haml @@ -11,7 +11,7 @@ %span.citizen= t('.you_are_a_citizen') %br %br - = link_to t('.citizen_page'), new_user_session_path, class: "button expend secondary" + = link_to t('.citizen_page'), new_user_session_path, class: "fr-btn fr-btn--secondary" .column %h1.fr-my-2 @@ -45,7 +45,7 @@ .text-right = link_to t('views.users.sessions.new.reset_password'), new_user_password_path, class: "link" - = f.submit t('views.users.sessions.new.connection'), class: "button large primary expand" + = f.submit t('views.users.sessions.new.connection'), class: "fr-btn fr-btn--lg" - content_for :footer do = render partial: 'users/dossiers/index_footer' diff --git a/app/views/commencer/show.html.haml b/app/views/commencer/show.html.haml index 9053e41f8..53f6628c7 100644 --- a/app/views/commencer/show.html.haml +++ b/app/views/commencer/show.html.haml @@ -4,11 +4,11 @@ - if !user_signed_in? %h2.huge-title= t('views.commencer.show.start_procedure') = render partial: 'shared/france_connect_login', locals: { url: commencer_france_connect_path(path: @procedure.path) } - = link_to commencer_sign_up_path(path: @procedure.path), class: ['button large expand primary'] do + = link_to commencer_sign_up_path(path: @procedure.path), class: 'fr-btn fr-btn--lg fr-my-2w' do = t('views.shared.account.create') - %span.optional-on-small-screens + %span.optional-on-small-screens.fr-ml-1v #{APPLICATION_NAME} - = link_to t('views.shared.account.already_user'), commencer_sign_in_path(path: @procedure.path), class: ['button large expand'] + = link_to t('views.shared.account.already_user'), commencer_sign_in_path(path: @procedure.path), class: 'fr-btn fr-btn--secondary fr-btn--lg fr-my-2w' - else - revision = @revision.draft? ? @revision : @procedure.revisions.where.not(id: @procedure.draft_revision_id) @@ -17,23 +17,23 @@ - not_drafts = dossiers.merge(Dossier.state_not_brouillon) - if dossiers.empty? - = link_to t('views.commencer.show.start_procedure'), url_for_new_dossier(@revision), class: ['button large expand primary'] + = link_to t('views.commencer.show.start_procedure'), url_for_new_dossier(@revision), class: 'fr-btn fr-btn--lg fr-my-2w' - elsif drafts.size == 1 && not_drafts.empty? - dossier = drafts.first %h2.huge-title= t('views.commencer.show.already_draft') %p = t('views.commencer.show.already_draft_detail_html', time_ago: time_ago_in_words(dossier.created_at), procedure: dossier.procedure.libelle) - = link_to t('views.commencer.show.continue_file'), brouillon_dossier_path(dossier), class: ['button large expand primary'] - = link_to t('views.commencer.show.start_new_file'), url_for_new_dossier(@revision), class: ['button large expand'] + = link_to t('views.commencer.show.continue_file'), brouillon_dossier_path(dossier), class: 'fr-btn fr-btn--lg fr-my-2w' + = link_to t('views.commencer.show.start_new_file'), url_for_new_dossier(@revision), class: 'fr-btn fr-btn--lg fr-btn--secondary fr-my-2w' - elsif not_drafts.size == 1 - dossier = not_drafts.first %h2.huge-title= t('views.commencer.show.already_not_draft') %p = t('views.commencer.show.already_not_draft_detail_html', time_ago: time_ago_in_words(dossier.depose_at), procedure: dossier.procedure.libelle) - = link_to t('views.commencer.show.show_my_submitted_file'), dossier_path(dossier), class: ['button large expand primary'] - = link_to t('views.commencer.show.start_new_file'), url_for_new_dossier(@revision), class: ['button large expand'] + = link_to t('views.commencer.show.show_my_submitted_file'), dossier_path(dossier), class: 'fr-btn fr-btn--lg fr-my-2w' + = link_to t('views.commencer.show.start_new_file'), url_for_new_dossier(@revision), class: 'fr-btn fr-btn--lg fr-btn--secondary fr-my-2w' - else %h2.huge-title= t('views.commencer.show.existing_dossiers') diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index ec02b04e2..dac711443 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -16,4 +16,4 @@ = f.label :email, 'Email' = f.email_field :email, autofocus: true - = f.submit t('devise.passwords.new.request_new_password'), class: 'button expand primary' + = f.submit t('devise.passwords.new.request_new_password'), class: 'fr-btn fr-btn--lg' diff --git a/app/views/layouts/commencer/_no_procedure.html.haml b/app/views/layouts/commencer/_no_procedure.html.haml index 6c064c5ee..51da3ccf6 100644 --- a/app/views/layouts/commencer/_no_procedure.html.haml +++ b/app/views/layouts/commencer/_no_procedure.html.haml @@ -12,4 +12,4 @@ %span.small-simple= t('.are_you_new', app_name: APPLICATION_NAME.gsub("-","‑")).html_safe %br %br - = link_to t('views.users.sessions.new.find_procedure'), COMMENT_TROUVER_MA_DEMARCHE_URL, target: "_blank", class: "button expend secondary" + = link_to t('views.users.sessions.new.find_procedure'), COMMENT_TROUVER_MA_DEMARCHE_URL, target: "_blank", class: "fr-btn fr-btn--secondary" diff --git a/app/views/users/sessions/new.html.haml b/app/views/users/sessions/new.html.haml index f184c9cba..790e1d95a 100644 --- a/app/views/users/sessions/new.html.haml +++ b/app/views/users/sessions/new.html.haml @@ -22,11 +22,11 @@ .text-right = link_to t('views.users.sessions.new.reset_password'), new_user_password_path, class: "link" - = f.submit t('views.users.sessions.new.connection'), class: "button large primary expand" + = f.submit t('views.users.sessions.new.connection'), class: "fr-btn fr-btn--lg" - if AgentConnectService.enabled? .france-connect-login-separator = t('views.shared.france_connect_login.separator') .center %h2.important-header.mb-1= t('views.users.sessions.new.state_civil_servant') - = link_to t('views.users.sessions.new.connect_with_agent_connect'), agent_connect_path, class: "button expend secondary" + = link_to t('views.users.sessions.new.connect_with_agent_connect'), agent_connect_path, class: "fr-btn fr-btn--secondary" From df672fb4934e51b50bb188809df1d470c02d5019 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 10 Oct 2022 13:39:19 +0200 Subject: [PATCH 46/58] fix(footer): etalab link with rel=noopener --- app/views/shared/_footer_copy.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_footer_copy.html.haml b/app/views/shared/_footer_copy.html.haml index fd3a6d46b..4f75e273a 100644 --- a/app/views/shared/_footer_copy.html.haml +++ b/app/views/shared/_footer_copy.html.haml @@ -1,4 +1,4 @@ .fr-footer__bottom-copy %p Sauf mention contraire, tous les contenus de ce site sont sous - %a{ href: "https://github.com/etalab/licence-ouverte/blob/master/LO.md", target:"_blank", title: "licence etalab-2.0 - nouvelle fenêtre" } licence etalab-2.0 + %a{ href: "https://github.com/etalab/licence-ouverte/blob/master/LO.md", target:"_blank", rel: "noopener", title: "licence etalab-2.0 - nouvelle fenêtre" } licence etalab-2.0 From 03de58c7e2602fbd531144ddc0dfb922c309a900 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 10 Oct 2022 19:04:57 +0200 Subject: [PATCH 47/58] fix: download link with empty value, otherwise it could be used to name the file --- .../attachment/edit_component/edit_component.html.haml | 2 +- app/views/shared/dossiers/_edit.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/attachment/edit_component/edit_component.html.haml b/app/components/attachment/edit_component/edit_component.html.haml index 7a7a51f11..42520586d 100644 --- a/app/components/attachment/edit_component/edit_component.html.haml +++ b/app/components/attachment/edit_component/edit_component.html.haml @@ -2,7 +2,7 @@ - if template&.attached? %p.mb-1 Veuillez télécharger, remplir et joindre - = link_to(url_for(template), download: true, class: "fr-link fr-link--icon-right fr-icon-download-line") do + = link_to(url_for(template), download: "", class: "fr-link fr-link--icon-right fr-icon-download-line") do le modèle suivant - if helpers.administrateur_signed_in? diff --git a/app/views/shared/dossiers/_edit.html.haml b/app/views/shared/dossiers/_edit.html.haml index 16d9f7843..1575b43b3 100644 --- a/app/views/shared/dossiers/_edit.html.haml +++ b/app/views/shared/dossiers/_edit.html.haml @@ -23,7 +23,7 @@ - if notice_url(dossier.procedure).present? .fr-download %p - = link_to notice_url(dossier.procedure), download: true, class: "fr-download__link mr-2", title: t("views.shared.dossiers.edit.notice_title") do + = link_to notice_url(dossier.procedure), download: "", class: "fr-download__link mr-2", title: t("views.shared.dossiers.edit.notice_title") do = t("views.shared.dossiers.edit.notice") - if dossier.procedure.notice.attached? %span.fr-download__detail From 59b9ae5c461126b7f881a354e11a178497711465 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 10 Oct 2022 19:12:52 +0200 Subject: [PATCH 48/58] TODO: deprecate CSS containers Co-authored-by: mfo --- app/assets/stylesheets/layouts.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/layouts.scss b/app/assets/stylesheets/layouts.scss index d0343b0e4..dee448660 100644 --- a/app/assets/stylesheets/layouts.scss +++ b/app/assets/stylesheets/layouts.scss @@ -9,7 +9,7 @@ background: linear-gradient(to right, #FFFFFF 0%, #FFFFFF 50%, $light-grey 50%, $light-grey 100%); } - .columns-container { + .columns-container { // TODO: https://github.com/betagouv/demarches-simplifiees.fr/issues/7882, once implemented, we won't need container anymore @extend %container; display: flex; flex-direction: column; From a9f2bec636347930e62ad72696a5932b03278dfc Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 10 Oct 2022 19:15:46 +0200 Subject: [PATCH 49/58] style(css): add deprecation rules and TODO Co-authored-by: mfo --- app/assets/stylesheets/_placeholders.scss | 2 +- app/assets/stylesheets/attachment.scss | 2 +- app/assets/stylesheets/procedure_admin.scss | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/_placeholders.scss b/app/assets/stylesheets/_placeholders.scss index 3b41efb99..5488879d0 100644 --- a/app/assets/stylesheets/_placeholders.scss +++ b/app/assets/stylesheets/_placeholders.scss @@ -27,7 +27,7 @@ } } -%container { +%container { // TODO: switch to new design with preview in two view not in two column https://github.com/betagouv/demarches-simplifiees.fr/issues/7882 @include horizontal-padding($default-padding); max-width: $page-width + 2 * $default-padding; margin-left: auto; diff --git a/app/assets/stylesheets/attachment.scss b/app/assets/stylesheets/attachment.scss index 537d4adbf..d29e6667e 100644 --- a/app/assets/stylesheets/attachment.scss +++ b/app/assets/stylesheets/attachment.scss @@ -11,7 +11,7 @@ .button { text-transform: lowercase; - background-image: none; // remove DSFR underline + background-image: none; // remove DSFR underline, TODO: switch to DSFR download links https://github.com/betagouv/demarches-simplifiees.fr/issues/7883 } } diff --git a/app/assets/stylesheets/procedure_admin.scss b/app/assets/stylesheets/procedure_admin.scss index 707de6a80..40f6ea0dc 100644 --- a/app/assets/stylesheets/procedure_admin.scss +++ b/app/assets/stylesheets/procedure_admin.scss @@ -2,7 +2,7 @@ display: flex; flex-wrap: wrap; - > a { + > a { // TODO, re-use DSFR https://github.com/betagouv/demarches-simplifiees.fr/issues/7884 background-image: none; // remove DSFR underline } } From 3ae62d9c3acc801ee6d24e58313307650974585b Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Tue, 11 Oct 2022 10:00:56 +0200 Subject: [PATCH 50/58] fix(routage): typo nommination => nomination --- config/locales/models/procedure/fr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/models/procedure/fr.yml b/config/locales/models/procedure/fr.yml index 8e8e6d567..83afb7d17 100644 --- a/config/locales/models/procedure/fr.yml +++ b/config/locales/models/procedure/fr.yml @@ -18,7 +18,7 @@ fr: declarative_with_state/accepte: Accepté api_particulier_token: Jeton API Particulier lien_dpo: Contact du DPO - routing_criteria_name: Nommination du routage + routing_criteria_name: Nomination du routage errors: models: procedure: From 202ae209a39bcd886e31dd6fc84eeacde993f146 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 11 Oct 2022 09:59:23 +0200 Subject: [PATCH 51/58] =?UTF-8?q?correctif(routing=5Fcriteria=5Fname=20ne?= =?UTF-8?q?=20doit=20pas=20etre=20vide):=20ne=20pas=20oublier=20les=20proc?= =?UTF-8?q?edures.routing=5Fcriteria=5Fname=20ayant=20une=20chaine=20de=20?= =?UTF-8?q?caract=C3=A8re=20vide=20ex:=20'=20'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ll_procedure_routing_criteria_name_blank.rake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/tasks/deployment/20221011075758_backfill_procedure_routing_criteria_name_blank.rake diff --git a/lib/tasks/deployment/20221011075758_backfill_procedure_routing_criteria_name_blank.rake b/lib/tasks/deployment/20221011075758_backfill_procedure_routing_criteria_name_blank.rake new file mode 100644 index 000000000..9be562868 --- /dev/null +++ b/lib/tasks/deployment/20221011075758_backfill_procedure_routing_criteria_name_blank.rake @@ -0,0 +1,16 @@ +namespace :after_party do + desc 'Deployment task: backfill_procedure_routing_criteria_name_blank' + task backfill_procedure_routing_criteria_name_blank: :environment do + puts "Running deploy task 'backfill_procedure_routing_criteria_name_blank'" + + # Put your task implementation HERE. + Procedure.pluck(:id, :routing_criteria_name) + .filter { |_id, r| r.blank? } + .map { |id, _r| Procedure.find(id).update(routing_criteria_name: 'Votre ville') } + + # Update task as completed. If you remove the line below, the task will + # run with every deploy (or every time you call after_party:run). + AfterParty::TaskRecord + .create version: AfterParty::TaskRecorder.new(__FILE__).timestamp + end +end From bc5e46e6de2a6a72024cc3361f49e063b4985e6f Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Fri, 7 Oct 2022 15:17:31 +0200 Subject: [PATCH 52/58] chore(db): add index on type to champs --- db/migrate/20221006134215_add_index_on_type_to_champs.rb | 7 +++++++ db/schema.rb | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20221006134215_add_index_on_type_to_champs.rb diff --git a/db/migrate/20221006134215_add_index_on_type_to_champs.rb b/db/migrate/20221006134215_add_index_on_type_to_champs.rb new file mode 100644 index 000000000..f3a2240b8 --- /dev/null +++ b/db/migrate/20221006134215_add_index_on_type_to_champs.rb @@ -0,0 +1,7 @@ +class AddIndexOnTypeToChamps < ActiveRecord::Migration[6.1] + include Database::MigrationHelpers + disable_ddl_transaction! + def up + add_concurrent_index :champs, [:type] + end +end diff --git a/db/schema.rb b/db/schema.rb index 1374cdb79..b99bfb8eb 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_10_06_193737) do +ActiveRecord::Schema.define(version: 2022_10_07_113737) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -203,6 +203,7 @@ ActiveRecord::Schema.define(version: 2022_10_06_193737) do t.index ["parent_id"], name: "index_champs_on_parent_id" t.index ["private"], name: "index_champs_on_private" t.index ["row"], name: "index_champs_on_row" + t.index ["type"], name: "index_champs_on_type" t.index ["type_de_champ_id", "dossier_id", "row"], name: "index_champs_on_type_de_champ_id_and_dossier_id_and_row", unique: true t.index ["type_de_champ_id"], name: "index_champs_on_type_de_champ_id" end From a19bf050ef269fae4f95a8b3731f2ae41d421557 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Thu, 6 Oct 2022 15:49:34 +0200 Subject: [PATCH 53/58] fix(iban): format iban after validation --- app/models/champs/iban_champ.rb | 17 ++++++++++++++++- spec/models/champs/iban_champ_spec.rb | 7 +++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/models/champs/iban_champ.rb b/app/models/champs/iban_champ.rb index df94eac66..79fb21905 100644 --- a/app/models/champs/iban_champ.rb +++ b/app/models/champs/iban_champ.rb @@ -20,5 +20,20 @@ # type_de_champ_id :integer # class Champs::IbanChamp < Champ - validates_with IbanValidator + validates_with IbanValidator, if: -> { validation_context != :brouillon } + after_validation :format_iban + + def for_api + to_s.gsub(/\s+/, '') + end + + def for_api_v2 + for_api + end + + private + + def format_iban + self.value = value&.gsub(/\s+/, '')&.gsub(/(.{4})/, '\0 ') + end end diff --git a/spec/models/champs/iban_champ_spec.rb b/spec/models/champs/iban_champ_spec.rb index ed7619e34..971c27526 100644 --- a/spec/models/champs/iban_champ_spec.rb +++ b/spec/models/champs/iban_champ_spec.rb @@ -6,6 +6,13 @@ describe Champs::IbanChamp do expect(build(:champ_iban, value: "FR7630006000011234567890189")).to be_valid expect(build(:champ_iban, value: "FR76 3000 6000 0112 3456 7890 189")).to be_valid expect(build(:champ_iban, value: "FR76 3000 6000 0112 3456 7890 189DSF")).to_not be_valid + expect(build(:champ_iban, value: "FR76 3000 6000 0112 3456 7890 189")).to be_valid + end + + it 'format value after validation' do + champ = build(:champ_iban, value: "FR76 3000 6000 0112 3456 7890 189") + champ.valid? + expect(champ.value).to eq("FR76 3000 6000 0112 3456 7890 189") end end end From eb5b9fd9e5ccc846cba87a0f6d3a3bbc2c1cdac8 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Thu, 6 Oct 2022 15:55:20 +0200 Subject: [PATCH 54/58] fix(iban): apply correct format to all ibans --- ...221006135016_format_iban_champ_values.rake | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lib/tasks/deployment/20221006135016_format_iban_champ_values.rake diff --git a/lib/tasks/deployment/20221006135016_format_iban_champ_values.rake b/lib/tasks/deployment/20221006135016_format_iban_champ_values.rake new file mode 100644 index 000000000..8e59e83f8 --- /dev/null +++ b/lib/tasks/deployment/20221006135016_format_iban_champ_values.rake @@ -0,0 +1,21 @@ +namespace :after_party do + desc 'Deployment task: format_iban_champ_values' + task format_iban_champ_values: :environment do + puts "Running deploy task 'format_iban_champ_values'" + + champs = Champs::IbanChamp.where.not(value: nil) + progress = ProgressReport.new(champs.count) + champs.find_each do |champ| + # format IBAN value + champ.validate + champ.update_column(:value, champ.value) + progress.inc + end + progress.finish + + # Update task as completed. If you remove the line below, the task will + # run with every deploy (or every time you call after_party:run). + AfterParty::TaskRecord + .create version: AfterParty::TaskRecorder.new(__FILE__).timestamp + end +end From 437ac44143d2f05d4616e5ca43b77a3d6cf0021c Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Mon, 10 Oct 2022 21:02:28 +0200 Subject: [PATCH 55/58] perf(user dossier): batch hide/show element finding --- app/views/users/dossiers/update.turbo_stream.haml | 11 ++++++----- .../users/dossiers/update_brouillon.turbo_stream.haml | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/views/users/dossiers/update.turbo_stream.haml b/app/views/users/dossiers/update.turbo_stream.haml index 59eb62452..29b5aa4fb 100644 --- a/app/views/users/dossiers/update.turbo_stream.haml +++ b/app/views/users/dossiers/update.turbo_stream.haml @@ -1,5 +1,6 @@ -- @dossier.champs.filter(&:conditional?).each do |champ| - - if champ.visible? - = turbo_stream.show champ.input_group_id - - else - = turbo_stream.hide champ.input_group_id +- to_shows, to_hides = @dossier.champs.filter(&:conditional?).partition(&:visible?) + +- if to_shows.present? + = turbo_stream.show_all(to_shows.map { "##{_1.input_group_id}" }.join(',')) +- if to_hides.present? + = turbo_stream.hide_all(to_hides.map { "##{_1.input_group_id}" }.join(',')) diff --git a/app/views/users/dossiers/update_brouillon.turbo_stream.haml b/app/views/users/dossiers/update_brouillon.turbo_stream.haml index 59eb62452..29b5aa4fb 100644 --- a/app/views/users/dossiers/update_brouillon.turbo_stream.haml +++ b/app/views/users/dossiers/update_brouillon.turbo_stream.haml @@ -1,5 +1,6 @@ -- @dossier.champs.filter(&:conditional?).each do |champ| - - if champ.visible? - = turbo_stream.show champ.input_group_id - - else - = turbo_stream.hide champ.input_group_id +- to_shows, to_hides = @dossier.champs.filter(&:conditional?).partition(&:visible?) + +- if to_shows.present? + = turbo_stream.show_all(to_shows.map { "##{_1.input_group_id}" }.join(',')) +- if to_hides.present? + = turbo_stream.hide_all(to_hides.map { "##{_1.input_group_id}" }.join(',')) From 32e01b13ef1de4f7853989f71f60db60548eb662 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 11 Oct 2022 10:34:05 +0200 Subject: [PATCH 56/58] refactor(user dossier): mutualize update/update_brouillon --- app/controllers/users/dossiers_controller.rb | 2 +- app/views/users/dossiers/update_brouillon.turbo_stream.haml | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 app/views/users/dossiers/update_brouillon.turbo_stream.haml diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index f878a4130..8714119cd 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -181,7 +181,7 @@ module Users respond_to do |format| format.html { render :brouillon } - format.turbo_stream { render layout: false } + format.turbo_stream { render(:update, layout: false) } end end diff --git a/app/views/users/dossiers/update_brouillon.turbo_stream.haml b/app/views/users/dossiers/update_brouillon.turbo_stream.haml deleted file mode 100644 index 29b5aa4fb..000000000 --- a/app/views/users/dossiers/update_brouillon.turbo_stream.haml +++ /dev/null @@ -1,6 +0,0 @@ -- to_shows, to_hides = @dossier.champs.filter(&:conditional?).partition(&:visible?) - -- if to_shows.present? - = turbo_stream.show_all(to_shows.map { "##{_1.input_group_id}" }.join(',')) -- if to_hides.present? - = turbo_stream.hide_all(to_hides.map { "##{_1.input_group_id}" }.join(',')) From 97529ab6afaac1e2d4faf5c3b2d53ebf5632ff17 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 11 Oct 2022 10:57:14 +0200 Subject: [PATCH 57/58] refactor(user dossier): move ruby logic to controller --- app/controllers/users/dossiers_controller.rb | 25 +++++++++++++++++-- .../users/dossiers/update.turbo_stream.haml | 10 +++----- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 8714119cd..854a72233 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -181,7 +181,14 @@ module Users respond_to do |format| format.html { render :brouillon } - format.turbo_stream { render(:update, layout: false) } + format.turbo_stream do + @to_shows, @to_hides = @dossier.champs + .filter(&:conditional?) + .partition(&:visible?) + .map { |champs| champs_to_one_selector(champs) } + + render(:update, layout: false) + end end end @@ -205,7 +212,14 @@ module Users respond_to do |format| format.html { render :modifier } - format.turbo_stream { render layout: false } + format.turbo_stream do + @to_shows, @to_hides = @dossier.champs + .filter(&:conditional?) + .partition(&:visible?) + .map { |champs| champs_to_one_selector(champs) } + + render layout: false + end end end @@ -521,5 +535,12 @@ module Users # rubocop:enable Lint/BooleanSymbol end end + + def champs_to_one_selector(champs) + champs + .map(&:input_group_id) + .map { |id| "##{id}" } + .join(',') + end end end diff --git a/app/views/users/dossiers/update.turbo_stream.haml b/app/views/users/dossiers/update.turbo_stream.haml index 29b5aa4fb..96f5c3b06 100644 --- a/app/views/users/dossiers/update.turbo_stream.haml +++ b/app/views/users/dossiers/update.turbo_stream.haml @@ -1,6 +1,4 @@ -- to_shows, to_hides = @dossier.champs.filter(&:conditional?).partition(&:visible?) - -- if to_shows.present? - = turbo_stream.show_all(to_shows.map { "##{_1.input_group_id}" }.join(',')) -- if to_hides.present? - = turbo_stream.hide_all(to_hides.map { "##{_1.input_group_id}" }.join(',')) +- if @to_shows.present? + = turbo_stream.show_all(@to_shows) +- if @to_hides.present? + = turbo_stream.hide_all(@to_hides) From d870d1d84801cfdb0179a3fc7d4ee6240c06870d Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 11 Oct 2022 11:44:29 +0200 Subject: [PATCH 58/58] fix(spec): fix dubious procedure spec --- spec/models/dubious_procedure_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/models/dubious_procedure_spec.rb b/spec/models/dubious_procedure_spec.rb index a9bd58880..994c397a4 100644 --- a/spec/models/dubious_procedure_spec.rb +++ b/spec/models/dubious_procedure_spec.rb @@ -17,7 +17,8 @@ describe DubiousProcedure, type: :model do it 'returns dubious procedures' do expect(subject.first.id).to eq(procedure.id) expect(subject.first.libelle).to eq(procedure.libelle) - expect(subject.first.dubious_champs).to eq("num de securite sociale, stp - t'aurais une carte bancaire ?") + expect(subject.first.dubious_champs).to include("num de securite sociale, stp") + expect(subject.first.dubious_champs).to include("t'aurais une carte bancaire ?") end context 'and a whitelisted procedure' do