diff --git a/.changes/unreleased/Feature-20250211-142243.yaml b/.changes/unreleased/Feature-20250211-142243.yaml new file mode 100644 index 000000000..4f0b25e88 --- /dev/null +++ b/.changes/unreleased/Feature-20250211-142243.yaml @@ -0,0 +1,6 @@ +kind: Feature +body: Allow the merge of two accompanying period works +time: 2025-02-11T14:22:43.134106669+01:00 +custom: + Issue: "359" + SchemaChange: No schema change diff --git a/.changes/unreleased/Fixed-20250604-165550.yaml b/.changes/unreleased/Fixed-20250604-165550.yaml new file mode 100644 index 000000000..0544c9402 --- /dev/null +++ b/.changes/unreleased/Fixed-20250604-165550.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: Display the list of participant in the results, even if there is only one participant and that the search result display the requestor +time: 2025-06-04T16:55:50.107852336+02:00 +custom: + Issue: "390" + SchemaChange: No schema change diff --git a/.changes/unreleased/UX-20250617-192650.yaml b/.changes/unreleased/UX-20250617-192650.yaml new file mode 100644 index 000000000..810758b10 --- /dev/null +++ b/.changes/unreleased/UX-20250617-192650.yaml @@ -0,0 +1,6 @@ +kind: UX +body: Improve labeling of fields in person resource creation form +time: 2025-06-17T19:26:50.599703116+02:00 +custom: + Issue: "" + SchemaChange: No schema change diff --git a/package.json b/package.json index fc50ba29c..73fa14d86 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "@hotwired/stimulus": "^3.0.0", "@luminateone/eslint-baseline": "^1.0.9", "@symfony/stimulus-bridge": "^3.2.0", + "@symfony/ux-translator": "file:vendor/symfony/ux-translator/assets", "@symfony/webpack-encore": "^4.1.0", "@tsconfig/node20": "^20.1.4", "@types/dompurify": "^3.0.5", diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php index 0167273c5..7512b21ed 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php @@ -17,7 +17,6 @@ use Chill\ActivityBundle\Repository\ActivityReasonRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** * ActivityReason controller. diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js index f29e2e6d4..8d09d2dd3 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js @@ -2,7 +2,7 @@ import "es6-promise/auto"; import { createStore } from "vuex"; import { postLocation } from "./api"; import prepareLocations from "./store.locations.js"; -import { makeFetch } from "ChillMainAssets/lib/api/apiMethods"; +import {fetchResults, makeFetch} from "ChillMainAssets/lib/api/apiMethods"; const debug = process.env.NODE_ENV !== "production"; //console.log('window.activity', window.activity); @@ -365,11 +365,11 @@ const store = createStore({ const accompanyingPeriodId = state.activity.accompanyingPeriod.id; const url = `/api/1.0/person/accompanying-course/${accompanyingPeriodId}/works.json`; try { - const works = await makeFetch("GET", url); - // console.log("works", works); + const works = await fetchResults(url); + // console.log('works', works); commit("setAccompanyingPeriodWorks", works); } catch (error) { - console.error("Failed to fetch accompanying period works:", error); + console.error('Failed to fetch works:', error); } }, getWhoAmI({ commit }) { diff --git a/src/Bundle/ChillMainBundle/Entity/Embeddable/PrivateCommentEmbeddable.php b/src/Bundle/ChillMainBundle/Entity/Embeddable/PrivateCommentEmbeddable.php index 0c2af22f7..5ada822c4 100644 --- a/src/Bundle/ChillMainBundle/Entity/Embeddable/PrivateCommentEmbeddable.php +++ b/src/Bundle/ChillMainBundle/Entity/Embeddable/PrivateCommentEmbeddable.php @@ -63,4 +63,28 @@ class PrivateCommentEmbeddable return $this; } + + /** + * Merges comments from the provided object into the current object. + * + * Identifies common user IDs between the current object's comments and the + * newComment's comments. If a user ID exists in both, their comments are + * concatenated with the provided separator. If a user ID exists only in the + * newComment, their comment is added to the current object directly. + * + * @param self $commentsToAppend the object containing the new comments to be merged + * @param string $separator the string used to separate concatenated comments + */ + public function concatenateComments(self $commentsToAppend, string $separator = "\n\n-----------\n\n"): void + { + $commonUserIds = array_intersect(array_keys($this->comments), array_keys($commentsToAppend->getComments())); + + foreach ($commentsToAppend->getComments() as $userId => $comment) { + if (in_array($userId, $commonUserIds, true)) { + $this->comments[$userId] = $this->comments[$userId].$separator.$commentsToAppend->getComments()[$userId]; + } else { + $this->comments[$userId] = $commentsToAppend->getComments()[$userId]; + } + } + } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts index b50bb5534..e8256b348 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts @@ -61,6 +61,9 @@ export interface ConflictHttpExceptionInterface /** * Generic api method that can be adapted to any fetch request + * + * This method is suitable make a single fetch. When performing a GET to fetch a list of elements, always consider pagination + * and use of the @link{fetchResults} method. */ export const makeFetch = ( method: "POST" | "GET" | "PUT" | "PATCH" | "DELETE", diff --git a/src/Bundle/ChillMainBundle/Resources/public/types.ts b/src/Bundle/ChillMainBundle/Resources/public/types.ts index 90ddacf22..b2ba6d948 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/types.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/types.ts @@ -200,3 +200,7 @@ export interface WorkflowAttachment { updatedBy: User | null; genericDoc: null | GenericDoc; } + +export interface PrivateCommentEmbeddable { + comments: Record; +} diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/i18n.js index 8502bf53e..31e13bc88 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/i18n.js @@ -11,10 +11,12 @@ const appMessages = { user: "Utilisateurs", person: "Usagers", thirdparty: "Tiers", + acpw: "Action d'accompagnements", modal_title_one: "Indiquer un ", user_one: "Utilisateur", thirdparty_one: "Tiers", person_one: "Usager", + acpw_one: "Action d'accompagnement", }, }, }; diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue index 4645f322d..63c43c37f 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue @@ -1,11 +1,11 @@