diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f61f05de..9d9a0da1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,21 @@ and this project adheres to ## Unreleased +* [workflow]: added pagination to workflow list page +* [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 +* [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) +* [action]: Agents traitants should be prefilled with referrer of the parcours or left empty if there is no referrer (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/696) + +## Test releases + +### 2022-05-30 + +* fix creating a new AccompanyingPeriodWorkEvaluationDocument when replacing the document (the workflow was lost) + +### 2022-05-27 + * [storedobject] add title field on StoredObject entity + use it in activity documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/604) * [main] add a "read more..." on comment embeddable when overflown (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/604) * [person] add closing motive to closed acc course (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/603) @@ -28,8 +43,6 @@ and this project adheres to * [address] can add extra address info even if noAddress (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/576) -## Test releases - ### 2022-05-06 * [person] add civility when creating a person (with the on-the-fly component or in the php form) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/557) diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig index f8b68eabd..79c946f17 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig @@ -2,12 +2,30 @@ {% if is_granted('CHILL_ACTIVITY_SEE_DETAILS', activity) %} {% if no_action is not defined or no_action == false %}
  • - - - {{ 'notification.Notify'|trans }} + {% set showGroup = activity.accompanyingPeriod is not null and activity.accompanyingPeriod.hasUser and activity.accompanyingPeriod.user is not same as(app.user) %} +
    + {% if showGroup %} + + + {% else %} + + {{ 'notification.Notify'|trans }} + + {% endif %} +
  • {% endif %} {% if context == 'person' and activity.accompanyingPeriod is not empty %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig index bf4c5c7b6..49e71bfad 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig @@ -217,9 +217,30 @@
  • - - {{ 'notification.Notify'|trans }} - + {% set showGroup = entity.accompanyingPeriod is not null and entity.accompanyingPeriod.hasUser and entity.accompanyingPeriod.user is not same as(app.user) %} +
    + {% if showGroup %} + + + {% else %} + + {{ 'notification.Notify'|trans }} + + {% endif %} +
  • {% if is_granted('CHILL_ACTIVITY_UPDATE', entity) %}
  • diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220527234046.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220527234046.php index c53f82661..9cb68932e 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20220527234046.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220527234046.php @@ -1,5 +1,12 @@ addSql('ALTER TABLE chill_calendar.calendar ALTER COLUMN privateComment_comments DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_calendar.calendar ALTER COLUMN privateComment_comments SET DEFAULT NULL'); + } + public function getDescription(): string { return ''; @@ -19,12 +32,5 @@ final class Version20220527234046 extends AbstractMigration $this->addSql('UPDATE chill_calendar.calendar SET privateComment_comments=\'{}\' WHERE privateComment_comments IS NULL'); $this->addSql('ALTER TABLE chill_calendar.calendar ALTER COLUMN privateComment_comments SET NOT NULL'); $this->addSql('ALTER TABLE chill_calendar.calendar ALTER COLUMN privateComment_comments SET DEFAULT \'{}\''); - - } - - public function down(Schema $schema): void - { - $this->addSql('ALTER TABLE chill_calendar.calendar ALTER COLUMN privateComment_comments DROP NOT NULL'); - $this->addSql('ALTER TABLE chill_calendar.calendar ALTER COLUMN privateComment_comments SET DEFAULT NULL'); } } diff --git a/src/Bundle/ChillMainBundle/Entity/Embeddable/PrivateCommentEmbeddable.php b/src/Bundle/ChillMainBundle/Entity/Embeddable/PrivateCommentEmbeddable.php index 09a35324e..00e0f29d7 100644 --- a/src/Bundle/ChillMainBundle/Entity/Embeddable/PrivateCommentEmbeddable.php +++ b/src/Bundle/ChillMainBundle/Entity/Embeddable/PrivateCommentEmbeddable.php @@ -54,9 +54,9 @@ class PrivateCommentEmbeddable return $this; } - public function setCommentForUser(User $user, string $content): self + public function setCommentForUser(User $user, ?string $content): self { - $this->comments[$user->getId()] = trim($content); + $this->comments[$user->getId()] = trim((string) $content); return $this; } diff --git a/src/Bundle/ChillMainBundle/Form/UserCurrentLocationType.php b/src/Bundle/ChillMainBundle/Form/UserCurrentLocationType.php index 4bdf61604..e7ae27b3a 100644 --- a/src/Bundle/ChillMainBundle/Form/UserCurrentLocationType.php +++ b/src/Bundle/ChillMainBundle/Form/UserCurrentLocationType.php @@ -43,6 +43,7 @@ class UserCurrentLocationType extends AbstractType }, 'placeholder' => 'Pick a location', 'required' => false, + 'attr' => ['class' => 'select2'], ]); } } diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index 9a2fd1b6c..b70e7a55b 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -109,6 +109,7 @@ class WorkflowStepType extends AbstractType 'multiple' => false, 'expanded' => true, 'choices' => $choices, + 'constraints' => [new NotNull()], 'choice_label' => function (Transition $transition) use ($workflow) { $meta = $workflow->getMetadataStore()->getTransitionMetadata($transition); @@ -208,24 +209,28 @@ class WorkflowStepType extends AbstractType $transition = $form['transition']->getData(); $toFinal = true; - 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) { + if (null === $transition) { $context - ->buildViolation('workflow.You must add at least one dest user or email') - ->atPath('future_dest_users') - ->addViolation(); + ->buildViolation('workflow.You must select a next step, pick another decision if no next steps are available'); + } else { + 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(); + } } } ), diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue index 4be073991..7f7b1b529 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue @@ -15,26 +15,69 @@ {{ $t('wait_redirection') }} -
    -

    - {{ $t('not_yet_address') }} -

    +
    +
    + +

    + {{ $t('not_yet_address') }} +

    + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    + + + +
    + +
    +
    -
    - - - +
    + + + +
    @@ -58,6 +101,9 @@ export default { 'useDatePane' ], emits: ['openEditPane'], + mounted() { + console.log('context', this.context) + }, computed: { address() { return this.entity.address; @@ -91,13 +137,35 @@ export default { forceRedirect() { return (!(this.context.backUrl === null || typeof this.context.backUrl === 'undefined')); }, - showMessageWhenNoAddress() { - let showMessageWhenNoAddress = this.options.showMessageWhenNoAddress === undefined ? this.defaultz.showMessageWhenNoAddress : this.options.showMessageWhenNoAddress; - if (showMessageWhenNoAddress === true || showMessageWhenNoAddress === false) { - return !this.context.edit && !this.address.id && showMessageWhenNoAddress; - } - return !this.context.edit && !this.address.id && this.options.stickyActions; - } + // showMessageWhenNoAddress() { + // let showMessageWhenNoAddress = this.options.showMessageWhenNoAddress === undefined ? this.defaultz.showMessageWhenNoAddress : this.options.showMessageWhenNoAddress; + // if (showMessageWhenNoAddress === true || showMessageWhenNoAddress === false) { + // return !this.context.edit && !this.address.id && showMessageWhenNoAddress; + // } + // return !this.context.edit && !this.address.id && this.options.stickyActions; + // } } }; + + diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyTasks.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyTasks.vue index 572b8f83a..77a2bd34c 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyTasks.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyTasks.vue @@ -1,5 +1,5 @@ - +
    {{ $t('my_tasks.description_alert') }}
    {{ $t('no_data') }} @@ -49,7 +50,7 @@ - +