mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
constraint added to workflow transtion - cannot be null
This commit is contained in:
parent
72167b9e77
commit
4719a74307
@ -15,6 +15,7 @@ and this project adheres to
|
|||||||
* [homepage_widget]: null error on tasks widget fixed
|
* [homepage_widget]: null error on tasks widget fixed
|
||||||
* [person-thirdparty]: fix quick-add of names that consist of multiple parts (eg. De Vlieger) within onthefly modal person/thirdparty
|
* [person-thirdparty]: fix quick-add of names that consist of multiple parts (eg. De Vlieger) within onthefly modal person/thirdparty
|
||||||
* [search]: Order of birthdate fields changed in advanced search to avoid confusion.
|
* [search]: Order of birthdate fields changed in advanced search to avoid confusion.
|
||||||
|
* [workflow]: Constraint added to workflow (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/675)
|
||||||
|
|
||||||
## Test releases
|
## Test releases
|
||||||
|
|
||||||
|
@ -109,6 +109,7 @@ class WorkflowStepType extends AbstractType
|
|||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choices' => $choices,
|
'choices' => $choices,
|
||||||
|
'constraints' => [new NotNull()],
|
||||||
'choice_label' => function (Transition $transition) use ($workflow) {
|
'choice_label' => function (Transition $transition) use ($workflow) {
|
||||||
$meta = $workflow->getMetadataStore()->getTransitionMetadata($transition);
|
$meta = $workflow->getMetadataStore()->getTransitionMetadata($transition);
|
||||||
|
|
||||||
@ -208,24 +209,28 @@ class WorkflowStepType extends AbstractType
|
|||||||
$transition = $form['transition']->getData();
|
$transition = $form['transition']->getData();
|
||||||
$toFinal = true;
|
$toFinal = true;
|
||||||
|
|
||||||
foreach ($transition->getTos() as $to) {
|
if (null === $transition) {
|
||||||
$meta = $workflow->getMetadataStore()->getPlaceMetadata($to);
|
|
||||||
|
|
||||||
if (
|
|
||||||
!array_key_exists('isFinal', $meta) || false === $meta['isFinal']
|
|
||||||
) {
|
|
||||||
$toFinal = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$destUsers = $form['future_dest_users']->getData();
|
|
||||||
$destEmails = $form['future_dest_emails']->getData();
|
|
||||||
|
|
||||||
if (!$toFinal && [] === $destUsers && [] === $destEmails) {
|
|
||||||
$context
|
$context
|
||||||
->buildViolation('workflow.You must add at least one dest user or email')
|
->buildViolation('workflow.You must select a next step, pick another decision if no next steps are available');
|
||||||
->atPath('future_dest_users')
|
} else {
|
||||||
->addViolation();
|
foreach ($transition->getTos() as $to) {
|
||||||
|
$meta = $workflow->getMetadataStore()->getPlaceMetadata($to);
|
||||||
|
|
||||||
|
if (
|
||||||
|
!array_key_exists('isFinal', $meta) || false === $meta['isFinal']
|
||||||
|
) {
|
||||||
|
$toFinal = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$destUsers = $form['future_dest_users']->getData();
|
||||||
|
$destEmails = $form['future_dest_emails']->getData();
|
||||||
|
|
||||||
|
if (!$toFinal && [] === $destUsers && [] === $destEmails) {
|
||||||
|
$context
|
||||||
|
->buildViolation('workflow.You must add at least one dest user or email')
|
||||||
|
->atPath('future_dest_users')
|
||||||
|
->addViolation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
@ -463,6 +463,7 @@ workflow:
|
|||||||
Previous transitionned: Anciens workflows
|
Previous transitionned: Anciens workflows
|
||||||
Previous workflow transitionned help: Workflows où vous avez exécuté une action.
|
Previous workflow transitionned help: Workflows où vous avez exécuté une action.
|
||||||
For: Pour
|
For: Pour
|
||||||
|
You must select a next step, pick another decision if no next steps are available: Il faut une prochaine étape. Choissisez une autre décision si nécessaire.
|
||||||
|
|
||||||
|
|
||||||
Subscribe final: Recevoir une notification à l'étape finale
|
Subscribe final: Recevoir une notification à l'étape finale
|
||||||
|
Loading…
x
Reference in New Issue
Block a user