diff --git a/CHANGELOG.md b/CHANGELOG.md index cc4dbdb96..093a3dd96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,15 +11,28 @@ and this project adheres to ## Unreleased +* vuejs: add dead information on all on-the-fly person render boxes, in vis graph and other templates (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/271) +* [thirdparty] fix bug in 3rd party view: types was replaced by thirdPartyTypes +* [main] location form type: fix unmapped address field (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/246) +* [activity] fix wrong import of js assets for adding and viewing documents in activity (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/83 & https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/176) +* [person]: space added between deathdate and age in twig renderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/380) +* [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) + +## Test releases + +### test release 2022-01-10 + * [main] Add editableByUser field to locationType entity, adapt the admin template and add this condition in the location-type endpoint (see https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/297) * [main] Add mainLocation field to User entity and add it in user form type * rewrite page which allow to select activity * [main] Add mainLocation field to User entity and add it in user form type * [course list in person context] show full username/label for ref * [accompanying period work] remove the possibility to generate document from an accompanying period work -* [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) ## Test releases +* vuejs: add validation on required fields for AddPerson, Address and Location components +* vuejs: treat 422 validation errors in locations and AddPerson components +>>>>>>> origin/master ### test release 2022-01-12 diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 7c5e0e410..6f935ad99 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -307,6 +307,7 @@ class ActivityType extends AbstractType 'allow_add' => true, 'button_add_label' => 'activity.Insert a document', 'button_remove_label' => 'activity.Remove a document', + 'empty_collection_explain' => 'No documents', ]); } diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/App.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/App.vue index 2fb9d022d..4809a5fae 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/App.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/App.vue @@ -11,7 +11,7 @@ import Location from './components/Location.vue'; export default { name: "App", - props: ['hasSocialIssues', 'hasLocation', 'hasPerson'], + props: ['hasSocialIssues', 'hasLocation', 'hasPerson'], components: { ConcernedGroups, SocialIssuesAcc, diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue index b8249ccc5..91c5db839 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue @@ -24,7 +24,7 @@ v-model="location" > - + diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location/NewLocation.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location/NewLocation.vue index 35bf9a065..c9a1c233c 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location/NewLocation.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location/NewLocation.vue @@ -18,15 +18,6 @@ - - - {{ $t('activity.errors') }} - - {{ error }} - - - - {{ $t('activity.choose_location_type') }} @@ -62,6 +53,12 @@ {{ $t('activity.location_fields.email') }} + + + + {{ e }} + + @@ -81,7 +78,8 @@ import Modal from 'ChillMainAssets/vuejs/_components/Modal.vue'; import AddAddress from "ChillMainAssets/vuejs/Address/components/AddAddress.vue"; import { mapState } from "vuex"; -import { getLocationTypes, postLocation } from "../../api"; +import { getLocationTypes } from "../../api"; +import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods'; export default { name: "NewLocation", @@ -89,7 +87,7 @@ export default { Modal, AddAddress, }, - props: ['locations'], + props: ['availableLocations'], data() { return { errors: [], @@ -223,7 +221,6 @@ export default { }, saveNewLocation() { if (this.checkForm()) { - console.log('saveNewLocation', this.selected); let body = { type: 'location', name: this.selected.name, @@ -242,23 +239,28 @@ export default { } }); } - postLocation(body) - .then( - location => new Promise(resolve => { - this.locations.push(location); - this.$store.dispatch('updateLocation', location); - resolve(); - this.modal.showModal = false; - }) - ).catch( - err => { - this.errors.push(err.message); + + makeFetch('POST', '/api/1.0/main/location.json', body) + .then(response => { + this.$store.dispatch('addAvailableLocationGroup', { + locationGroup: 'Localisations nouvellement créées', + locations: [response] + }); + this.$store.dispatch('updateLocation', response); + this.modal.showModal = false; + }) + .catch((error) => { + if (error.name === 'ValidationException') { + for (let v of error.violations) { + this.errors.push(v); + } + } else { + this.errors.push('An error occurred'); } - ); + }) }; }, submitNewAddress(payload) { - console.log('submitNewAddress', payload); this.selected.addressId = payload.addressId; this.addAddress.context.addressId = payload.addressId; this.addAddress.context.edit = true; diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/index.js b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/index.js index 66657df47..b7a5c791b 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/index.js +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/index.js @@ -12,7 +12,11 @@ const hasLocation = document.querySelector('#location') !== null; const hasPerson = document.querySelector('#add-persons') !== null; const app = createApp({ - template: ``, + template: ``, data() { return { hasSocialIssues, diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js index 4bf70b006..f94381fc2 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js @@ -240,6 +240,9 @@ const store = createStore({ }); commit("updateActionsSelected", payload); }, + addAvailableLocationGroup({ commit }, payload) { + commit("addAvailableLocationGroup", payload); + }, addPersonsInvolved({ commit }, payload) { //console.log('### action addPersonsInvolved', payload.result.type); switch (payload.result.type) { diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig index 70280d714..33575cea6 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig @@ -8,6 +8,7 @@ action: 'show', displayBadge: true, targetEntity: { name: type, id: entity.id }, buttonText: entity|chill_entity_render_string, + isDead: entity.deathdate is not null, parent: parent } %} {% endmacro %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig index 5ad95c327..b278c0300 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig @@ -15,7 +15,7 @@ {% block js %} {{ parent() }} - {{ encore_entry_link_tags('mod_async_upload') }} + {{ encore_entry_script_tags('mod_async_upload') }}
- {{ $t('activity.errors') }} -