Merge pull request #9453 from colinux/fix-layout-zones

ETQ admin, fix UX du formulaire de design de zones
This commit is contained in:
Colin Darie 2023-09-05 09:14:12 +00:00 committed by GitHub
commit 606a56807a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 22 deletions

View file

@ -117,13 +117,6 @@
visibility: visible; visibility: visible;
} }
// Move checkbox to the top-left side of the label
&.editable-champ-checkbox {
label.admin-default-zone {
font-weight: bold;
}
}
&.editable-champ-checkbox { &.editable-champ-checkbox {
label { label {
font-weight: normal; font-weight: normal;

View file

@ -7,24 +7,26 @@
.container .container
= form_for @procedure, = form_for @procedure,
url: url_for({ controller: 'administrateurs/procedures', action: :update, id: @procedure.id }), url: url_for({ controller: 'administrateurs/procedures', action: :update, id: @procedure.id }),
html: { multipart: true, class: 'form' } do |f| html: { multipart: true } do |f|
%h1.page-title Zones %h1.page-title Zones
= f.label :zone do
= t('zone', scope: 'activerecord.attributes.procedure')
- if Rails.application.config.ds_zonage_enabled - if Rails.application.config.ds_zonage_enabled
= f.collection_check_boxes :zone_ids, current_administrateur.default_zones, :id, :current_label do |b| %fieldset.fr-fieldset{ aria: { labelledby: "zones-legend"} }
.editable-champ.editable-champ-checkbox %legend#zones-legend.fr-fieldset__legend--regular.fr-fieldset__legend= t('zone', scope: 'activerecord.attributes.procedure')
= b.check_box = f.collection_check_boxes :zone_ids, current_administrateur.default_zones, :id, :current_label do |b|
= b.label class: "admin-default-zone" .fr-fieldset__element
= f.collection_check_boxes :zone_ids, Zone.available_at(@procedure.published_or_created_at, current_administrateur.default_zones), :id, :label do |b| .fr-checkbox-group
.editable-champ.editable-champ-checkbox = b.check_box
= b.check_box = b.label class: "fr-label font-weight-bold"
= b.label = f.collection_check_boxes :zone_ids, Zone.available_at(@procedure.published_or_created_at, current_administrateur.default_zones), :id, :label do |b|
.fr-fieldset__element
.fr-checkbox-group
= b.check_box
= b.label class: "fr-label"
.procedure-form__actions.sticky--bottom .procedure-form__actions.sticky--bottom
.actions-right .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 ?'} = link_to 'Annuler', admin_procedure_path(id: @procedure), class: 'fr-btn fr-btn--tertiary fr-mr-2w', data: { confirm: 'Êtes-vous sûr de vouloir annuler les modifications effectuées ?'}
= f.button 'Enregistrer', class: 'button primary send' = f.button 'Enregistrer', class: 'fr-btn fr-btn--primary'

View file

@ -47,7 +47,7 @@ describe 'As an administrateur I wanna clone a procedure', js: true, retry: 3 do
# select zone # select zone
find("#zones .fr-btn").click find("#zones .fr-btn").click
check Zone.last.current_label check Zone.last.current_label, allow_label_click: true
click_on 'Enregistrer' click_on 'Enregistrer'
# then publish # then publish
@ -82,7 +82,7 @@ describe 'As an administrateur I wanna clone a procedure', js: true, retry: 3 do
# select zone # select zone
find("#zones .fr-btn").click find("#zones .fr-btn").click
check Zone.last.current_label check Zone.last.current_label, allow_label_click: true
click_on 'Enregistrer' click_on 'Enregistrer'
# then publish # then publish