From bcde4497cc435a65dc1fb7a12c90fec77a30a0f5 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 5 Apr 2022 15:56:02 +0200 Subject: [PATCH 01/35] fix datepicker for social action --- .../public/vuejs/AccompanyingCourseWorkCreate/App.vue | 9 ++++----- .../public/vuejs/AccompanyingCourseWorkCreate/store.js | 7 ++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue index 503a00c59..758cd7e5e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue @@ -227,19 +227,18 @@ export default { }, startDate: { get() { - let d = this.$store.state.startDate; - return dateToISO(d); + return this.$store.state.startDate; }, set(value) { - this.$store.commit('setStartDate', ISOToDate(value)); + this.$store.commit('setStartDate', value); } }, endDate: { get() { - return dateToISO(this.$store.state.endDate); + return this.$store.state.endDate; }, set(value) { - this.$store.commit('setEndDate', ISOToDate(value)); + this.$store.commit('setEndDate', value); } }, setSocialIssue: { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js index 408115257..7b6c2b22e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js @@ -1,6 +1,6 @@ import { createStore } from 'vuex'; -import { datetimeToISO } from 'ChillMainAssets/chill/js/date.js'; +import { datetimeToISO, dateToISO, ISOToDate, ISOToDatetime } from 'ChillMainAssets/chill/js/date.js'; import { findSocialActionsBySocialIssue } from 'ChillPersonAssets/vuejs/_api/SocialWorkSocialAction.js'; // import { create } from 'ChillPersonAssets/vuejs/_api/AccompanyingCourseWork.js'; import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods'; @@ -47,7 +47,7 @@ const store = createStore({ id: state.socialActionPicked.id }, startDate: { - datetime: datetimeToISO(state.startDate) + datetime: datetimeToISO(ISOToDate(state.startDate)) }, persons: [] }; @@ -61,7 +61,7 @@ const store = createStore({ if (null !== state.endDate) { payload.endDate = { - datetime: datetimeToISO(state.endDate) + datetime: datetimeToISO(ISOToDate(state.endDate)) }; } @@ -111,6 +111,7 @@ const store = createStore({ state.startDate = date; }, setEndDate(state, date) { + console.log(date) state.endDate = date; }, setPersonsPickedIds(state, ids) { From 72a62a3a1b28233864a74203797ebd5889a3e2c3 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 5 Apr 2022 16:03:07 +0200 Subject: [PATCH 02/35] prefill startdate with now --- .../public/vuejs/AccompanyingCourseWorkCreate/store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js index 7b6c2b22e..3c2e034d7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js @@ -20,7 +20,7 @@ const store = createStore({ .map(p => p.person), personsReachables: window.accompanyingCourse.participations.filter(p => p.endDate == null) .map(p => p.person), - startDate: new Date(), + startDate: dateToISO(new Date()), endDate: null, isLoadingSocialActions: false, isPostingWork: false, From ad6a68487c1e9ba24fda9877c4de551a2267a704 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 6 Apr 2022 11:24:01 +0200 Subject: [PATCH 03/35] fix datepicker for householdmember editor --- .../components/Dates.vue | 19 ++++++++++--------- .../HouseholdMembersEditor/store/index.js | 6 +++--- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Dates.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Dates.vue index 94c1a146a..12867741d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Dates.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Dates.vue @@ -66,18 +66,19 @@ export default { }, startDate: { get() { - return [ - this.$store.state.startDate.getFullYear(), - (this.$store.state.startDate.getMonth() + 1).toString().padStart(2, '0'), - this.$store.state.startDate.getDate().toString().padStart(2, '0') - ].join('-'); + return this.$store.state.startDate; + // return [ + // this.$store.state.startDate.getFullYear(), + // (this.$store.state.startDate.getMonth() + 1).toString().padStart(2, '0'), + // this.$store.state.startDate.getDate().toString().padStart(2, '0') + // ].join('-'); }, set(value) { - let - [year, month, day] = value.split('-'), - dValue = new Date(year, month-1, day); + // let + // [year, month, day] = value.split('-'), + // dValue = new Date(year, month-1, day); - this.$store.dispatch('setStartDate', dValue); + this.$store.dispatch('setStartDate', value); } } } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js index cc5ab497c..fcb12d9f5 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js @@ -2,7 +2,7 @@ import { createStore } from 'vuex'; import { householdMove, fetchHouseholdSuggestionByAccompanyingPeriod, fetchAddressSuggestionByPerson} from './../api.js'; import { fetchResults } from 'ChillMainAssets/lib/api/apiMethods.js' import { fetchHouseholdByAddressReference } from 'ChillPersonAssets/lib/household.js'; -import { datetimeToISO } from 'ChillMainAssets/chill/js/date.js'; +import { datetimeToISO, dateToISO, ISOToDate } from 'ChillMainAssets/chill/js/date.js'; const debug = process.env.NODE_ENV !== 'production'; @@ -30,7 +30,7 @@ const store = createStore({ } return 0; }), - startDate: new Date(), + startDate: dateToISO(new Date()), /** * Indicates if the destination is: * @@ -278,7 +278,7 @@ const store = createStore({ type: conc.person.type }, start_date: { - datetime: datetimeToISO(state.startDate) + datetime: datetimeToISO(ISOToDate(state.startDate)) } }; From e663bae5c4d492f471eead0881c69e76b7c858ff Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 6 Apr 2022 11:26:04 +0200 Subject: [PATCH 04/35] fix datepicker for social action edit form. still a problem with the display of already set evaluation dates... need to be transformed to correct format to display --- .../vuejs/AccompanyingCourseWorkEdit/App.vue | 8 ++++---- .../components/FormEvaluation.vue | 12 ++++++------ .../vuejs/AccompanyingCourseWorkEdit/store.js | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index bcfa53e45..668385b8a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -439,18 +439,18 @@ export default { ]), startDate: { get() { - return dateToISO(this.$store.state.startDate); + return this.$store.state.startDate; }, set(v) { - this.$store.commit('setStartDate', ISOToDate(v)); + this.$store.commit('setStartDate', v); } }, endDate: { get() { - return dateToISO(this.$store.state.endDate); + return this.$store.state.endDate; }, set(v) { - this.$store.commit('setEndDate', ISOToDate(v)); + this.$store.commit('setEndDate', v); } }, note: { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index eff62bbbb..d2b17ec2c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -306,26 +306,26 @@ export default { }, startDate: { get() { - return dateToISO(this.evaluation.startDate); + return this.evaluation.startDate; }, set(v) { - this.$store.commit('setEvaluationStartDate', { key: this.evaluation.key, date: ISOToDate(v) }); + this.$store.commit('setEvaluationStartDate', { key: this.evaluation.key, date: v }); } }, endDate: { get() { - return dateToISO(this.evaluation.endDate); + return this.evaluation.endDate; }, set(v) { - this.$store.commit('setEvaluationEndDate', { key: this.evaluation.key, date: ISOToDate(v) }); + this.$store.commit('setEvaluationEndDate', { key: this.evaluation.key, date: v }); } }, maxDate: { get() { - return dateToISO(this.evaluation.maxDate); + return this.evaluation.maxDate; }, set(v) { - this.$store.commit('setEvaluationMaxDate', { key: this.evaluation.key, date: ISOToDate(v) }); + this.$store.commit('setEvaluationMaxDate', { key: this.evaluation.key, date: v }); } }, warningInterval: { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index 4ce0b8ebe..0bfe61d94 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -1,5 +1,5 @@ import { createStore } from 'vuex'; -import { datetimeToISO, ISOToDatetime, intervalDaysToISO, intervalISOToDays } from 'ChillMainAssets/chill/js/date.js'; +import { dateToISO, ISOToDate, datetimeToISO, ISOToDatetime, intervalDaysToISO, intervalISOToDays } from 'ChillMainAssets/chill/js/date.js'; import { findSocialActionsBySocialIssue } from 'ChillPersonAssets/vuejs/_api/SocialWorkSocialAction.js'; import { create } from 'ChillPersonAssets/vuejs/_api/AccompanyingCourseWork.js'; import { fetchResults, makeFetch } from 'ChillMainAssets/lib/api/apiMethods.js'; @@ -13,9 +13,9 @@ const store = createStore({ state: { work: window.accompanyingCourseWork, startDate: window.accompanyingCourseWork.startDate !== null ? - ISOToDatetime(window.accompanyingCourseWork.startDate.datetime) : null, + dateToISO(new Date(window.accompanyingCourseWork.startDate.datetime)) : null, endDate: window.accompanyingCourseWork.endDate !== null ? - ISOToDatetime(window.accompanyingCourseWork.endDate.datetime) : null, + dateToISO(new Date(window.accompanyingCourseWork.endDate.datetime)) : null, note: window.accompanyingCourseWork.note, goalsPicked: window.accompanyingCourseWork.goals, goalsForAction: [], @@ -73,10 +73,10 @@ const store = createStore({ type: 'accompanying_period_work', id: state.work.id, startDate: state.startDate === null ? null : { - datetime: datetimeToISO(state.startDate) + datetime: datetimeToISO(ISOToDate(state.startDate)) }, endDate: state.endDate === null ? null : { - datetime: datetimeToISO(state.endDate) + datetime: datetimeToISO(ISOToDate(state.endDate)) }, note: state.note, persons: state.personsPicked.map(p => ({id: p.id, type: p.type})), @@ -110,9 +110,9 @@ const store = createStore({ id: e.evaluation.id, type: e.evaluation.type }, - startDate: e.startDate !== null ? { datetime: datetimeToISO(e.startDate) } : null, - endDate: e.endDate !== null ? { datetime: datetimeToISO(e.endDate) } : null, - maxDate: e.maxDate !== null ? { datetime: datetimeToISO(e.maxDate) } : null, + startDate: e.startDate !== null ? { datetime: datetimeToISO(ISOToDate(e.startDate)) } : null, + endDate: e.endDate !== null ? { datetime: datetimeToISO(ISOToDate(e.endDate)) } : null, + maxDate: e.maxDate !== null ? { datetime: datetimeToISO(ISOToDate(e.maxDate)) } : null, warningInterval: intervalDaysToISO(e.warningInterval), comment: e.comment, documents: e.documents From ebc4ec0d7c2b5eba3d571b1de57b1fd21c45d332 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 19 Apr 2022 15:09:25 +0200 Subject: [PATCH 05/35] updating openingdate parcours fixed --- .../components/StartDate.vue | 26 ++++++++++++++----- .../vuejs/AccompanyingCourse/js/i18n.js | 2 +- .../vuejs/AccompanyingCourse/store/index.js | 6 +---- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue index 349581452..b6a0344e8 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue @@ -5,9 +5,9 @@
- -
- +
+ +
@@ -23,10 +23,12 @@ import { mapState, mapGetters } from 'vuex'; export default { name: 'startDate', methods: { - updateStartDate(event) { - const date = event.target.value; - // console.log(date) + updateStartDate(e) { + e.preventDefault(); + const date = e.target.previousSibling.value; + this.$store.dispatch('updateStartDate', date) + .then(this.$toast.open({type: 'success', message: this.$t('startdate.update')})) .catch(({name, violations}) => { if (name === 'ValidationException' || name === 'AccessException') { violations.forEach((violation) => this.$toast.open({message: violation})); @@ -43,4 +45,14 @@ export default { } } - \ No newline at end of file + + + \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js index f1e2de958..a3a8ede2d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js @@ -153,7 +153,7 @@ const appMessages = { }, startdate: { change: "Date d'ouverture", - date: "Date d'ouverture", + update: "La nouvelle date d'ouverture a été bien enregistrée" }, // catch errors 'Error while updating AccompanyingPeriod Course.': "Erreur du serveur lors de la mise à jour du parcours d'accompagnement.", 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 06a3606ab..5d73aa2ed 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js @@ -322,7 +322,6 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou } }, updateStartDate(state, date) { - console.log('new state date', date) state.accompanyingCourse.openingDate = date; } }, @@ -814,11 +813,8 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou }) }, updateStartDate({commit}, payload) { - console.log('payload', payload) - const date = ISOToDate(payload); const url = `/api/1.0/person/accompanying-course/${id}.json`; - const body = { type: "accompanying_period", openingDate: { datetime: datetimeToISO(date) }}; - console.log('body', body) + const body = { type: "accompanying_period", openingDate: { datetime: datetimeToISO(ISOToDate(payload)) }}; return makeFetch('PATCH', url, body) .then((response) => { commit('updateStartDate', response.openingDate); From 8882c99f5a56a44edc7f5024576c30fe3ae257f4 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 5 Apr 2022 15:56:02 +0200 Subject: [PATCH 06/35] fix datepicker for social action --- .../public/vuejs/AccompanyingCourseWorkCreate/App.vue | 9 ++++----- .../public/vuejs/AccompanyingCourseWorkCreate/store.js | 7 ++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue index 503a00c59..758cd7e5e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue @@ -227,19 +227,18 @@ export default { }, startDate: { get() { - let d = this.$store.state.startDate; - return dateToISO(d); + return this.$store.state.startDate; }, set(value) { - this.$store.commit('setStartDate', ISOToDate(value)); + this.$store.commit('setStartDate', value); } }, endDate: { get() { - return dateToISO(this.$store.state.endDate); + return this.$store.state.endDate; }, set(value) { - this.$store.commit('setEndDate', ISOToDate(value)); + this.$store.commit('setEndDate', value); } }, setSocialIssue: { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js index 408115257..7b6c2b22e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js @@ -1,6 +1,6 @@ import { createStore } from 'vuex'; -import { datetimeToISO } from 'ChillMainAssets/chill/js/date.js'; +import { datetimeToISO, dateToISO, ISOToDate, ISOToDatetime } from 'ChillMainAssets/chill/js/date.js'; import { findSocialActionsBySocialIssue } from 'ChillPersonAssets/vuejs/_api/SocialWorkSocialAction.js'; // import { create } from 'ChillPersonAssets/vuejs/_api/AccompanyingCourseWork.js'; import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods'; @@ -47,7 +47,7 @@ const store = createStore({ id: state.socialActionPicked.id }, startDate: { - datetime: datetimeToISO(state.startDate) + datetime: datetimeToISO(ISOToDate(state.startDate)) }, persons: [] }; @@ -61,7 +61,7 @@ const store = createStore({ if (null !== state.endDate) { payload.endDate = { - datetime: datetimeToISO(state.endDate) + datetime: datetimeToISO(ISOToDate(state.endDate)) }; } @@ -111,6 +111,7 @@ const store = createStore({ state.startDate = date; }, setEndDate(state, date) { + console.log(date) state.endDate = date; }, setPersonsPickedIds(state, ids) { From 66ab38c60ff03db6e6f852be2e5f0cba04b97819 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 5 Apr 2022 16:03:07 +0200 Subject: [PATCH 07/35] prefill startdate with now --- .../public/vuejs/AccompanyingCourseWorkCreate/store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js index 7b6c2b22e..3c2e034d7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/store.js @@ -20,7 +20,7 @@ const store = createStore({ .map(p => p.person), personsReachables: window.accompanyingCourse.participations.filter(p => p.endDate == null) .map(p => p.person), - startDate: new Date(), + startDate: dateToISO(new Date()), endDate: null, isLoadingSocialActions: false, isPostingWork: false, From de9d2aa88527de3390b70b53c44ad0968fda5ccf Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 6 Apr 2022 11:24:01 +0200 Subject: [PATCH 08/35] fix datepicker for householdmember editor --- .../components/Dates.vue | 19 ++++++++++--------- .../HouseholdMembersEditor/store/index.js | 6 +++--- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Dates.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Dates.vue index 040d316bb..03feb0329 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Dates.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Dates.vue @@ -66,18 +66,19 @@ export default { }, startDate: { get() { - return [ - this.$store.state.startDate.getFullYear(), - (this.$store.state.startDate.getMonth() + 1).toString().padStart(2, '0'), - this.$store.state.startDate.getDate().toString().padStart(2, '0') - ].join('-'); + return this.$store.state.startDate; + // return [ + // this.$store.state.startDate.getFullYear(), + // (this.$store.state.startDate.getMonth() + 1).toString().padStart(2, '0'), + // this.$store.state.startDate.getDate().toString().padStart(2, '0') + // ].join('-'); }, set(value) { - let - [year, month, day] = value.split('-'), - dValue = new Date(year, month-1, day); + // let + // [year, month, day] = value.split('-'), + // dValue = new Date(year, month-1, day); - this.$store.dispatch('setStartDate', dValue); + this.$store.dispatch('setStartDate', value); } } } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js index f09b19787..87e465a8d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js @@ -2,7 +2,7 @@ import { createStore } from 'vuex'; import { householdMove, fetchHouseholdSuggestionByAccompanyingPeriod, fetchAddressSuggestionByPerson} from './../api.js'; import { fetchResults } from 'ChillMainAssets/lib/api/apiMethods.js' import { fetchHouseholdByAddressReference } from 'ChillPersonAssets/lib/household.js'; -import { datetimeToISO } from 'ChillMainAssets/chill/js/date.js'; +import { datetimeToISO, dateToISO, ISOToDate } from 'ChillMainAssets/chill/js/date.js'; const debug = process.env.NODE_ENV !== 'production'; @@ -30,7 +30,7 @@ const store = createStore({ } return 0; }), - startDate: new Date(), + startDate: dateToISO(new Date()), /** * Indicates if the destination is: * @@ -278,7 +278,7 @@ const store = createStore({ type: conc.person.type }, start_date: { - datetime: datetimeToISO(state.startDate) + datetime: datetimeToISO(ISOToDate(state.startDate)) } }; From 65e6471a02ac72453c79151188025915755b3e08 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 6 Apr 2022 11:26:04 +0200 Subject: [PATCH 09/35] fix datepicker for social action edit form. still a problem with the display of already set evaluation dates... need to be transformed to correct format to display --- .../vuejs/AccompanyingCourseWorkEdit/App.vue | 8 ++++---- .../components/FormEvaluation.vue | 12 ++++++------ .../vuejs/AccompanyingCourseWorkEdit/store.js | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index bcfa53e45..668385b8a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -439,18 +439,18 @@ export default { ]), startDate: { get() { - return dateToISO(this.$store.state.startDate); + return this.$store.state.startDate; }, set(v) { - this.$store.commit('setStartDate', ISOToDate(v)); + this.$store.commit('setStartDate', v); } }, endDate: { get() { - return dateToISO(this.$store.state.endDate); + return this.$store.state.endDate; }, set(v) { - this.$store.commit('setEndDate', ISOToDate(v)); + this.$store.commit('setEndDate', v); } }, note: { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index 53e2b72f3..cad070de3 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -309,26 +309,26 @@ export default { }, startDate: { get() { - return dateToISO(this.evaluation.startDate); + return this.evaluation.startDate; }, set(v) { - this.$store.commit('setEvaluationStartDate', { key: this.evaluation.key, date: ISOToDate(v) }); + this.$store.commit('setEvaluationStartDate', { key: this.evaluation.key, date: v }); } }, endDate: { get() { - return dateToISO(this.evaluation.endDate); + return this.evaluation.endDate; }, set(v) { - this.$store.commit('setEvaluationEndDate', { key: this.evaluation.key, date: ISOToDate(v) }); + this.$store.commit('setEvaluationEndDate', { key: this.evaluation.key, date: v }); } }, maxDate: { get() { - return dateToISO(this.evaluation.maxDate); + return this.evaluation.maxDate; }, set(v) { - this.$store.commit('setEvaluationMaxDate', { key: this.evaluation.key, date: ISOToDate(v) }); + this.$store.commit('setEvaluationMaxDate', { key: this.evaluation.key, date: v }); } }, warningInterval: { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index 4ce0b8ebe..0bfe61d94 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -1,5 +1,5 @@ import { createStore } from 'vuex'; -import { datetimeToISO, ISOToDatetime, intervalDaysToISO, intervalISOToDays } from 'ChillMainAssets/chill/js/date.js'; +import { dateToISO, ISOToDate, datetimeToISO, ISOToDatetime, intervalDaysToISO, intervalISOToDays } from 'ChillMainAssets/chill/js/date.js'; import { findSocialActionsBySocialIssue } from 'ChillPersonAssets/vuejs/_api/SocialWorkSocialAction.js'; import { create } from 'ChillPersonAssets/vuejs/_api/AccompanyingCourseWork.js'; import { fetchResults, makeFetch } from 'ChillMainAssets/lib/api/apiMethods.js'; @@ -13,9 +13,9 @@ const store = createStore({ state: { work: window.accompanyingCourseWork, startDate: window.accompanyingCourseWork.startDate !== null ? - ISOToDatetime(window.accompanyingCourseWork.startDate.datetime) : null, + dateToISO(new Date(window.accompanyingCourseWork.startDate.datetime)) : null, endDate: window.accompanyingCourseWork.endDate !== null ? - ISOToDatetime(window.accompanyingCourseWork.endDate.datetime) : null, + dateToISO(new Date(window.accompanyingCourseWork.endDate.datetime)) : null, note: window.accompanyingCourseWork.note, goalsPicked: window.accompanyingCourseWork.goals, goalsForAction: [], @@ -73,10 +73,10 @@ const store = createStore({ type: 'accompanying_period_work', id: state.work.id, startDate: state.startDate === null ? null : { - datetime: datetimeToISO(state.startDate) + datetime: datetimeToISO(ISOToDate(state.startDate)) }, endDate: state.endDate === null ? null : { - datetime: datetimeToISO(state.endDate) + datetime: datetimeToISO(ISOToDate(state.endDate)) }, note: state.note, persons: state.personsPicked.map(p => ({id: p.id, type: p.type})), @@ -110,9 +110,9 @@ const store = createStore({ id: e.evaluation.id, type: e.evaluation.type }, - startDate: e.startDate !== null ? { datetime: datetimeToISO(e.startDate) } : null, - endDate: e.endDate !== null ? { datetime: datetimeToISO(e.endDate) } : null, - maxDate: e.maxDate !== null ? { datetime: datetimeToISO(e.maxDate) } : null, + startDate: e.startDate !== null ? { datetime: datetimeToISO(ISOToDate(e.startDate)) } : null, + endDate: e.endDate !== null ? { datetime: datetimeToISO(ISOToDate(e.endDate)) } : null, + maxDate: e.maxDate !== null ? { datetime: datetimeToISO(ISOToDate(e.maxDate)) } : null, warningInterval: intervalDaysToISO(e.warningInterval), comment: e.comment, documents: e.documents From bc550ea42aa1d13447ef0f0d658cdf6f51e2c349 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 19 Apr 2022 15:09:25 +0200 Subject: [PATCH 10/35] updating openingdate parcours fixed --- .../components/StartDate.vue | 26 ++++++++++++++----- .../vuejs/AccompanyingCourse/js/i18n.js | 2 +- .../vuejs/AccompanyingCourse/store/index.js | 6 +---- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue index 349581452..b6a0344e8 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue @@ -5,9 +5,9 @@
- -
- +
+ +
@@ -23,10 +23,12 @@ import { mapState, mapGetters } from 'vuex'; export default { name: 'startDate', methods: { - updateStartDate(event) { - const date = event.target.value; - // console.log(date) + updateStartDate(e) { + e.preventDefault(); + const date = e.target.previousSibling.value; + this.$store.dispatch('updateStartDate', date) + .then(this.$toast.open({type: 'success', message: this.$t('startdate.update')})) .catch(({name, violations}) => { if (name === 'ValidationException' || name === 'AccessException') { violations.forEach((violation) => this.$toast.open({message: violation})); @@ -43,4 +45,14 @@ export default { } } - \ No newline at end of file + + + \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js index f1e2de958..a3a8ede2d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js @@ -153,7 +153,7 @@ const appMessages = { }, startdate: { change: "Date d'ouverture", - date: "Date d'ouverture", + update: "La nouvelle date d'ouverture a été bien enregistrée" }, // catch errors 'Error while updating AccompanyingPeriod Course.': "Erreur du serveur lors de la mise à jour du parcours d'accompagnement.", 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 06a3606ab..5d73aa2ed 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js @@ -322,7 +322,6 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou } }, updateStartDate(state, date) { - console.log('new state date', date) state.accompanyingCourse.openingDate = date; } }, @@ -814,11 +813,8 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou }) }, updateStartDate({commit}, payload) { - console.log('payload', payload) - const date = ISOToDate(payload); const url = `/api/1.0/person/accompanying-course/${id}.json`; - const body = { type: "accompanying_period", openingDate: { datetime: datetimeToISO(date) }}; - console.log('body', body) + const body = { type: "accompanying_period", openingDate: { datetime: datetimeToISO(ISOToDate(payload)) }}; return makeFetch('PATCH', url, body) .then((response) => { commit('updateStartDate', response.openingDate); From 0ce23230da611069b094b90f2a554233df3df069 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 20 Apr 2022 13:32:51 +0200 Subject: [PATCH 11/35] fix evaluation datepickers in edit --- .../vuejs/AccompanyingCourseWorkEdit/App.vue | 10 +-- .../components/FormEvaluation.vue | 81 ++++++++++--------- .../vuejs/AccompanyingCourseWorkEdit/store.js | 7 +- 3 files changed, 50 insertions(+), 48 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index 668385b8a..bab64018a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -521,12 +521,12 @@ export default { this.$store.commit('removeReferrer', u); }, goToGenerateWorkflow({link}) { - console.log('save before leave to generate workflow') - const callback = (data) => { - window.location.assign(link); - }; + // console.log('save before leave to generate workflow') + const callback = (data) => { + window.location.assign(link); + }; - return this.$store.dispatch('submit', callback) + return this.$store.dispatch('submit', callback) .catch(e => { console.log(e); throw e; }); }, submit() { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index cad070de3..ca0d16eec 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -298,38 +298,39 @@ export default { } }, computed: { - ...mapState([ - 'isPosting' - ]), + ...mapState([ + 'isPosting' + ]), getTemplatesAvailables() { - return this.$store.getters.getTemplatesAvailablesForEvaluation(this.evaluation.evaluation); + return this.$store.getters.getTemplatesAvailablesForEvaluation(this.evaluation.evaluation); }, canGenerate() { - return !this.$store.state.isPosting && this.template !== null; + return !this.$store.state.isPosting && this.template !== null; }, startDate: { - get() { - return this.evaluation.startDate; - }, - set(v) { - this.$store.commit('setEvaluationStartDate', { key: this.evaluation.key, date: v }); - } + get() { + console.log('evaluation', this.evaluation); + return this.evaluation.startDate; + }, + set(v) { + this.$store.commit('setEvaluationStartDate', { key: this.evaluation.key, date: v }); + } }, endDate: { - get() { - return this.evaluation.endDate; - }, - set(v) { - this.$store.commit('setEvaluationEndDate', { key: this.evaluation.key, date: v }); - } + get() { + return this.evaluation.endDate; + }, + set(v) { + this.$store.commit('setEvaluationEndDate', { key: this.evaluation.key, date: v }); + } }, maxDate: { - get() { - return this.evaluation.maxDate; - }, - set(v) { - this.$store.commit('setEvaluationMaxDate', { key: this.evaluation.key, date: v }); - } + get() { + return this.evaluation.maxDate; + }, + set(v) { + this.$store.commit('setEvaluationMaxDate', { key: this.evaluation.key, date: v }); + } }, warningInterval: { get() { return this.evaluation.warningInterval; }, @@ -344,7 +345,7 @@ export default { ISOToDatetime, canEditDocument(document) { return 'storedObject' in document ? - this.mime.includes(document.storedObject.type) && document.storedObject.keyInfos.length === 0 : false; + this.mime.includes(document.storedObject.type) && document.storedObject.keyInfos.length === 0 : false; }, listAllStatus() { console.log('load all status'); @@ -360,16 +361,16 @@ export default { }, buildEditLink(storedObject) { return `/wopi/edit/${storedObject.uuid}?returnPath=` + encodeURIComponent( - window.location.pathname + window.location.search + window.location.hash); + window.location.pathname + window.location.search + window.location.hash); }, submitBeforeGenerate({template}) { - const callback = (data) => { - let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id; + const callback = (data) => { + let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id; - window.location.assign(buildLink(template, evaluationId, 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluation')); - }; + window.location.assign(buildLink(template, evaluationId, 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluation')); + }; - return this.$store.dispatch('submit', callback).catch(e => { console.log(e); throw e; }); + return this.$store.dispatch('submit', callback).catch(e => { console.log(e); throw e; }); }, onInputDocumentTitle(event) { const id = Number(event.target.id); @@ -395,20 +396,20 @@ export default { }, removeDocument(document) { if (window.confirm("Êtes-vous sûr·e de vouloir supprimer le document qui a pour titre \"" + document.title +"\" ?")) { - this.$store.commit('removeDocument', {key: this.evaluation.key, document: document}); + this.$store.commit('removeDocument', {key: this.evaluation.key, document: document}); } }, goToGenerateWorkflowEvaluationDocument({event, link, workflowName, payload}) { - const callback = (data) => { - let evaluation = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key); - let updatedDocument = evaluation.documents.find(d => d.key === payload.doc.key); - window.location.assign(buildLinkCreate(workflowName, - 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument', updatedDocument.id)); - }; + const callback = (data) => { + let evaluation = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key); + let updatedDocument = evaluation.documents.find(d => d.key === payload.doc.key); + window.location.assign(buildLinkCreate(workflowName, + 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument', updatedDocument.id)); + }; - return this.$store.dispatch('submit', callback) - .catch(e => { console.log(e); throw e; }); - }, + return this.$store.dispatch('submit', callback) + .catch(e => { console.log(e); throw e; }); + }, }, } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index 0bfe61d94..570a3b670 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -132,9 +132,9 @@ const store = createStore({ var k = Object.assign(e, { key: index, editEvaluation: false, - startDate: e.startDate !== null ? ISOToDatetime(e.startDate.datetime) : null, - endDate: e.endDate !== null ? ISOToDatetime(e.endDate.datetime) : null, - maxDate: e.maxDate !== null ? ISOToDatetime(e.maxDate.datetime) : null, + startDate: e.startDate !== null ? dateToISO(new Date(e.startDate.datetime)) : null, + endDate: e.endDate !== null ? dateToISO(new Date(e.endDate.datetime)) : null, + maxDate: e.maxDate !== null ? dateToISO(new Date(e.maxDate.datetime)) : null, warningInterval: e.warningInterval !== null ? intervalISOToDays(e.warningInterval) : null, documents: e.documents.map((d, docIndex) => { return Object.assign(d, { @@ -264,6 +264,7 @@ const store = createStore({ .startDate = date; }, setEvaluationEndDate(state, {key, date}) { + console.log('commit date', date) state.evaluationsPicked.find(e => e.key === key) .endDate = date; }, From ad1e7b576cfefe67976709d2aaff262b5b8cb964 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 20 Apr 2022 13:58:45 +0200 Subject: [PATCH 12/35] remove success toast for parcours startdate + take empty string values into account for action dates --- .../public/vuejs/AccompanyingCourse/components/StartDate.vue | 3 +-- .../public/vuejs/AccompanyingCourseWorkEdit/store.js | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue index b6a0344e8..564fc74b7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue @@ -28,14 +28,13 @@ export default { const date = e.target.previousSibling.value; this.$store.dispatch('updateStartDate', date) - .then(this.$toast.open({type: 'success', message: this.$t('startdate.update')})) .catch(({name, violations}) => { if (name === 'ValidationException' || name === 'AccessException') { violations.forEach((violation) => this.$toast.open({message: violation})); } else { this.$toast.open({message: 'An error occurred'}) } - }); + }) }, }, computed: { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index 570a3b670..77cc4800e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -69,13 +69,14 @@ const store = createStore({ return []; }, buildPayload(state) { + console.log('end date', state.endDate); return { type: 'accompanying_period_work', id: state.work.id, - startDate: state.startDate === null ? null : { + startDate: state.startDate === null || state.startDate === '' ? null : { datetime: datetimeToISO(ISOToDate(state.startDate)) }, - endDate: state.endDate === null ? null : { + endDate: state.endDate === null || state.endDate === '' ? null : { datetime: datetimeToISO(ISOToDate(state.endDate)) }, note: state.note, From be77c3729b7700b5827482d9346d544dd7dca62e Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 20 Apr 2022 14:09:28 +0200 Subject: [PATCH 13/35] take empty date strings into account --- .../public/vuejs/AccompanyingCourse/store/index.js | 3 ++- .../public/vuejs/AccompanyingCourseWorkEdit/store.js | 6 +++--- .../public/vuejs/HouseholdMembersEditor/store/index.js | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) 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 5d73aa2ed..57415565b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js @@ -814,7 +814,8 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou }, updateStartDate({commit}, payload) { const url = `/api/1.0/person/accompanying-course/${id}.json`; - const body = { type: "accompanying_period", openingDate: { datetime: datetimeToISO(ISOToDate(payload)) }}; + const date = payload === null || payload === '' ? null : { datetime: datetimeToISO(ISOToDate(payload)) } + const body = { type: "accompanying_period", openingDate: date}; return makeFetch('PATCH', url, body) .then((response) => { commit('updateStartDate', response.openingDate); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index 77cc4800e..502704716 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -111,9 +111,9 @@ const store = createStore({ id: e.evaluation.id, type: e.evaluation.type }, - startDate: e.startDate !== null ? { datetime: datetimeToISO(ISOToDate(e.startDate)) } : null, - endDate: e.endDate !== null ? { datetime: datetimeToISO(ISOToDate(e.endDate)) } : null, - maxDate: e.maxDate !== null ? { datetime: datetimeToISO(ISOToDate(e.maxDate)) } : null, + startDate: e.startDate === null || e.startDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.startDate)) }, + endDate: e.endDate === null || e.endDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.endDate)) }, + maxDate: e.maxDate === null || e.maxDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.maxDate)) }, warningInterval: intervalDaysToISO(e.warningInterval), comment: e.comment, documents: e.documents diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js index 87e465a8d..75b3c215f 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/store/index.js @@ -278,7 +278,7 @@ const store = createStore({ type: conc.person.type }, start_date: { - datetime: datetimeToISO(ISOToDate(state.startDate)) + datetime: state.startDate === null || state.startDate === '' ? null : datetimeToISO(ISOToDate(state.startDate)) } }; From 92d394b6695055d322c46c9e675d5e6d077e7c07 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 20 Apr 2022 14:22:35 +0200 Subject: [PATCH 14/35] changelog updated --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f26e64a1..626d41658 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to * [Activity form] invert 'incoming' and 'receiving' in Activity form * [Activity form] keep the same order for 'attendee' field in new and edit form * [list with period] use "sameas" test operator to introduce requestor in list +* [Datepickers] datepickers fixed when using keyboard to enter date (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/545) ## Test releases From b24de76d77f56f8e5b5c04d5056692b6641bb979 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 20 Apr 2022 15:16:26 +0200 Subject: [PATCH 15/35] display agents traitants --- CHANGELOG.md | 2 +- .../AccompanyingCourseWork/_item.html.twig | 32 +++++++++---------- ...st_recent_by_accompanying_period.html.twig | 9 ++++++ .../translations/messages.fr.yml | 2 +- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 459f95005..44915aa63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ and this project adheres to * [list with period] use "sameas" test operator to introduce requestor in list * [notification email on course designation] allow raw string in email content generation * [Accompanying period work] list evaluations associated to a work by startDate, and then by id, from the most recent to older - +* [social_action] Display 'agents traitants' in parcours resumé and social action list (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/568) ## Test releases diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig index 8ff8a0617..3d4f46425 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig @@ -25,22 +25,6 @@
- {% if w.createdBy %} -
-
-

{{ 'Referrers'|trans }}

-
-
-

- {% for u in w.referrers %} - {{ u|chill_entity_render_box }} - {% if not loop.last %}, {% endif %} - {% endfor %} -

-
-
- {% endif %} - {%- if w.persons -%}
@@ -78,6 +62,22 @@
{% endif %} + {%- if w.referrers -%} +
+
+

{{ 'Referrers'|trans }}

+
+
+ {% for u in w.referrers %} + + {{ u|chill_entity_render_box }} + {% if not loop.last %}, {% endif %} + + {% endfor %} +
+
+ {% endif %} + {%- if w.socialAction.issue -%}
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig index 7f2fb0177..4621cb97a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig @@ -28,6 +28,15 @@ {{ w.handlingThierParty|chill_entity_render_box }} {% endif %} + {% if w.referrers %} +
  • + {{ 'Referrers'|trans ~ ' : ' }} + {% for u in w.referrers %} + {{ u|chill_entity_render_box }} + {% if not loop.last %}, {% endif %} + {% endfor %} +
  • + {% endif %}
  • {{ 'Participants'|trans ~ ' : ' }} {% for p in w.persons %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index c6baf9513..535985d23 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -214,7 +214,7 @@ No requestor: Pas de demandeur No resources: "Pas d'interlocuteurs privilégiés" Persons associated: Usagers concernés Referrer: Référent -Referrers: Référents +Referrers: Agents traitants Some peoples does not belong to any household currently. Add them to an household soon: Certaines personnes n'appartiennent à aucun ménage actuellement. Renseignez leur ménage dès que possible. Add to household now: Ajouter à un ménage Any resource for this accompanying course: Aucun interlocuteur privilégié pour ce parcours From c6be7955fd3eb1669e3bae5c791b424cfd4817f3 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 21 Apr 2022 13:59:45 +0200 Subject: [PATCH 16/35] remove save button datepicker parcours. set timeout --- .../components/StartDate.vue | 64 ++++++++++++++----- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue index b33447b25..c987150be 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StartDate.vue @@ -6,8 +6,7 @@
    - - +
    @@ -17,31 +16,64 @@