diff --git a/app/assets/images/icons/new-folder.svg b/app/assets/images/icons/new-folder.svg deleted file mode 100644 index 2176480ff..000000000 --- a/app/assets/images/icons/new-folder.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/assets/stylesheets/icons.scss b/app/assets/stylesheets/icons.scss index 4aeed0ea0..84da181c1 100644 --- a/app/assets/stylesheets/icons.scss +++ b/app/assets/stylesheets/icons.scss @@ -35,10 +35,6 @@ background-image: image-url("icons/folder.svg"); } - &.new-folder { - background-image: image-url("icons/new-folder.svg"); - } - &.accept { background-image: image-url("icons/accept.svg"); } @@ -170,3 +166,19 @@ width: 10px; } } + + +// How to add a new remix icon and work with DSFR markup: +// 1. Find it on https://remixicon.com/ +// 2. Take its DataURL (copy the url background-image value). +// 2b. No need to download the file ! +// 3. Follow the first example : +// - create the class +// - add the mask-image property with data url you copied +.fr-icon { + &-file-copy-line { + &:before, &:after { + mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM5.00242 8L5.00019 20H14.9998V8H5.00242ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z'%3E%3C/path%3E%3C/svg%3E"); + } + } +} diff --git a/app/views/administrateurs/procedures/_procedures_list.html.haml b/app/views/administrateurs/procedures/_procedures_list.html.haml index dee3bc18e..c5c782181 100644 --- a/app/views/administrateurs/procedures/_procedures_list.html.haml +++ b/app/views/administrateurs/procedures/_procedures_list.html.haml @@ -87,7 +87,7 @@ - if !procedure.discarded? - menu.with_item do = link_to(admin_procedure_clone_path(procedure.id), role: 'menuitem', class: 'clone-btn', data: { method: :put }) do - %span.icon.new-folder + = dsfr_icon('fr-icon-file-copy-line') .dropdown-description %h4= t('administrateurs.dropdown_actions.to_clone') diff --git a/app/views/root/patron.html.haml b/app/views/root/patron.html.haml index 60a559e37..f82638684 100644 --- a/app/views/root/patron.html.haml +++ b/app/views/root/patron.html.haml @@ -7,7 +7,6 @@ %span.icon.archive %span.icon.unarchive %span.icon.folder - %span.icon.new-folder %span.icon.accept %span.icon.refuse %span.icon.without-continuation diff --git a/app/views/shared/archives/_table.html.haml b/app/views/shared/archives/_table.html.haml index 87d65317f..704c078db 100644 --- a/app/views/shared/archives/_table.html.haml +++ b/app/views/shared/archives/_table.html.haml @@ -21,15 +21,12 @@ %td.center - if matching_archive.present? - if matching_archive.available? - = link_to url_for(matching_archive.file), class: 'button primary' do - %span.icon.download-white + = link_to url_for(matching_archive.file), class: 'fr-btn fr-btn--secondary fr-icon-download-line fr-btn--icon-left fr-btn--sm' do = t(:archive_ready_html, scope: [:instructeurs, :procedure], generated_period: time_ago_in_words(matching_archive.updated_at)) - else - %span.icon.retry + = dsfr_icon("fr-icon-flashlight-line", :sm) = t(:archive_pending_html, scope: [:instructeurs, :procedure], created_period: time_ago_in_words(matching_archive.created_at)) - elsif weight.nil? || weight < Archive::MAX_SIZE - = link_to create_archive_url(procedure, date), method: :post, class: "button" do - %span.icon.new-folder - Demander la création + = link_to "Demander la création", create_archive_url(procedure, date), method: :post, class: "fr-btn fr-btn--secondary fr-icon-download-line fr-btn--icon-left fr-btn--sm" - else Archive trop volumineuse diff --git a/app/views/users/dossiers/_dossier_actions.html.haml b/app/views/users/dossiers/_dossier_actions.html.haml index 80a90a8a9..3020a9280 100644 --- a/app/views/users/dossiers/_dossier_actions.html.haml +++ b/app/views/users/dossiers/_dossier_actions.html.haml @@ -31,13 +31,13 @@ - if has_new_dossier_action - menu.with_item do = link_to(commencer_url(dossier.procedure.path), role: 'menuitem') do - %span.icon.new-folder + = dsfr_icon('fr-icon-file-fill', :sm) .dropdown-description = t('views.users.dossiers.dossier_action.start_other_dossier') - menu.with_item do = link_to(clone_dossier_path(dossier), method: :post, role: 'menuitem') do - %span.icon.new-folder + = dsfr_icon('fr-icon-file-copy-line', :sm) .dropdown-description = t('views.users.dossiers.dossier_action.clone') diff --git a/spec/system/administrateurs/procedure_archive_and_export_spec.rb b/spec/system/administrateurs/procedure_archive_and_export_spec.rb index be511183e..096b54e0c 100644 --- a/spec/system/administrateurs/procedure_archive_and_export_spec.rb +++ b/spec/system/administrateurs/procedure_archive_and_export_spec.rb @@ -30,7 +30,7 @@ describe 'Creating a new procedure', js: true do # check archive expect { - page.first(".archive-table .button").click + page.first(".archive-table .fr-btn").click }.to have_enqueued_job(ArchiveCreationJob).with(procedure, an_instance_of(Archive), administrateur) expect(page).to have_content("Votre demande a été prise en compte. Selon le nombre de dossiers, cela peut prendre de quelques minutes à plusieurs heures. Vous recevrez un courriel lorsque le fichier sera disponible.") expect(Archive.first.month).not_to be_nil diff --git a/spec/system/instructeurs/instruction_spec.rb b/spec/system/instructeurs/instruction_spec.rb index d2d99f82c..65a2b1831 100644 --- a/spec/system/instructeurs/instruction_spec.rb +++ b/spec/system/instructeurs/instruction_spec.rb @@ -206,7 +206,7 @@ describe 'Instructing a dossier:', js: true do end scenario 'download' do expect { - page.first(".archive-table .button").click + page.first(".archive-table .fr-btn").click }.to have_enqueued_job(ArchiveCreationJob).with(procedure, an_instance_of(Archive), instructeur) expect(Archive.first.month).not_to be_nil end