From 368846e09bf586c77fb2dbe2049b0ec0d26f87bd Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 8 Dec 2022 10:39:58 +0100 Subject: [PATCH 01/24] FIXED: [api] sort users list by label https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/681 --- .../ChillMainBundle/Controller/UserApiController.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Controller/UserApiController.php b/src/Bundle/ChillMainBundle/Controller/UserApiController.php index b29fe7c8e..1e103a934 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserApiController.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\MainBundle\Controller; use Chill\MainBundle\CRUD\Controller\ApiController; +use Chill\MainBundle\Pagination\PaginatorInterface; use Doctrine\ORM\QueryBuilder; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; @@ -70,4 +71,14 @@ class UserApiController extends ApiController $query->andWhere($query->expr()->eq('e.enabled', "'TRUE'")); } } + + /** + * @param mixed $query + * @param mixed $_format + */ + protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) + { + return $query->orderBy('e.label', 'ASC'); + } + } From 8e65b3851adc011af0848794a6349c4777f3a4e8 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 8 Dec 2022 14:03:04 +0100 Subject: [PATCH 02/24] FIXED: [api] sort socialactions by ordering https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/677 --- .../Controller/SocialWorkSocialActionApiController.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php index a0d15b6db..4d6cfd82d 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php @@ -13,7 +13,9 @@ namespace Chill\PersonBundle\Controller; use Chill\MainBundle\CRUD\Controller\ApiController; use Chill\MainBundle\Pagination\PaginatorFactory; +use Chill\MainBundle\Pagination\PaginatorInterface; use Chill\MainBundle\Serializer\Model\Collection; +use Chill\PersonBundle\Entity\SocialWork\SocialAction; use Chill\PersonBundle\Repository\SocialWork\SocialIssueRepository; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; @@ -41,7 +43,12 @@ class SocialWorkSocialActionApiController extends ApiController throw $this->createNotFoundException('socialIssue not found'); } - $socialActions = $socialIssue->getRecursiveSocialActions(); + $socialActions = $socialIssue->getRecursiveSocialActions()->toArray(); + + usort($socialActions, function (SocialAction $sa, SocialAction $sb) { + return $sa->getOrdering() <=> $sb->getOrdering(); + }); + $pagination = $this->paginator->create(count($socialActions)); // max one page $pagination->setItemsPerPage(count($socialActions)); From 7e6ef3dafe62d2451cff507bd5e93ffff1ad2779 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 8 Dec 2022 14:22:06 +0100 Subject: [PATCH 03/24] fix some errors in twig templates --- .../src/Resources/views/asideActivity/index.html.twig | 2 +- .../src/Resources/views/asideActivity/new.html.twig | 4 ++-- .../Resources/views/SingleTask/List/index_my_tasks.html.twig | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig index 4dd12e042..5ffc73684 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig @@ -87,5 +87,5 @@ {% endif %} - + {% endblock %} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig index 09acf9859..99ff217b1 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig @@ -1,4 +1,4 @@ -{% extends '@ChillMain/Admin/layout.html.twig' %} +{% extends '@ChillMain/layout.html.twig' %} {% block js %} {{ parent() }} @@ -14,7 +14,7 @@ {% include('@ChillMain/CRUD/_new_title.html.twig') %} {% endblock %} -{% block admin_content %} +{% block content %} {% embed '@ChillMain/CRUD/_new_content.html.twig' %} {% block content_form_actions_save_and_show %}{% endblock %} {% endembed %} diff --git a/src/Bundle/ChillTaskBundle/Resources/views/SingleTask/List/index_my_tasks.html.twig b/src/Bundle/ChillTaskBundle/Resources/views/SingleTask/List/index_my_tasks.html.twig index 5d7e88542..359d02ef0 100644 --- a/src/Bundle/ChillTaskBundle/Resources/views/SingleTask/List/index_my_tasks.html.twig +++ b/src/Bundle/ChillTaskBundle/Resources/views/SingleTask/List/index_my_tasks.html.twig @@ -1,4 +1,4 @@ -{% extends 'ChillMainBundle::layout.html.twig' %} +{% extends '@ChillMain/layout.html.twig' %} {% block title 'My tasks'|trans %} From a32d20e320b7f85576018e2def4c7c8b61981e76 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 8 Dec 2022 15:00:45 +0100 Subject: [PATCH 04/24] Fixed: [form] improve Aside Activity category form selector --- .../src/Form/AsideActivityFormType.php | 34 +---------- .../Type/PickAsideActivityCategoryType.php | 59 +++++++++++++++++++ 2 files changed, 62 insertions(+), 31 deletions(-) create mode 100644 src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php index 5c438bd0a..6fbef0fd7 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php @@ -12,8 +12,7 @@ declare(strict_types=1); namespace Chill\AsideActivityBundle\Form; use Chill\AsideActivityBundle\Entity\AsideActivity; -use Chill\AsideActivityBundle\Entity\AsideActivityCategory; -use Chill\AsideActivityBundle\Templating\Entity\CategoryRender; +use Chill\AsideActivityBundle\Form\Type\PickAsideActivityCategoryType; use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\ChillTextareaType; use Chill\MainBundle\Form\Type\PickUserDynamicType; @@ -21,8 +20,6 @@ use DateInterval; use DateTime; use DateTimeImmutable; use DateTimeZone; -use Doctrine\ORM\EntityRepository; -use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer; @@ -37,20 +34,16 @@ use function in_array; final class AsideActivityFormType extends AbstractType { - private CategoryRender $categoryRender; - private TokenStorageInterface $storage; private array $timeChoices; public function __construct( ParameterBagInterface $parameterBag, - TokenStorageInterface $storage, - CategoryRender $categoryRender + TokenStorageInterface $storage ) { $this->timeChoices = $parameterBag->get('chill_aside_activity.form.time_duration'); $this->storage = $storage; - $this->categoryRender = $categoryRender; } public function buildForm(FormBuilderInterface $builder, array $options) @@ -81,28 +74,7 @@ final class AsideActivityFormType extends AbstractType 'required' => true, ] ) - ->add( - 'type', - EntityType::class, - [ - 'label' => 'Type', - 'required' => true, - 'class' => AsideActivityCategory::class, - 'placeholder' => 'Choose the activity category', - 'query_builder' => static function (EntityRepository $er) { - $qb = $er->createQueryBuilder('ac'); - $qb->where($qb->expr()->eq('ac.isActive', 'TRUE')) - ->addOrderBy('ac.ordering', 'ASC'); - - return $qb; - }, - 'choice_label' => function (AsideActivityCategory $asideActivityCategory) { - $options = []; - - return $this->categoryRender->renderString($asideActivityCategory, $options); - }, - ] - ) + ->add('type', PickAsideActivityCategoryType::class) ->add('duration', ChoiceType::class, $durationTimeOptions) ->add('note', ChillTextareaType::class, [ 'label' => 'Note', diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php new file mode 100644 index 000000000..ddf8246f9 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php @@ -0,0 +1,59 @@ +categoryRender = $categoryRender; + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefaults([ + 'label' => 'Type', + 'required' => true, + 'class' => AsideActivityCategory::class, + 'placeholder' => 'Choose the activity category', + 'query_builder' => static function (EntityRepository $er) { + $qb = $er->createQueryBuilder('ac'); + $qb->where($qb->expr()->eq('ac.isActive', 'TRUE')) + ->addOrderBy('ac.ordering', 'ASC'); + + return $qb; + }, + 'choice_label' => function (AsideActivityCategory $asideActivityCategory) { + $options = []; + return $this->categoryRender->renderString($asideActivityCategory, $options); + }, + 'attr' => ['class' => 'select2'], + ]); + } + + public function getParent(): string + { + return EntityType::class; + } +} + From 34602d0a561c3adaf944cafb930df644f49b84fd Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 8 Dec 2022 16:24:33 +0100 Subject: [PATCH 05/24] Fixed: markdown resolution for private comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit note: j'ai une branche locale wip ou j'essaie d'implémenter un renderbox pour les private comments --- .../ChillActivityBundle/Resources/views/Activity/show.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig index 49e71bfad..a3203d806 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig @@ -156,7 +156,7 @@
- {{ entity.privateComment.comments[userId] }} + {{ entity.privateComment.comments[userId]|chill_markdown_to_html }}
From ff7f5a5dd36d6de54f2e5b03bb1d0cb50544987f Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 9 Dec 2022 12:39:29 +0100 Subject: [PATCH 06/24] Fixed: [vue][accompanyingCourse] typeError in toaster when removing referrer https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/667 --- .../Resources/public/vuejs/AccompanyingCourse/store/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js index 8324a3d82..c2ded503b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js @@ -785,7 +785,7 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou return makeFetch('PATCH', url, body) .then((response) => { commit('updateReferrer', response.user); - if (null !== payload.user_job && payload.user_job !== state.accompanyingCourse.job) { + if (null !== payload && null !== payload.user_job && payload.user_job !== state.accompanyingCourse.job) { this.dispatch('updateJob', payload.user_job); } // commit('setFilteredReferrersSuggested'); // this mutation doesn't exist? From 49380f5f616e5bddbb36874f3f1da178a602d814 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 12 Dec 2022 14:51:43 +0100 Subject: [PATCH 07/24] fix template regressions with add_address component Component works in modal or in main frame. CSS Flex position parent-children directives were broken. Hope that fix don't introduce others display bug in any cases ! --- .../vuejs/Address/components/AddAddress.vue | 178 +++++++++--------- .../vuejs/Address/components/EditPane.vue | 1 + .../vuejs/Address/components/ShowPane.vue | 19 +- .../views/Household/address_edit.html.twig | 22 +-- .../views/Household/address_move.html.twig | 22 +-- 5 files changed, 117 insertions(+), 125 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue index fcd64ed70..8cb871de6 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue @@ -48,33 +48,35 @@ -
- - - - - - -
+ @@ -118,40 +120,42 @@ -
- - - - - - -
+ @@ -192,32 +196,34 @@ -
- - - - diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue index 9636a173f..9ae464e3e 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue @@ -187,6 +187,7 @@ div.address-form { div#address_map { height: 400px; width: 100%; + z-index: 1; } } 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 7f7b1b529..f910e6422 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue @@ -1,6 +1,6 @@