diff --git a/CHANGELOG.md b/CHANGELOG.md index f60770f36..4a2f8dfae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ and this project adheres to ## Unreleased +* [parcours]: component added to change the opening date of a parcours (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/411) +* [search]: listing of parcours display changed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/410) +* [user]: page with accompanying periods to which is user is referent (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/408) +* [person] age added to renderstring + renderbox/ vue component created to display person text (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/389) + ## Test releases @@ -23,6 +28,7 @@ and this project adheres to * [person] name suggestions within create person form when person is created departing from a search input (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/377) * [person] Add residential address entity, form and list for each person * [aside_activity]: dynamicUserPickerType used (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/399) +* dispatching list ### test release 2021-01-26 @@ -30,8 +36,6 @@ and this project adheres to * [parcours] comments truncated if too long + link added (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/406) * [person]: possibility to add person resources (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/382) * [person ressources]: module added -* [parcours] bugfix if deathdate is not defined (eg. for a thirdparty) parcours is still displayed. Gave error before. -* dispatching list ### test release 2022-01-24 diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue index f5057eb25..45483dc95 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue @@ -1,45 +1,48 @@ diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig index 0f426c5a9..e8be2c49e 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig @@ -48,7 +48,7 @@
  • {{ 'Participants'|trans ~ ' : ' }} {% for p in activity.personsAssociated %} - {{ p|chill_entity_render_box }} + {{ p|chill_entity_render_box({'addAgeBadge': true}) }} {% endfor %}
  • diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/badge.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/badge.scss index 4d213645e..bfd43064b 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/badge.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/badge.scss @@ -12,6 +12,7 @@ display: block; top: calc(50% - 7px); right: 10px; + line-height: 11px; } } @@ -62,14 +63,19 @@ ul.list-suggest { & span:hover { color: $chill-l-gray; } + .person-text { + span { + padding-left: 0px; + } + } } } &.remove-items { li { position: relative; - span { + & > span { display: block; - padding-right: .75rem; + padding-right: 1.75rem; @include remove_link; } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js index 1ab8eb29a..c1eac0b06 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js @@ -61,14 +61,15 @@ const messages = { woman: "Née le" }, deathdate: "Date de décès", - years_old: "ans", household_without_address: "Le ménage de l'usager est sans adresse", no_data: "Aucune information renseignée", type: { thirdparty: "Tiers", person: "Usager" }, - holder: "Titulaire" + holder: "Titulaire", + years_old: "an | {n} an | {n} ans", + } } }; diff --git a/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig b/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig index 1f29bfe7a..16e9cbf02 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig @@ -42,6 +42,3 @@ {% endif %} > - -{{ encore_entry_script_tags('vue_onthefly') }} -{{ encore_entry_link_tags('vue_onthefly') }} diff --git a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig index a123ce405..ef48414e0 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig @@ -13,6 +13,7 @@ {{ encore_entry_link_tags('mod_ckeditor5') }} {{ encore_entry_link_tags('chill') }} {{ encore_entry_link_tags('mod_blur') }} + {{ encore_entry_link_tags('vue_onthefly') }} {% block css %}{% endblock %} @@ -94,6 +95,7 @@ {{ encore_entry_script_tags('mod_ckeditor5') }} {{ encore_entry_script_tags('mod_blur') }} {{ encore_entry_script_tags('chill') }} + {{ encore_entry_script_tags('vue_onthefly') }} \ 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 297642c24..249cd7d41 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js @@ -151,6 +151,10 @@ const appMessages = { placeholder: "Choisir un métier", not_valid: "Sélectionnez un métier du référent" }, + startdate: { + change: "Modifier la date de début", + date: "Date de début", + }, // catch errors 'Error while updating AccompanyingPeriod Course.': "Erreur du serveur lors de la mise à jour du parcours d'accompagnement.", 'Error while retriving AccompanyingPeriod Course.': "Erreur du serveur lors du chargement 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 1413aa9e6..1fdc65c5e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js @@ -8,6 +8,7 @@ import { getAccompanyingCourse, import { patchPerson } from "ChillPersonAssets/vuejs/_api/OnTheFly"; import { patchThirdparty } from "ChillThirdPartyAssets/vuejs/_api/OnTheFly"; import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods'; +import { datetimeToISO, ISOToDate, ISOToDatetime } from 'ChillMainAssets/chill/js/date.js'; const debug = process.env.NODE_ENV !== 'production'; @@ -278,6 +279,10 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise]) if (scopeIds.includes(scope.id)) { state.scopesAtBackend = state.scopesAtBackend.filter(s => s.id !== scope.id); } + }, + updateStartDate(state, date) { + console.log('new state date', date) + state.accompanyingCourse.openingDate = date; } }, actions: { @@ -701,15 +706,30 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise]) throw error; }) }, + 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) + return makeFetch('PATCH', url, body) + .then((response) => { + commit('updateStartDate', response.openingDate); + }) + .catch((error) => { + commit('catchError', error); + throw error; + }) + }, async fetchReferrersSuggested({ state, commit}) { let users = await getReferrersSuggested(state.accompanyingCourse); commit('setReferrersSuggested', users); commit('setFilteredReferrersSuggested'); if ( - null === state.accompanyingCourse.user - && !state.accompanyingCourse.confidential - && !state.accompanyingCourse.step === 'DRAFT' - && users.length === 1 + null === state.accompanyingCourse.user + && !state.accompanyingCourse.confidential + && !state.accompanyingCourse.step === 'DRAFT' + && users.length === 1 ) { // set the user if unique commit('updateReferrer', users[0]); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue index 74ed0467c..503a00c59 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/App.vue @@ -5,7 +5,7 @@
    -
    +

    {{ $t('pick_social_issue_linked_with_action') }}

    {{ si.text }} @@ -33,7 +33,7 @@
    -
    +

    {{ $t('pick_an_action') }}

    -
    +

    {{ $t('persons_involved') }}

    • - - +
      + + +
    -
    + +
    +
    + +
    + +
    -
    + +
    + +
    + +
    +
    -

    {{ $t('form_has_errors') }}

    @@ -111,7 +128,7 @@ import { mapState, mapActions, mapGetters } from 'vuex'; import VueMultiselect from 'vue-multiselect'; import { dateToISO, ISOToDate } from 'ChillMainAssets/chill/js/date.js'; -import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue'; +import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue'; const i18n = { messages: { @@ -133,7 +150,7 @@ export default { name: 'App', components: { VueMultiselect, - PersonRenderBox, + PersonText, }, methods: { submit() { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index e43608895..5237dc7e2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -141,10 +141,12 @@
    • -
    @@ -281,6 +283,7 @@ import ThirdPartyRenderBox from 'ChillThirdPartyAssets/vuejs/_components/Entity/ import PickTemplate from 'ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue'; import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue'; import PickWorkflow from 'ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue'; +import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue'; const i18n = { messages: { @@ -329,7 +332,8 @@ export default { ThirdPartyRenderBox, PickTemplate, PickWorkflow, - OnTheFly + OnTheFly, + PersonText, }, i18n, data() { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Concerned.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Concerned.vue index 74271954f..57d9ee3aa 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Concerned.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Concerned.vue @@ -11,7 +11,7 @@
    • - {{ c.person.text }} +
    @@ -57,12 +57,14 @@ import { mapState, mapGetters } from 'vuex'; import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue'; import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue'; +import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue'; export default { name: 'Concerned', components: { AddPersons, PersonRenderBox, + PersonText, }, computed: { ...mapState([ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Positioning.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Positioning.vue index 487fb230e..005d46122 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Positioning.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Positioning.vue @@ -6,12 +6,13 @@
    -

    {{ conc.person.text }}

    + +