From 34b3c6fa327a40c99c7507ebcd24ca9f753aa18b Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 3 Mar 2022 14:15:20 +0100 Subject: [PATCH 01/19] bugfix when position of member is null --- .../vuejs/_components/Entity/HouseholdRenderBox.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/HouseholdRenderBox.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/HouseholdRenderBox.vue index 16d0fa2ff..163f49bcf 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/HouseholdRenderBox.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/HouseholdRenderBox.vue @@ -87,10 +87,14 @@ export default { currentMembers() { let members = this.household.members.filter(m => this.household.current_members_id.includes(m.id)) .sort((a, b) => { - if (a.position.ordering < b.position.ordering) { + + const orderA = a.position ? a.position.ordering : 0; + const orderB = b.position ? b.position.ordering : 0; + + if (orderA < orderB) { return -1; } - if (a.position.ordering > b.position.ordering) { + if (orderA > orderB) { return 1; } if (a.holder && !b.holder) { From 892be425807ff901efcd593c764bab132cfd46ab Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 3 Mar 2022 16:28:31 +0100 Subject: [PATCH 02/19] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bd743078..8dd9bbbe2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to * [confidential] Fix position of toggle button so it does not cover text nor fall outside of box (no issue) * [parcours] Fix edit of both thirdparty and contact name (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/474) * [template] do not list inactive templates (for doc generator) +* [household] bugfix if position of member is null, renderbox no longer throws an error (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/480) ## Test releases From 3ff92915809e0907eda8d4aa051725b6a01cc748 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 3 Mar 2022 16:37:58 +0100 Subject: [PATCH 03/19] assign User to undsipatched acc period: filter users by job type --- .../public/mod/AccompanyingPeriod/setReferrer.js | 13 ++++++------- .../_components/AccompanyingPeriod/SetReferrer.vue | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/mod/AccompanyingPeriod/setReferrer.js b/src/Bundle/ChillPersonBundle/Resources/public/mod/AccompanyingPeriod/setReferrer.js index b73c0afea..939075380 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/mod/AccompanyingPeriod/setReferrer.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/mod/AccompanyingPeriod/setReferrer.js @@ -19,22 +19,21 @@ import {fetchResults} from 'ChillMainAssets/lib/api/apiMethods.js'; */ document.querySelectorAll('[data-set-referrer-app]').forEach(function (el) { - let - periodId = Number.parseInt(el.dataset.setReferrerAccompanyingPeriodId); - + const periodId = Number.parseInt(el.dataset.setReferrerAccompanyingPeriodId); + const jobId = Number.parseInt(el.dataset.setReferrerJobId); const url = `/api/1.0/person/accompanying-course/${periodId}/referrers-suggested.json`; fetchResults(url).then(suggested => { - + const filteredSuggested = suggested.filter((s) => s.user_job ? s.user_job.id === jobId : false); const app = createApp({ components: { SetReferrer, }, template: - '', + '', data() { return { - periodId, suggested, original: suggested, + periodId, filteredSuggested, original: filteredSuggested, } }, methods: { @@ -56,7 +55,7 @@ document.querySelectorAll('[data-set-referrer-app]').forEach(function (el) { label.textContent = ref.text; label.classList.remove('chill-no-data-statement'); - this.suggested = this.original.filter(user => user.id !== ref.id); + this.filteredSuggested = this.original.filter(user => user.id !== ref.id); } } }); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriod/SetReferrer.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriod/SetReferrer.vue index 3d3675c73..38418f305 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriod/SetReferrer.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriod/SetReferrer.vue @@ -1,12 +1,12 @@ From fc1fe7c2774914074ae8c830a1acb4400e7b6e98 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 10 Mar 2022 18:14:57 +0100 Subject: [PATCH 17/19] php cs fix --- .../ChillPersonBundle/migrations/Version20220310124318.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220310124318.php b/src/Bundle/ChillPersonBundle/migrations/Version20220310124318.php index 6b58b24a3..211a2e68a 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220310124318.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220310124318.php @@ -15,7 +15,7 @@ use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; /** - * Change constraint on pinnedComment in Accompanying period + * Change constraint on pinnedComment in Accompanying period. */ final class Version20220310124318 extends AbstractMigration { From 13f0b8610c00f1c86bae54829fffafabcd092994 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 11 Mar 2022 16:37:26 +0100 Subject: [PATCH 18/19] quick fix: missing translation in Task --- src/Bundle/ChillTaskBundle/translations/messages.fr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bundle/ChillTaskBundle/translations/messages.fr.yml b/src/Bundle/ChillTaskBundle/translations/messages.fr.yml index 5633c0219..a2a57708f 100644 --- a/src/Bundle/ChillTaskBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillTaskBundle/translations/messages.fr.yml @@ -46,6 +46,7 @@ User: Utilisateur "Associated tasks": "Tâches associées" "My tasks": "Mes tâches" "Tasks for this accompanying period": "Tâches pour ce parcours d'accompagnement" +"Tasks for {{ name }}": "Tâches pour {{ name }}" "No description": "Pas de description" "No dates specified": "Dates non spécifiées" "No one assignee": "Aucune personne assignée" From bd79391efcb264b8895b0f3c6201a7e7c0a3ef9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 14 Mar 2022 13:04:29 +0100 Subject: [PATCH 19/19] fix autosave of comment --- .../Resources/public/lib/api/apiMethods.js | 13 ++- .../AccompanyingCourse/components/Comment.vue | 85 ++++++++--------- .../vuejs/AccompanyingCourse/store/index.js | 91 ++++++++++++++++--- 3 files changed, 131 insertions(+), 58 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js index 67f3e2f42..75f1a21c8 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js @@ -1,17 +1,22 @@ /** * Generic api method that can be adapted to any fetch request */ -const makeFetch = (method, url, body) => { - return fetch(url, { +const makeFetch = (method, url, body, options) => { + let opts = { method: method, headers: { 'Content-Type': 'application/json;charset=utf-8' }, body: (body !== null) ? JSON.stringify(body) : null - }) + }; + + if (typeof options !== 'undefined') { + opts = Object.assign(opts, options); + } + + return fetch(url, opts) .then(response => { if (response.ok) { - console.log('200 error') return response.json(); } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Comment.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Comment.vue index 3fa555ec4..8ae7dfff4 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Comment.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Comment.vue @@ -17,12 +17,11 @@ :placeholder="$t('comment.content')" :editor="editor" v-model="content" - @input="onContentChange" tag-name="textarea">
-