feat(routing): add modal once custom routing is configurated
This commit is contained in:
parent
7caadc3b40
commit
5c53c6b86c
5 changed files with 32 additions and 0 deletions
|
@ -50,3 +50,6 @@
|
|||
= select_tag :defaut_groupe_instructeur_id,
|
||||
options_for_select(@procedure.groupe_instructeurs.pluck(:label, :id), selected: @procedure.defaut_groupe_instructeur.id),
|
||||
class: 'fr-select'
|
||||
|
||||
- if flash[:routing_mode] == 'custom'
|
||||
= render partial: 'custom_routing_modal'
|
||||
|
|
|
@ -107,6 +107,8 @@ module Administrateurs
|
|||
|
||||
procedure.toggle_routing
|
||||
|
||||
flash[:routing_mode] = 'custom'
|
||||
|
||||
redirect_to admin_procedure_groupe_instructeurs_path(procedure)
|
||||
end
|
||||
|
||||
|
|
|
@ -44,6 +44,8 @@ module ApplicationHelper
|
|||
class_names << 'alert-success'
|
||||
when 'alert', 'error'
|
||||
class_names << 'alert-danger'
|
||||
when 'routing_mode'
|
||||
class_names << 'hidden'
|
||||
end
|
||||
if sticky
|
||||
class_names << 'sticky'
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
%dialog{ aria: { labelledby: "fr-modal-title-modal-1" }, role: "dialog", id: "routing-mode-modal", class: "fr-modal fr-modal--opened" }
|
||||
.fr-container.fr-container--fluid.fr-container-md
|
||||
.fr-grid-row.fr-grid-row--center
|
||||
.fr-col-12.fr-col-md-8.fr-col-lg-6
|
||||
.fr-modal__body
|
||||
.fr-modal__header
|
||||
%button.fr-btn.fr-btn--close{ title: "Fermer la fenêtre modale", aria: { controls: "routing-mode-modal" } } Fermer
|
||||
.fr-modal__content
|
||||
%h1#fr-modal-title-modal-1.fr-modal__title
|
||||
%span.fr-icon-arrow-right-line.fr-icon--lg
|
||||
Routage avancé
|
||||
.fr-alert.fr-alert--success
|
||||
%h2.fr-alert__title
|
||||
Deux groupes par défaut ont été créés
|
||||
%p
|
||||
Vous devez maintenant les renommer et leur attribuer des règles de routage à partir du ou des champs « routables » de votre formulaire, soit des champs de type :
|
||||
%ul
|
||||
- TypeDeChamp.humanized_conditionable_types_by_category.each do |category|
|
||||
%li
|
||||
= category.join(', ')
|
|
@ -53,6 +53,11 @@ describe 'The routing with rules', js: true do
|
|||
expect(page).to have_text('Gestion des groupes')
|
||||
expect(page).to have_text('règle invalide')
|
||||
|
||||
# close modal
|
||||
expect(page).to have_selector("#routing-mode-modal", visible: true)
|
||||
within("#routing-mode-modal") { click_on "Fermer" }
|
||||
expect(page).to have_selector("#routing-mode-modal", visible: false)
|
||||
|
||||
# update defaut groupe
|
||||
click_on 'défaut'
|
||||
expect(page).to have_text('Paramètres du groupe')
|
||||
|
|
Loading…
Reference in a new issue