diff --git a/CHANGELOG.md b/CHANGELOG.md index 84dc079a3..5515ca751 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,14 +11,19 @@ and this project adheres to ## Unreleased +* [person] accompanying course work: fix on-the-fly update of thirdParty +* [on-the-fly] close modal only after validation +* [person] correct thirdparty PATCH url + add email and altnames in AddPerson and serializer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/433) * change order for accompanying course work list * [person]: style fix in parcours listing per person. (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/432) +* ajoute un ordre dans les localisation (api) * [pick entity]: fix translations in modal (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/419) ## Test releases ### test release 2021-02-01 +>>>>>>> master * renommer "dossier numéro" en "parcours numéro" dans les résultats de recherche * renomme date de début en date d'ouverture dans le formulaire parcours diff --git a/src/Bundle/ChillMainBundle/Controller/LocationApiController.php b/src/Bundle/ChillMainBundle/Controller/LocationApiController.php index 250d92980..2cf5caaf9 100644 --- a/src/Bundle/ChillMainBundle/Controller/LocationApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/LocationApiController.php @@ -12,6 +12,8 @@ declare(strict_types=1); namespace Chill\MainBundle\Controller; use Chill\MainBundle\CRUD\Controller\ApiController; +use Chill\MainBundle\Pagination\PaginatorInterface; +use Doctrine\ORM\QueryBuilder; use Symfony\Component\HttpFoundation\Request; /** @@ -19,7 +21,7 @@ use Symfony\Component\HttpFoundation\Request; */ class LocationApiController extends ApiController { - public function customizeQuery(string $action, Request $request, $query): void + protected function customizeQuery(string $action, Request $request, $query): void { $query ->leftJoin('e.locationType', 'lt') @@ -31,4 +33,14 @@ class LocationApiController extends ApiController ) ); } + + /** + * @param QueryBuilder $query + * @param mixed $_format + */ + protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) + { + return $query + ->addOrderBy('e.name', 'ASC'); + } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue index 116ed86c1..21f7a9c55 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue @@ -90,7 +90,7 @@ export default { OnTheFlyThirdparty, OnTheFlyCreate }, - props: ['type', 'id', 'action', 'buttonText', 'displayBadge', 'isDead', 'parent', 'canCloseModal'], + props: ['type', 'id', 'action', 'buttonText', 'displayBadge', 'isDead', 'parent'], emits: ['saveFormOnTheFly'], data() { return { @@ -162,16 +162,6 @@ export default { return 'entity-' + this.type + ' badge-' + this.type; } }, - watch: { - canCloseModal: { - handler: function(val, oldVal) { - if (val) { - this.closeModal(); - } - }, - deep: true - } - }, methods: { closeModal() { this.modal.showModal = false; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue index 2ed08ffc0..c9c7136c5 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue @@ -28,7 +28,7 @@
  • -
  • +
  • @@ -82,7 +82,7 @@ :id="resource.resource.id" action="edit" @saveFormOnTheFly="saveFormOnTheFly" - :canCloseModal="canCloseOnTheFlyModal"> + ref="onTheFly">
  • @@ -116,11 +116,6 @@ export default { }, props: ['resource'], emits: ['remove'], - data() { - return { - canCloseOnTheFlyModal: false - } - }, computed: { parent() { return { @@ -152,12 +147,14 @@ export default { if (payload.data.birthdate !== null) { body.birthdate = payload.data.birthdate; } body.phonenumber = payload.data.phonenumber; body.mobilenumber = payload.data.mobilenumber; + body.email = payload.data.email; + body.altNames = payload.data.altNames; body.gender = payload.data.gender; makeFetch('PATCH', `/api/1.0/person/person/${payload.data.id}.json`, body) .then(response => { this.$store.dispatch('addPerson', { target: payload.target, body: response }) - this.canCloseOnTheFlyModal = true; + this.$refs.onTheFly.closeModal(); }) .catch((error) => { if (error.name === 'ValidationException') { @@ -175,10 +172,10 @@ export default { body.telephone = payload.data.phonenumber; body.address = { id: payload.data.address.address_id }; - makeFetch('PATCH', `/api/1.0/third-party/third-party/${payload.data.id}.json`, body) + makeFetch('PATCH', `/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`, body) .then(response => { this.$store.dispatch('addThirdparty', { target: payload.target, body: response }) - this.canCloseOnTheFlyModal = true; + this.$refs.onTheFly.closeModal(); }) .catch((error) => { if (error.name === 'ValidationException') { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index f9d1a747c..34c0794fb 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -211,7 +211,7 @@