diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php index 94f732a89..bdf75ed05 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php @@ -271,7 +271,7 @@ class ActivityType public function checkSocialActionsVisibility(ExecutionContextInterface $context, $payload) { if ($this->socialIssuesVisible !== $this->socialActionsVisible) { - if (!($this->socialIssuesVisible === 2 && $this->socialActionsVisible === 1)) { + if (!(2 === $this->socialIssuesVisible && 1 === $this->socialActionsVisible)) { $context ->buildViolation('The socialActionsVisible value is not compatible with the socialIssuesVisible value') ->atPath('socialActionsVisible') diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index 18ac10c47..b843890c2 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -76,32 +76,32 @@ class WorkflowStepType extends AbstractType 'expanded' => true, 'choices' => $choices, 'choice_label' => function (Transition $transition) use ($workflow) { - $meta = $workflow->getMetadataStore()->getTransitionMetadata($transition); + $meta = $workflow->getMetadataStore()->getTransitionMetadata($transition); - if (array_key_exists('label', $meta)) { - return $this->translatableStringHelper->localize($meta['label']); - } + if (array_key_exists('label', $meta)) { + return $this->translatableStringHelper->localize($meta['label']); + } - return $transition->getName(); - }, + return $transition->getName(); + }, 'choice_attr' => static function (Transition $transition) use ($workflow) { - $toFinal = true; + $toFinal = true; - foreach ($transition->getTos() as $to) { - $meta = $workflow->getMetadataStore()->getPlaceMetadata($to); + foreach ($transition->getTos() as $to) { + $meta = $workflow->getMetadataStore()->getPlaceMetadata($to); - if ( + if ( !array_key_exists('isFinal', $meta) || false === $meta['isFinal'] ) { - $toFinal = false; - } + $toFinal = false; } + } - return [ - 'data-is-transition' => 'data-is-transition', - 'data-to-final' => $toFinal ? '1' : '0', - ]; - }, + return [ + 'data-is-transition' => 'data-is-transition', + 'data-to-final' => $toFinal ? '1' : '0', + ]; + }, ]) ->add('future_dest_users', PickUserDynamicType::class, [ 'label' => 'workflow.dest for next steps', diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php index 3f0c30e47..10b424cef 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php @@ -28,6 +28,11 @@ final class AccompanyingPeriodRepository implements ObjectRepository $this->repository = $entityManager->getRepository(AccompanyingPeriod::class); } + public function countBy(array $criteria): int + { + return $this->repository->count($criteria); + } + public function countByRecentUserHistory(User $user, DateTimeImmutable $since): int { $qb = $this->buildQueryByRecentUserHistory($user, $since); @@ -35,11 +40,6 @@ final class AccompanyingPeriodRepository implements ObjectRepository return $qb->select('count(a)')->getQuery()->getSingleScalarResult(); } - public function countBy(array $criteria): int - { - return $this->repository->count($criteria); - } - public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder { return $this->repository->createQueryBuilder($alias, $indexBy); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue index 3958e39ef..9e318ff96 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue @@ -247,8 +247,6 @@ export default { this.suggested.unshift(this.priorSuggestion); this.selected.unshift(this.priorSuggestion); - // console.log('selected', this.selected); - // console.log('suggested', this.suggested); this.newPriorSuggestion(null); } }, @@ -262,7 +260,7 @@ export default { } this.search.priorSuggestion = suggestion; // console.log('search priorSuggestion', this.search.priorSuggestion); - this.addPriorSuggestion(suggestion) + this.addPriorSuggestion(suggestion); } else { this.search.priorSuggestion = {}; }