From 06b7e8427003c6875c08b45a4e20c64a751fb571 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 16 Mar 2023 13:48:01 +0100 Subject: [PATCH 1/7] FIX [thirdparty][profession] set default value for profession in symfony form --- src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php index 384c743c2..b1446a543 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php @@ -110,6 +110,7 @@ class ThirdPartyType extends AbstractType ->add('profession', TextType::class, [ 'label' => 'thirdparty.Profession', 'required' => false, + 'empty_data' => '', ]) ->add('contactDataAnonymous', CheckboxType::class, [ 'required' => false, From c729a1430473b7d3d9e889a5e0bd35c5f7596e82 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 20 Mar 2023 07:54:16 +0100 Subject: [PATCH 2/7] FIX [minor] remove dump, use statement, ... --- src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php b/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php index 6555f7835..c2caf13bb 100644 --- a/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php +++ b/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php @@ -117,7 +117,6 @@ class SimilarPersonMatcher $qb->setParameter('fullName', $this->personRender->renderString($person, [])); } - dump($qb->getQuery()); return $qb->getQuery()->getResult(); } } From df2480c47c3bbe72be73396736b01445b9689383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 20 Mar 2023 21:36:46 +0100 Subject: [PATCH 3/7] Fixed: transform null value into emtpy string into ThirdParty::setProfession --- src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index b13118168..29565e86a 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -807,10 +807,10 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface /** * @return $this - */ - public function setProfession(string $profession): self + */"" + public function setProfession(?string $profession): self { - $this->profession = $profession; + $this->profession = (string) $profession; return $this; } From ecac40958696e0ad588b8b3a434e95a0c0961397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 20 Mar 2023 21:38:42 +0100 Subject: [PATCH 4/7] fixed: fix 3party syntax --- src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index 29565e86a..966e40bd1 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -805,9 +805,6 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface return $this; } - /** - * @return $this - */"" public function setProfession(?string $profession): self { $this->profession = (string) $profession; From a8977729fea74410de53df3939ab1cce9d73f88d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 21 Mar 2023 16:39:31 +0100 Subject: [PATCH 5/7] Fixed: [similar person matcher] properly takes person center into account Center comes from the table person_center_history, not person.center_id --- .../ChillPersonBundle/Search/SimilarPersonMatcher.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php b/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php index 6555f7835..b7e2c12b0 100644 --- a/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php +++ b/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php @@ -76,8 +76,17 @@ class SimilarPersonMatcher $qb->select('p') ->from(Person::class, 'p') + ->join('p.centerHistory', 'center_history') ->where('SIMILARITY(p.fullnameCanonical, UNACCENT(LOWER(:fullName))) >= :precision') - ->andWhere($qb->expr()->in('p.center', ':centers')); + ->andWhere($qb->expr()->in('center_history.center', ':centers')) + ->andWhere($qb->expr()->andX( + $qb->expr()->lte('center_history.startDate', 'CURRENT_DATE()'), + $qb->expr()->orX( + $qb->expr()->isNull('center_history.endDate'), + $qb->expr()->gt('center_history.endDate', 'CURRENT_DATE()') + ) + )) + ; $qb ->setParameter('fullName', $this->personRender->renderString($person, [])) From 4eb7d10e459b4dd5b99d288f08132a63c5a716e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 23 Mar 2023 11:23:14 +0100 Subject: [PATCH 6/7] Fixed: [calendar ms synchro] do not throw an error if we are not allowed to get the default calendar --- .../Connector/MSGraph/MapCalendarToUser.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php index 504d48ffc..563bd3a38 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php @@ -22,6 +22,7 @@ use Chill\MainBundle\Entity\User; use DateTimeImmutable; use LogicException; use Psr\Log\LoggerInterface; +use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; use function array_key_exists; @@ -74,9 +75,18 @@ class MapCalendarToUser public function getDefaultUserCalendar(string $idOrUserPrincipalName): ?array { - $value = $this->machineHttpClient->request('GET', "users/{$idOrUserPrincipalName}/calendars", [ - 'query' => ['$filter' => 'isDefaultCalendar eq true'], - ])->toArray()['value']; + try { + $value = $this->machineHttpClient->request('GET', "users/{$idOrUserPrincipalName}/calendars", [ + 'query' => ['$filter' => 'isDefaultCalendar eq true'], + ])->toArray()['value']; + } catch (ClientExceptionInterface $e) { + $this->logger->error('[MapCalendarToUser] Error while listing calendars for a user', [ + 'http_status_code' => $e->getResponse()->getStatusCode(), + 'id_user' => $idOrUserPrincipalName, + ]); + + return null; + } return $value[0] ?? null; } From 7585eff488040356efb646cf4afc33e95806ebe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 21 Mar 2023 12:28:37 +0100 Subject: [PATCH 7/7] DX: update fullcalendar --- package.json | 18 +++++++++--------- .../Resources/public/types.ts | 2 +- .../Resources/public/vuejs/Calendar/App.vue | 1 - .../public/vuejs/Calendar/store/utils.ts | 2 +- .../public/vuejs/MyCalendarRange/App2.vue | 6 ++---- .../Components/EditLocation.vue | 2 +- .../store/modules/calendarLocals.ts | 2 +- .../store/modules/calendarRanges.ts | 2 +- .../store/modules/calendarRemotes.ts | 2 +- 9 files changed, 17 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 17b02c63a..0bd3a81e5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "chill", - "version": "2.0.0", - "devDependencies": { + "name": "chill", + "version": "2.0.0", + "devDependencies": { "@alexlafroscia/yaml-merge": "^4.0.0", "@apidevtools/swagger-cli": "^4.0.4", "@babel/core": "^7.20.5", @@ -34,12 +34,12 @@ "webpack-cli": "^5.0.1" }, "dependencies": { - "@fullcalendar/core": "^5.11.0", - "@fullcalendar/daygrid": "^5.11.0", - "@fullcalendar/interaction": "^5.11.0", - "@fullcalendar/list": "^5.11.0", - "@fullcalendar/timegrid": "^5.11.0", - "@fullcalendar/vue3": "^5.11.1", + "@fullcalendar/core": "^6.1.4", + "@fullcalendar/daygrid": "^6.1.4", + "@fullcalendar/interaction": "^6.1.4", + "@fullcalendar/list": "^6.1.4", + "@fullcalendar/timegrid": "^6.1.4", + "@fullcalendar/vue3": "^6.1.4", "@popperjs/core": "^2.9.2", "dropzone": "^5.7.6", "es6-promise": "^4.2.8", diff --git a/src/Bundle/ChillCalendarBundle/Resources/public/types.ts b/src/Bundle/ChillCalendarBundle/Resources/public/types.ts index ebc7ab7be..c18cfea13 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/public/types.ts +++ b/src/Bundle/ChillCalendarBundle/Resources/public/types.ts @@ -1,4 +1,4 @@ -import {EventInput} from '@fullcalendar/vue3'; +import {EventInput} from '@fullcalendar/core'; import {DateTime, Location, User, UserAssociatedInterface} from '../../../ChillMainBundle/Resources/public/types' ; import {Person} from "../../../ChillPersonBundle/Resources/public/types"; diff --git a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue index 472bb525b..32b6b569b 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue +++ b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue @@ -116,7 +116,6 @@