From 14a9d9c7394e7b210cccc332cc46315d3c8c4107 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 4 Jun 2021 08:48:08 +0200 Subject: [PATCH 01/58] address-household: address move (WIP) --- .../Controller/HouseholdController.php | 35 ++++++++++++++++++- .../views/Household/address_move.html.twig | 24 +++++++++++-- 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php index 14ee42669..dd3cc16a7 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php @@ -8,6 +8,8 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Chill\PersonBundle\Entity\Household\Household; +use Chill\MainBundle\Form\Type\AddressType; +use Chill\MainBundle\Entity\Address; /** * @Route("/{_locale}/person/household") @@ -68,6 +70,30 @@ class HouseholdController extends AbstractController ); } + + /** + * + * @param Household $household + * @param Address $address + * @return \Symfony\Component\Form\Form + */ + protected function createCreateForm(Household $household, Address $address) + { + $form = $this->createForm(AddressType::class, $address, array( + 'method' => 'POST', + 'action' => $this->generateUrl('chill_person_address_create', array( + 'person_id' => $household->getId() + )), + 'has_no_address' => true + )); + + $form->add('submit', SubmitType::class, array( + 'label' => 'Submit' + )); + + return $form; + } + /** * @Route( * "/{household_id}/address/move", @@ -79,9 +105,16 @@ class HouseholdController extends AbstractController public function addressMove(Request $request, Household $household) { // TODO ACL + + + $address = new HouseholdAddress(); + + $form = $this->createCreateForm($household, $address); + return $this->render('@ChillPerson/Household/address_move.html.twig', [ - 'household' => $household + 'household' => $household, + 'form' => $form->createView() ] ); } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig index 755ad8acf..2e218b1a6 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig @@ -3,9 +3,29 @@ {% block title 'Move household'|trans %} {% block content %} -

{{ block('title') }}

+

{{ block('title') }}

-

Household with id {{ household.id }}

+

Household with id {{ household.id }}

+ +
+

Select an existing address

+ TODO: select of existing address !? +
+ +
+

Create a new address

+
+ + +
+ + {% block stylesheets %} + + {% endblock %} + + {% block js %} + {{ encore_entry_script_tags('address') }} + {% endblock %} {% endblock %} From 7b67ef5db2ed03175edf7f0f3238b78dcf08f2a9 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 4 Jun 2021 12:13:15 +0200 Subject: [PATCH 02/58] household address: add household api entry point --- .../ChillPersonExtension.php | 55 +++++++++++++------ 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index a28887c68..776d53780 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -202,7 +202,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'workflows' => [ 'accompanying_period_lifecycle' => [ 'type' => 'state_machine', - 'audit_trail' => [ + 'audit_trail' => [ 'enabled' => true ], 'marking_store' => [ @@ -355,15 +355,15 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'controller' => \Chill\PersonBundle\Controller\AccompanyingCourseApiController::class, 'actions' => [ '_entity' => [ - 'roles' => [ + 'roles' => [ Request::METHOD_GET => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, Request::METHOD_PATCH => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, Request::METHOD_PUT => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, ], 'methods' => [ - Request::METHOD_GET => true, - Request::METHOD_PUT => true, - Request::METHOD_PATCH => true, + Request::METHOD_GET => true, + Request::METHOD_PUT => true, + Request::METHOD_PATCH => true, ] ], 'participation' => [ @@ -380,61 +380,61 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], 'resource' => [ 'methods' => [ - Request::METHOD_POST => true, + Request::METHOD_POST => true, Request::METHOD_DELETE => true, Request::METHOD_GET => false, Request::METHOD_HEAD => false, ], - 'roles' => [ + 'roles' => [ Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, Request::METHOD_DELETE=> \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE ] ], 'comment' => [ 'methods' => [ - Request::METHOD_POST => true, + Request::METHOD_POST => true, Request::METHOD_DELETE => true, Request::METHOD_GET => false, Request::METHOD_HEAD => false, ], - 'roles' => [ + 'roles' => [ Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, Request::METHOD_DELETE=> \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE ] ], 'requestor' => [ 'methods' => [ - Request::METHOD_POST => true, + Request::METHOD_POST => true, Request::METHOD_DELETE => true, Request::METHOD_GET => false, Request::METHOD_HEAD => false, ], - 'roles' => [ + 'roles' => [ Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, Request::METHOD_DELETE=> \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE ] ], 'scope' => [ 'methods' => [ - Request::METHOD_POST => true, + Request::METHOD_POST => true, Request::METHOD_DELETE => true, Request::METHOD_GET => false, Request::METHOD_HEAD => false, ], - 'roles' => [ + 'roles' => [ Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, Request::METHOD_DELETE=> \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE ] ], 'socialissue' => [ 'methods' => [ - Request::METHOD_POST => true, + Request::METHOD_POST => true, Request::METHOD_DELETE => true, Request::METHOD_GET => false, Request::METHOD_HEAD => false, ], 'controller_action' => 'socialIssueApi', - 'roles' => [ + 'roles' => [ Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, Request::METHOD_DELETE=> \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE ] @@ -442,11 +442,11 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'confirm' => [ 'methods' => [ - Request::METHOD_POST => true, + Request::METHOD_POST => true, Request::METHOD_GET => false, Request::METHOD_HEAD => false, ], - 'roles' => [ + 'roles' => [ Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, ] ], @@ -515,6 +515,27 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ] ], + [ + 'class' => \Chill\PersonBundle\Entity\Household::class, + 'name' => 'household', + 'base_path' => '/api/1.0/person/household', + 'base_role' => 'ROLE_USER', + 'actions' => [ + '_index' => [ + 'methods' => [ + Request::METHOD_GET => true, + Request::METHOD_HEAD => true, + Request::METHOD_POST=> true, + ], + ], + '_entity' => [ + 'methods' => [ + Request::METHOD_GET => true, + Request::METHOD_HEAD => true + ] + ], + ] + ], ] ]); } From 878ee5d9c7fcf0279c6b3f6d02534ea49159b9cc Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 4 Jun 2021 12:34:44 +0200 Subject: [PATCH 03/58] household address: correct household api entry point --- .../DependencyInjection/ChillPersonExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index 776d53780..5f80018b7 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -516,7 +516,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ] ], [ - 'class' => \Chill\PersonBundle\Entity\Household::class, + 'class' => \Chill\PersonBundle\Entity\Household\Household::class, 'name' => 'household', 'base_path' => '/api/1.0/person/household', 'base_role' => 'ROLE_USER', From 7e1b7b7e9ffd9972a1bc9d7eddbf611da7d22443 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 4 Jun 2021 14:50:51 +0200 Subject: [PATCH 04/58] household address: init vue component for household address --- .../Controller/HouseholdController.php | 33 +---------- .../public/vuejs/HouseholdAddress/App.vue | 56 +++++++++++++++++++ .../public/vuejs/HouseholdAddress/index.js | 25 +++++++++ .../public/vuejs/HouseholdAddress/js/i18n.js | 12 ++++ .../vuejs/HouseholdAddress/store/index.js | 41 ++++++++++++++ .../views/Household/address_move.html.twig | 13 ++++- .../ChillPersonBundle/chill.webpack.config.js | 3 +- 7 files changed, 147 insertions(+), 36 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue create mode 100644 src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/index.js create mode 100644 src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/js/i18n.js create mode 100644 src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php index dd3cc16a7..994e2757c 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php @@ -8,8 +8,6 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Chill\PersonBundle\Entity\Household\Household; -use Chill\MainBundle\Form\Type\AddressType; -use Chill\MainBundle\Entity\Address; /** * @Route("/{_locale}/person/household") @@ -71,29 +69,6 @@ class HouseholdController extends AbstractController } - /** - * - * @param Household $household - * @param Address $address - * @return \Symfony\Component\Form\Form - */ - protected function createCreateForm(Household $household, Address $address) - { - $form = $this->createForm(AddressType::class, $address, array( - 'method' => 'POST', - 'action' => $this->generateUrl('chill_person_address_create', array( - 'person_id' => $household->getId() - )), - 'has_no_address' => true - )); - - $form->add('submit', SubmitType::class, array( - 'label' => 'Submit' - )); - - return $form; - } - /** * @Route( * "/{household_id}/address/move", @@ -106,15 +81,9 @@ class HouseholdController extends AbstractController { // TODO ACL - - $address = new HouseholdAddress(); - - $form = $this->createCreateForm($household, $address); - return $this->render('@ChillPerson/Household/address_move.html.twig', [ - 'household' => $household, - 'form' => $form->createView() + 'household' => $household ] ); } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue new file mode 100644 index 000000000..ba0cd5e13 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue @@ -0,0 +1,56 @@ + + + + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/index.js new file mode 100644 index 000000000..e7a73238d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/index.js @@ -0,0 +1,25 @@ +import { createApp } from 'vue' +import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n' +import { appMessages } from './js/i18n' +import { store } from './store' + +import App from './App.vue'; + +const root = window.vueRootComponent; + +/* +* Load all App component, for Household edition page +*/ + +const i18n = _createI18n(appMessages); + +const app = createApp({ + template: ``, +}) +.use(store) +.use(i18n) +.component('app', App) +.mount('#household-address'); + + + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/js/i18n.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/js/i18n.js new file mode 100644 index 000000000..d6af41eea --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/js/i18n.js @@ -0,0 +1,12 @@ +import { addressMessages } from 'ChillMainAssets/vuejs/Address/js/i18n' + +const appMessages = { + fr: { + } +}; + +Object.assign(appMessages.fr, addressMessages.fr); + +export { + appMessages +}; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js new file mode 100644 index 000000000..b70d09cc9 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js @@ -0,0 +1,41 @@ +import 'es6-promise/auto'; +import { createStore } from 'vuex'; + +import { postAddress } from 'ChillMainAssets/vuejs/_api/AddAddress' + +const debug = process.env.NODE_ENV !== 'production'; + +const store = createStore({ + strict: debug, + state: { + address: {}, + errorMsg: [] + }, + getters: { + }, + mutations: { + catchError(state, error) { + state.errorMsg.push(error); + }, + addAddress(state, address) { + console.log('@M addAddress address', address); + state.address = address; + } + }, + actions: { + addAddress({ commit }, payload) { + console.log('@A addAddress payload', payload); + + postAddress(payload) + .then(address => new Promise((resolve, reject) => { + commit('addAddress', address); + resolve(); + })) + .catch((error) => { + commit('catchError', error); + }); + } + } +}); + +export { store }; diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig index 2e218b1a6..b9c16dab4 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig @@ -9,14 +9,17 @@

