From a78f29cffc1e940caeeab6a294d48b752d84e292 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 1 Feb 2022 17:44:55 +0100 Subject: [PATCH 1/2] on the fly component: add returnPath when viewing --- .../public/vuejs/OnTheFly/components/OnTheFly.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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..c3522863c 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue @@ -160,7 +160,10 @@ export default { }, badgeType() { return 'entity-' + this.type + ' badge-' + this.type; - } + }, + getReturnPath() { + return `?returnPath=${window.location.pathname}${window.location.search}${window.location.hash}`; + }, }, watch: { canCloseModal: { @@ -217,9 +220,9 @@ export default { buildLocation(id, type) { if (type === 'person') { // TODO i18n - return `/fr/person/${id}/general`; + return encodeURI(`/fr/person/${id}/general${this.getReturnPath}`); } else if (type === 'thirdparty') { - return `/fr/3party/3party/${id}/view`; + return encodeURI(`/fr/3party/3party/${id}/view${this.getReturnPath}`); } } } From a83b0326d762d71142bdeb37b9f701a2f8d9a7a7 Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 2 Feb 2022 07:04:14 +0100 Subject: [PATCH 2/2] upd CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a198c0929..e7ca8f3ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to ## Unreleased +* [person] add a returnPath when clicking on some Person or ThirdParty badge (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/427) * 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