From 5ea55ebfe5d59e365dc80d46fd923f4993fb6456 Mon Sep 17 00:00:00 2001 From: juminet Date: Tue, 13 May 2025 08:45:38 +0000 Subject: [PATCH] 381 display previous person participation in acc course work --- .../unreleased/Fixed-20250424-163746.yaml | 7 +++++ .../vuejs/AccompanyingCourseWorkEdit/App.vue | 26 +++++++++++++++++++ .../vuejs/AccompanyingCourseWorkEdit/store.js | 8 ++++-- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .changes/unreleased/Fixed-20250424-163746.yaml diff --git a/.changes/unreleased/Fixed-20250424-163746.yaml b/.changes/unreleased/Fixed-20250424-163746.yaml new file mode 100644 index 000000000..79c07b080 --- /dev/null +++ b/.changes/unreleased/Fixed-20250424-163746.yaml @@ -0,0 +1,7 @@ +kind: Fixed +body: Display previous participation in acc course work even if the person has left + the acc course +time: 2025-04-24T16:37:46.970203594+02:00 +custom: + Issue: "381" + SchemaChange: No schema change diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index 952bbc2d3..d6f564439 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -208,6 +208,29 @@ +
  • +
    + + +
    +  {{ + $t("warning_previous_persons") + }} +
  • @@ -497,6 +520,8 @@ const i18n = { notification_notify_referrer: "Notifier le référent", notification_notify_any: "Notifier d'autres utilisateurs", notification_send: "Envoyer une notification", + warning_previous_persons: + "Cet usager n'est désormais plus concerné par le parcours, bien qu'il ait été associé à l'action par le passé.", }, }, }; @@ -583,6 +608,7 @@ export default { "hasHandlingThirdParty", "hasThirdParties", "hasReferrers", + "getPreviousPersons", ]), classicEditor: () => ClassicEditor, editorConfig: () => classicEditorConfig, diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index e2105f314..a820d0816 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -87,6 +87,11 @@ const store = createStore({ return []; }, + getPreviousPersons(state) { + return state.personsPicked.filter( + (p) => !state.personsReachables.map((pr) => pr.id).includes(p.id), + ); + }, buildPayload(state) { return { type: "accompanying_period_work", @@ -607,8 +612,7 @@ const store = createStore({ submit({ getters, state, commit }, callback) { let payload = getters.buildPayload, params = new URLSearchParams({ entity_version: state.version }), - url = `/api/1.0/person/accompanying-course/work/${state.work.id}.json?${params}`, - errors = []; + url = `/api/1.0/person/accompanying-course/work/${state.work.id}.json?${params}`; commit("setIsPosting", true); // console.log('the social action', payload);