From ef8dc97a4cf61ce22524c3237604d34c4e96b933 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 27 Nov 2023 17:06:29 +0100 Subject: [PATCH] style: replace legacy delete icon --- app/assets/images/icons/trash.svg | 1 - app/assets/stylesheets/conditions_component.scss | 6 ------ app/assets/stylesheets/icons.scss | 4 ---- app/components/application_component.rb | 2 +- app/components/conditions/conditions_component.rb | 3 ++- .../dossiers/message_component/message_component.html.haml | 2 +- .../champ_component/champ_component.html.haml | 1 - app/views/root/patron.html.haml | 1 - app/views/users/dossiers/_dossier_actions.html.haml | 2 +- 9 files changed, 5 insertions(+), 17 deletions(-) delete mode 100644 app/assets/images/icons/trash.svg diff --git a/app/assets/images/icons/trash.svg b/app/assets/images/icons/trash.svg deleted file mode 100644 index 3ca080162..000000000 --- a/app/assets/images/icons/trash.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/assets/stylesheets/conditions_component.scss b/app/assets/stylesheets/conditions_component.scss index b8a56d044..055e9b4f9 100644 --- a/app/assets/stylesheets/conditions_component.scss +++ b/app/assets/stylesheets/conditions_component.scss @@ -31,12 +31,6 @@ form.form > .conditionnel { .delete-column { width: 50px; - - button { - background: none; - border: none; - cursor: pointer; - } } } diff --git a/app/assets/stylesheets/icons.scss b/app/assets/stylesheets/icons.scss index 84da181c1..671e770a3 100644 --- a/app/assets/stylesheets/icons.scss +++ b/app/assets/stylesheets/icons.scss @@ -158,10 +158,6 @@ background-image: image-url("icons/meh-regular.svg"); } - &.delete { - background-image: image-url("icons/trash.svg"); - } - &.mandatory { width: 10px; } diff --git a/app/components/application_component.rb b/app/components/application_component.rb index 58df715b5..da1e79249 100644 --- a/app/components/application_component.rb +++ b/app/components/application_component.rb @@ -2,7 +2,7 @@ class ApplicationComponent < ViewComponent::Base include ViewComponent::Translatable include FlipperHelper - delegate :rich_text_area_tag, to: :helpers + delegate :rich_text_area_tag, :dsfr_icon, to: :helpers def current_user controller.current_user diff --git a/app/components/conditions/conditions_component.rb b/app/components/conditions/conditions_component.rb index 7cfd3f22b..d1f1bf3e1 100644 --- a/app/components/conditions/conditions_component.rb +++ b/app/components/conditions/conditions_component.rb @@ -176,7 +176,8 @@ class Conditions::ConditionsComponent < ApplicationComponent def delete_condition_tag(row_index) tag.button( - tag.span('', class: 'icon delete') + tag.span(t('.remove_a_row'), class: 'sr-only'), + class: "fr-btn fr-btn--sm fr-btn--tertiary fr-icon-delete-line", + title: t('.remove_a_row'), formaction: delete_condition_path(row_index), formmethod: 'delete', formnovalidate: true diff --git a/app/components/dossiers/message_component/message_component.html.haml b/app/components/dossiers/message_component/message_component.html.haml index 8148a9709..ad9ea7d1f 100644 --- a/app/components/dossiers/message_component/message_component.html.haml +++ b/app/components/dossiers/message_component/message_component.html.haml @@ -23,7 +23,7 @@ .message-extras.flex.justify-start - if commentaire.soft_deletable?(connected_user) = button_to instructeur_commentaire_path(commentaire.dossier.procedure, commentaire.dossier, commentaire), method: :delete, class: 'button danger', form: { data: { turbo: true, turbo_confirm: t('.confirm') } } do - %span.icon.delete + = dsfr_icon('fr-icon-delete-line', :sm) = t('.delete_button') - if commentaire.piece_jointe.attached? diff --git a/app/components/types_de_champ_editor/champ_component/champ_component.html.haml b/app/components/types_de_champ_editor/champ_component/champ_component.html.haml index 0a10ee99f..e702d8460 100644 --- a/app/components/types_de_champ_editor/champ_component/champ_component.html.haml +++ b/app/components/types_de_champ_editor/champ_component/champ_component.html.haml @@ -11,7 +11,6 @@ - else .flex.justify-start.delete = button_to type_de_champ_path, class: 'fr-btn fr-btn--sm fr-btn--secondary fr-icon-delete-line', title: "Supprimer le champ", method: :delete, form: { data: { turbo_confirm: 'Êtes vous sûr de vouloir supprimer ce champ ?' } } do - .icon.delete %span.sr-only Supprimer - if @errors.present? diff --git a/app/views/root/patron.html.haml b/app/views/root/patron.html.haml index f82638684..72740fffc 100644 --- a/app/views/root/patron.html.haml +++ b/app/views/root/patron.html.haml @@ -25,7 +25,6 @@ %span.icon.search %span.icon.sign-out %span.icon.info - %span.icon.delete %span.icon.help %span.icon.phone %span.icon.clock diff --git a/app/views/users/dossiers/_dossier_actions.html.haml b/app/views/users/dossiers/_dossier_actions.html.haml index 3020a9280..eda87bee8 100644 --- a/app/views/users/dossiers/_dossier_actions.html.haml +++ b/app/views/users/dossiers/_dossier_actions.html.haml @@ -45,6 +45,6 @@ - menu.with_item(class: 'danger') do = link_to(dossier_path(dossier), role: 'menuitem', method: :delete, data: { disable: true, confirm: "En continuant, vous allez supprimer ce dossier ainsi que les informations qu’il contient. Toute suppression entraîne l’annulation de la démarche en cours.\n\nConfirmer la suppression ?" }) do - %span.icon.delete + = dsfr_icon('fr-icon-delete-fill', :sm) .dropdown-description = t('views.users.dossiers.dossier_action.delete_dossier')