Select an existing address

- TODO: select of existing address !? + TODO: select of existing address ?

Create a new address

+
- +
+

Add the address to the household

+
{% block stylesheets %} @@ -24,7 +27,11 @@ {% endblock %} {% block js %} - {{ encore_entry_script_tags('address') }} + + {{ encore_entry_script_tags('household_address') }} {% endblock %} diff --git a/src/Bundle/ChillPersonBundle/chill.webpack.config.js b/src/Bundle/ChillPersonBundle/chill.webpack.config.js index 53aed5d91..9561f7488 100644 --- a/src/Bundle/ChillPersonBundle/chill.webpack.config.js +++ b/src/Bundle/ChillPersonBundle/chill.webpack.config.js @@ -7,6 +7,7 @@ module.exports = function(encore, entries) encore.addAliases({ ChillPersonAssets: __dirname + '/Resources/public' }); - + encore.addEntry('accompanying_course', __dirname + '/Resources/public/vuejs/AccompanyingCourse/index.js'); + encore.addEntry('household_address', __dirname + '/Resources/public/vuejs/HouseholdAddress/index.js'); }; From aff140230c7b5c8abcc0cb3411920e93bdabe597 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 4 Jun 2021 15:38:28 +0200 Subject: [PATCH 05/58] household address: add a button for posting to household --- .../public/vuejs/HouseholdAddress/App.vue | 20 +++++++++++- .../public/vuejs/HouseholdAddress/api.js | 19 ++++++++++++ .../components/AddAddressToHousehold.vue | 31 +++++++++++++++++++ .../vuejs/HouseholdAddress/store/index.js | 20 +++++++++++- 4 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/api.js create mode 100644 src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/components/AddAddressToHousehold.vue diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue index ba0cd5e13..f10cef9fa 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue @@ -8,20 +8,31 @@ + + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js index b70d09cc9..46cd906e4 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js @@ -1,7 +1,8 @@ import 'es6-promise/auto'; import { createStore } from 'vuex'; -import { postAddress } from 'ChillMainAssets/vuejs/_api/AddAddress' +import { postAddress } from 'ChillMainAssets/vuejs/_api/AddAddress'; +import { postAddressToHousehold } from '../api'; const debug = process.env.NODE_ENV !== 'production'; @@ -9,6 +10,7 @@ const store = createStore({ strict: debug, state: { address: {}, + household: {}, errorMsg: [] }, getters: { @@ -20,6 +22,10 @@ const store = createStore({ addAddress(state, address) { console.log('@M addAddress address', address); state.address = address; + }, + addAddressToHousehold(state, household) { + console.log('@M addAddress address', household); + state.household = household; } }, actions: { @@ -34,6 +40,18 @@ const store = createStore({ .catch((error) => { commit('catchError', error); }); + }, + addAddressToHousehold({ commit }, payload) { + console.log('@A addAddressToHousehold payload', payload); + + postAddressToHousehold(payload) + .then(household => new Promise((resolve, reject) => { + commit('addAddressToHousehold', household); + resolve(); + })) + .catch((error) => { + commit('catchError', error); + }); } } }); From d513be2fcecea3595f1fb648a02fea59849c5e42 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 4 Jun 2021 16:23:13 +0200 Subject: [PATCH 06/58] household address: post address to household (WIP) --- .../public/vuejs/HouseholdAddress/App.vue | 25 +++++++++++-------- .../public/vuejs/HouseholdAddress/api.js | 4 ++- .../components/AddAddressToHousehold.vue | 4 +-- .../vuejs/HouseholdAddress/store/index.js | 2 +- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue index f10cef9fa..f08085ce5 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue @@ -11,7 +11,7 @@ - @@ -19,7 +19,7 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js index c563b6ce8..26286fd10 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js @@ -44,7 +44,7 @@ const store = createStore({ addAddressToHousehold({ commit }, payload) { console.log('@A addAddressToHousehold payload', payload); - postAddressToHousehold(payload.householdId, payload.address) + postAddressToHousehold(payload.householdId, payload.addressId) .then(household => new Promise((resolve, reject) => { commit('addAddressToHousehold', household); resolve(); From 2b5ed5e5a34cefc570ebbc4dfa1912c2c91c3ba1 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 7 Jun 2021 12:18:03 +0200 Subject: [PATCH 08/58] household address: choose among available address --- .../Resources/public/vuejs/_api/AddAddress.js | 18 +++- .../public/vuejs/HouseholdAddress/App.vue | 83 +++++++++++++++---- .../components/SelectHouseholdAddress.vue | 47 +++++++++++ .../public/vuejs/HouseholdAddress/js/i18n.js | 3 + .../vuejs/HouseholdAddress/store/index.js | 4 +- .../views/Household/address_move.html.twig | 11 --- 6 files changed, 134 insertions(+), 32 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/components/SelectHouseholdAddress.vue diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_api/AddAddress.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_api/AddAddress.js index db03da860..383ffb25f 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_api/AddAddress.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_api/AddAddress.js @@ -36,7 +36,6 @@ const fetchCities = (country) => { */ const fetchReferenceAddresses = (postalCode) => { console.log('<<< fetching references addresses for', postalCode); - //TODO deal with huge number of addresses... we should do suggestion... const url = `/api/1.0/main/address-reference.json?item_per_page=1000&postal_code=${postalCode.id}`; return fetch(url) .then(response => { @@ -45,6 +44,22 @@ const fetchReferenceAddresses = (postalCode) => { }); }; +/* +* Endpoint chill_api_single_address_reference__index +* method GET, get AddressReference Object +* @returns {Promise} a promise containing all AddressReference objects filtered with postal code +*/ +const fetchAddresses = () => { + console.log('<<< fetching addresses'); + //TODO deal with huge number of addresses... we should do suggestion... + const url = `/api/1.0/main/address.json?item_per_page=1000`; + return fetch(url) + .then(response => { + if (response.ok) { return response.json(); } + throw Error('Error with request resource response'); + }); +}; + /* * Endpoint chill_api_single_address__entity__create * method POST, post Address Object @@ -71,5 +86,6 @@ export { fetchCountries, fetchCities, fetchReferenceAddresses, + fetchAddresses, postAddress }; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue index 4aa7ccc54..9b8985f06 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue @@ -1,42 +1,84 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/components/SelectHouseholdAddress.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/components/SelectHouseholdAddress.vue new file mode 100644 index 000000000..74ce14c3c --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/components/SelectHouseholdAddress.vue @@ -0,0 +1,47 @@ + + + + + + + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/js/i18n.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/js/i18n.js index d6af41eea..3dae35221 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/js/i18n.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/js/i18n.js @@ -2,6 +2,9 @@ import { addressMessages } from 'ChillMainAssets/vuejs/Address/js/i18n' const appMessages = { fr: { + select_a_existing_address: 'Sélectionner une adresse existante', + create_a_new_address: 'Créer une nouvelle adresse', + add_an_address_to_household: 'Ajouter l\'adresse au ménage' } }; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js index 26286fd10..93f75c5c4 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/store/index.js @@ -9,7 +9,7 @@ const debug = process.env.NODE_ENV !== 'production'; const store = createStore({ strict: debug, state: { - address: {}, + newAddress: {}, household: {}, errorMsg: [] }, @@ -21,7 +21,7 @@ const store = createStore({ }, addAddress(state, address) { console.log('@M addAddress address', address); - state.address = address; + state.newAddress = address; }, addAddressToHousehold(state, household) { console.log('@M addAddress address', household); diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig index b9c16dab4..7ef4854bb 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig @@ -8,17 +8,6 @@

Household with id {{ household.id }}

-

Select an existing address

- TODO: select of existing address ? -
- -
-

Create a new address

-
-
- -
-

Add the address to the household

From 6d20476b812b417de7a701d509ecf9d81a3fa9a7 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 7 Jun 2021 14:24:03 +0200 Subject: [PATCH 09/58] household address: household address history (WIP) --- .../Resources/views/Household/addresses.html.twig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig index aa0aa443b..583da5558 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig @@ -7,7 +7,17 @@

Household with id {{ household.id }}

- +{{ household.addresses|length }} + +{% for address in household.addresses %} +
+ {{ address.id }} +
+{% endfor %} + + +
{{ 'Move household'|trans }} From 5ee824d1c26313e0b1a2d8836166e61657f76e1c Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 7 Jun 2021 14:47:22 +0200 Subject: [PATCH 10/58] household address: define a custom household-address API point (WIP) --- .../Controller/HouseholdApiController.php | 18 ++++++++++++++++++ .../ChillPersonExtension.php | 14 ++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php new file mode 100644 index 000000000..67f70db40 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php @@ -0,0 +1,18 @@ +addRemoveSomething('address', $id, $request, $_format, 'address', Address::class, [ 'groups' => [ 'read' ] ]); + } + +} diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index a511e0707..a3c03a7d5 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -517,6 +517,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], [ 'class' => \Chill\PersonBundle\Entity\Household\Household::class, + 'controller' => \Chill\PersonBundle\Controller\HouseholdApiController::class, 'name' => 'household', 'base_path' => '/api/1.0/person/household', 'base_role' => 'ROLE_USER', @@ -534,6 +535,19 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_POST=> true, ] ], + 'address' => [ + 'methods' => [ + Request::METHOD_POST => true, + Request::METHOD_DELETE => true, + Request::METHOD_GET => false, + Request::METHOD_HEAD => false, + ], + 'controller_action' => 'householdAddressApi', + 'roles' => [ + Request::METHOD_POST => true, //TODO + Request::METHOD_DELETE => true //TODO + ] + ], ] ], ] From 6c126b058160c1e44d9dee014c1c17a488b06a21 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 7 Jun 2021 15:13:45 +0200 Subject: [PATCH 11/58] household address: api POST on address for household (WIP) --- .../DependencyInjection/ChillPersonExtension.php | 4 ++-- src/Bundle/ChillPersonBundle/Entity/Household/Household.php | 5 +++-- .../Resources/public/vuejs/HouseholdAddress/api.js | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index a3c03a7d5..cfff3d12e 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -544,8 +544,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], 'controller_action' => 'householdAddressApi', 'roles' => [ - Request::METHOD_POST => true, //TODO - Request::METHOD_DELETE => true //TODO + Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE, + Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE ] ], ] diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php index f95b177f9..6caafde3e 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php @@ -24,7 +24,7 @@ class Household * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") - * @Serializer\Groups({"read"}) + * @Serializer\Groups({"write"}) */ private ?int $id = null; @@ -36,6 +36,7 @@ class Household * cascade={"persist", "remove", "merge", "detach"}) * @ORM\JoinTable(name="chill_person_household_to_addresses") * @ORM\OrderBy({"validFrom" = "DESC"}) + * @Serializer\Groups({"write"}) */ private Collection $addresses; @@ -44,7 +45,7 @@ class Household * targetEntity=HouseholdMember::class, * mappedBy="household" * ) - * @Serializer\Groups({"read"}) + * @Serializer\Groups({"write"}) */ private Collection $members; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/api.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/api.js index 0c8d4cde6..0c78e5bbd 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/api.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/api.js @@ -9,7 +9,7 @@ export const postAddressToHousehold = (householdId, addressId) => { console.log(householdId); console.log(addressId); const body = {'address': addressId}; - const url = `/api/1.0/person/household/${householdId}.json` + const url = `/api/1.0/person/household/${householdId}/address.json` return fetch(url, { method: 'POST', headers: {'Content-Type': 'application/json;charset=utf-8'}, From f39fe05dd5eedd748187e0e11affdc91846866fd Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 7 Jun 2021 15:26:24 +0200 Subject: [PATCH 12/58] household address: rely on ROLE_USER for household address api point role --- .../DependencyInjection/ChillPersonExtension.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index cfff3d12e..d47edc287 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -542,11 +542,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_GET => false, Request::METHOD_HEAD => false, ], - 'controller_action' => 'householdAddressApi', - 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE, - Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE - ] + 'controller_action' => 'householdAddressApi' ], ] ], From 03a7ec389b0117d12d63da794b9d8325bc67d2b7 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 7 Jun 2021 16:54:16 +0200 Subject: [PATCH 13/58] household address: fix POST household address --- .../Resources/public/vuejs/HouseholdAddress/api.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/api.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/api.js index 0c78e5bbd..2ec87d87e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/api.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/api.js @@ -8,7 +8,9 @@ export const postAddressToHousehold = (householdId, addressId) => { console.log(householdId); console.log(addressId); - const body = {'address': addressId}; + const body = { + 'id': addressId + }; const url = `/api/1.0/person/household/${householdId}/address.json` return fetch(url, { method: 'POST', From 63c3b5a970a2dec485d061e82d88f8b87a0053b4 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 7 Jun 2021 17:24:31 +0200 Subject: [PATCH 14/58] address: add swagger doc on API point for address --- .../ChillMainBundle/chill.api.specs.yaml | 48 ++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/chill.api.specs.yaml b/src/Bundle/ChillMainBundle/chill.api.specs.yaml index 68a3eb764..8eb266d71 100644 --- a/src/Bundle/ChillMainBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillMainBundle/chill.api.specs.yaml @@ -17,6 +17,19 @@ components: type: integer name: type: string + Address: + type: object + properties: + address_id: + type: integer + text: + type: string + postcode: + type: object + properties: + name: + type: string + paths: /1.0/search.json: @@ -29,7 +42,7 @@ paths: description: > **Warning**: This is currently a stub (not really implemented - The search is performed across multiple entities. The entities must be listed into + The search is performed across multiple entities. The entities must be listed into `type` parameters. The results are ordered by relevance, from the most to the lowest relevant. @@ -56,3 +69,36 @@ paths: 200: description: "OK" + /1.0/main/address.json: + get: + tags: + - address + summary: Return a list of all Chill addresses + responses: + 200: + description: "ok" + /1.0/main/address/{id}.json: + get: + tags: + - address + summary: Return an address by id + parameters: + - name: id + in: path + required: true + description: The address id + schema: + type: integer + format: integer + minimum: 1 + responses: + 200: + description: "ok" + content: + application/json: + schema: + $ref: '#/components/schemas/Address' + 404: + description: "not found" + 401: + description: "Unauthorized" From 9d32ccbcadea32694a288878ca2c68fa5ab98532 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 8 Jun 2021 08:30:54 +0200 Subject: [PATCH 15/58] address: swagger config for documenting API points --- .../ChillMainBundle/chill.api.specs.yaml | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) diff --git a/src/Bundle/ChillMainBundle/chill.api.specs.yaml b/src/Bundle/ChillMainBundle/chill.api.specs.yaml index 8eb266d71..6a43686b0 100644 --- a/src/Bundle/ChillMainBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillMainBundle/chill.api.specs.yaml @@ -30,6 +30,80 @@ components: name: type: string + Country: + type: object + properties: + id: + type: integer + name: + type: object + countryCode: + type: string + + PostalCode: + type: object + properties: + id: + type: integer + name: + type: string + code: + type: string + country: + type: object + properties: + id: + type: integer + name: + type: object + countryCode: + type: string + + AddressReference: + type: object + properties: + id: + type: integer + refId: + type: string + street: + type: string + streetNumber: + type: string + postcode: + type: object + properties: + id: + type: integer + name: + type: string + code: + type: string + country: + type: object + properties: + id: + type: integer + name: + type: object + countryCode: + type: string + municipalityCode: + type: string + source: + type: string + point: + type: object + properties: + type: + type: string + coordinates: + type: array + items: + type: number + minItems: 2 + maxItems: 2 + paths: /1.0/search.json: @@ -102,3 +176,119 @@ paths: description: "not found" 401: description: "Unauthorized" + + /1.0/main/address-reference.json: + get: + tags: + - address + summary: Return a list of all reference addresses + parameters: + - in: query + name: postal_code + required: false + schema: + type: integer + description: The id of a postal code to filter the reference addresses + responses: + 200: + description: "ok" + /1.0/main/address-reference/{id}.json: + get: + tags: + - address + summary: Return a reference address by id + parameters: + - name: id + in: path + required: true + description: The reference address id + schema: + type: integer + format: integer + minimum: 1 + responses: + 200: + description: "ok" + content: + application/json: + schema: + $ref: '#/components/schemas/AddressReference' + 404: + description: "not found" + 401: + description: "Unauthorized" + + /1.0/main/postal-code.json: + get: + tags: + - address + summary: Return a list of all postal-code + parameters: + - in: query + name: country + required: false + schema: + type: integer + description: The id of a country to filter the postal code + responses: + 200: + description: "ok" + /1.0/main/postal-code/{id}.json: + get: + tags: + - address + summary: Return a postal code by id + parameters: + - name: id + in: path + required: true + description: The postal code id + schema: + type: integer + format: integer + minimum: 1 + responses: + 200: + description: "ok" + content: + application/json: + schema: + $ref: '#/components/schemas/PostalCode' + 404: + description: "not found" + 401: + description: "Unauthorized" + + /1.0/main/country.json: + get: + tags: + - address + summary: Return a list of all countries + responses: + 200: + description: "ok" + /1.0/main/country/{id}.json: + get: + tags: + - address + summary: Return a country by id + parameters: + - name: id + in: path + required: true + description: The country id + schema: + type: integer + format: integer + minimum: 1 + responses: + 200: + description: "ok" + content: + application/json: + schema: + $ref: '#/components/schemas/Country' + 404: + description: "not found" + 401: + description: "Unauthorized" From 66b54bad317402250cac96c765406f9540a6b126 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 8 Jun 2021 08:55:41 +0200 Subject: [PATCH 16/58] household address: add swagger documentation --- .../ChillPersonBundle/chill.api.specs.yaml | 84 +++++++++++++++++-- 1 file changed, 77 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml index 0fac8e6ce..94d7fb98e 100644 --- a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml @@ -179,7 +179,7 @@ components: readOnly: true children_ids: type: array - items: + items: type: integer readOnly: true title: @@ -210,7 +210,7 @@ components: type: string enum: - 'household_position' - + paths: /1.0/person/person/{id}.json: @@ -259,10 +259,10 @@ paths: description: "Unauthorized" 422: description: "Invalid data: the data is a valid json, could be deserialized, but does not pass validation" - + /1.0/person/social-work/social-issue.json: get: - tags: + tags: - social-issue summary: Return a list of social work responses: @@ -270,7 +270,7 @@ paths: description: "ok" /1.0/person/social-work/social-issue/{id}.json: get: - tags: + tags: - social-issue summary: Return a social issue by id parameters: @@ -424,7 +424,7 @@ paths: description: "OK" 422: description: "object with validation errors" - + /1.0/person/accompanying-course/{id}/participation.json: post: tags: @@ -784,6 +784,41 @@ paths: 400: description: "transition cannot be applyed" + /1.0/person/household.json: + get: + tags: + - household + summary: Return a list of all household + responses: + 200: + description: "ok" + + /1.0/person/household/{id}.json: + get: + tags: + - household + summary: Return a household by id + parameters: + - name: id + in: path + required: true + description: The household id + schema: + type: integer + format: integer + minimum: 1 + responses: + 200: + description: "ok" + content: + application/json: + schema: + $ref: '#/components/schemas/Household' + 404: + description: "not found" + 401: + description: "Unauthorized" + /1.0/person/household/members/move.json: post: tags: @@ -825,4 +860,39 @@ paths: description: "Unprocessable entity (validation errors)" 400: description: "transition cannot be applyed" - + + /1.0/person/household/{id}/address.json: + post: + tags: + - household + summary: post an address to a household + parameters: + - name: id + in: path + required: true + description: The household id + schema: + type: integer + format: integer + minimum: 1 + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + id: + type: integer + description: The address id to attach to the household + responses: + 401: + description: "Unauthorized" + 404: + description: "Not found" + 200: + description: "OK" + 422: + description: "Unprocessable entity (validation errors)" + 400: + description: "transition cannot be applyed" From 7d13bc7cfe0bd0dfba42d19626329c2b6823e5ec Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 8 Jun 2021 11:35:33 +0200 Subject: [PATCH 17/58] household address: address history (twig + css) --- .../Resources/public/scss/chillmain.scss | 69 +++++++++++++++++++ .../views/Household/addresses.html.twig | 59 ++++++++++++---- 2 files changed, 116 insertions(+), 12 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/scss/chillmain.scss b/src/Bundle/ChillMainBundle/Resources/public/scss/chillmain.scss index 2eb1f9bc7..cc3f150d4 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/scss/chillmain.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/scss/chillmain.scss @@ -261,3 +261,72 @@ div.address_form { +/* + * HOUSEHOLD + */ + + div.household { + div.household__address { + div.row { + height: 100px; + width: 100%; + position: relative; + & > div { + position: absolute; + display: table; + height: 100%; + border: 1px dotted #c3c3c3; + } + div.household__address--date { + width: 30%; + background-color: #c3c3c3; + height: 100%; + div.cell { + box-sizing: border-box; + position: relative; + height: 100%; + width: 100%; + margin-left: 50%; + div.pill { + position: absolute; + box-sizing: border-box; + width: 120px; + height: 40px; + bottom: -20px; + background-color: white; + padding: 10px; + border-radius: 30px; + left: -60px; + text-align: center; + z-index: 10; + } + } + } + div.household__address--content { + width: 70%; + left: 30%; + text-align: left; + background-color: #ececec; + border: 1px solid #888; + div.cell { + display: table-cell; + padding: 5px 30px; + vertical-align: middle; + i.dot::before, i.dot::after { + position: absolute; + width: 20px; + height: 20px; + content: ''; + border: 0; + background-color: white; + border-radius: 50%; + border: 5px solid #c3c3c3; + z-index: 10; + left: -15px; + bottom: -15px; + } + } + } + } + } + } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig index 583da5558..93f1d99ee 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig @@ -4,22 +4,57 @@ {% block content %}

{{ block('title') }}

+
-

Household with id {{ household.id }}

+

Household with id {{ household.id }}

-
-{{ household.addresses|length }} +
-{% for address in household.addresses %} -
- {{ address.id }} + {% for address in household.addresses %} +
+
+
+
+ {% if address.validFrom is not empty %} + {{ address.validFrom|format_date('long') }} + {% endif %} +
+
+
+
+
+ + {% if address.isNoAddress == true %} +
{{ 'address.consider homeless'|trans }}
+ {% else %} + {% if address.street is not empty %} +
+ {{ address.id }} + + {{ address.street }} + {% if address.streetNumber is not empty %} + , {{ address.streetNumber }} + {% endif %} +
+ {% endif %} + {% if address.postCode is not empty %} +
+ {{ address.postCode.code }} {{ address.postCode.name }} + ({{ address.postCode.country.name|localize_translatable_string }}) +
+ {% endif %} + {% endif %} +
+
+
+ {% endfor %}
-{% endfor %} + + + {{ 'Move household'|trans }} + +
- - {{ 'Move household'|trans }} - - {% endblock %} From 76d945f2a7b3fa15dbb880f2f828e7b3a1fe55bb Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 8 Jun 2021 11:51:30 +0200 Subject: [PATCH 18/58] household address: address history : add button --- .../views/Household/addresses.html.twig | 21 ++++++++++++------- .../translations/messages.fr.yml | 3 +++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig index 93f1d99ee..2cb2c8465 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig @@ -10,7 +10,19 @@
- {% for address in household.addresses %} + + + {% for address in household.addresses %}
@@ -47,14 +59,9 @@
- {% endfor %} + {% endfor %}
- - {{ 'Move household'|trans }} - -
{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index e9befc441..1c9099f69 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -317,3 +317,6 @@ Show Accompanying Course: Voir le parcours Edit Accompanying Course: Modifier le parcours Create Accompanying Course: Créer un nouveau parcours Drop Accompanying Course: Supprimer le parcours + +# Household +Move household: Déménagement du ménage From 6a42edd460aa7df703507af0455a2a8b4c3c2cde Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 8 Jun 2021 17:06:03 +0200 Subject: [PATCH 19/58] household address: remove address selection --- .../public/vuejs/HouseholdAddress/App.vue | 42 +------------------ .../views/Household/address_move.html.twig | 2 - 2 files changed, 2 insertions(+), 42 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue index 9b8985f06..ca1f81d42 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdAddress/App.vue @@ -1,10 +1,4 @@