diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss index 68bbe2afc..cd57ba3cd 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss @@ -94,8 +94,8 @@ section.chill-entity { } span.address-valid { - &.address-since {} - &.address-until {} + &.date-since {} + &.date-until {} } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue index a820c253d..c6a2ed8c8 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue @@ -1,10 +1,28 @@ @@ -23,35 +41,45 @@ export default { edit: window.mode === 'edit', personId: window.personId, addressId: window.addressId, - backUrl: `/fr/person/${window.personId}/address/list`, //TODO better way to pass this - validFrom: new Date().toISOString().split('T')[0] + backUrl: window.backUrl, }, addAddress: { - key: 'person', options: { - /// Options override default - - /// First button text if create or edit address (trans chain, see i18n) - //textButton: { create: 'bim', edit: 'bam' }, + /// Options override default. + /// null value take default component value + button: { + text: { + /// if create or edit address + create: window.buttonText || null, + edit: window.buttonText || null + }, + type: window.button.type || null, + size: window.button.size || null, + display: window.button.display + }, /// Modal title text if create or edit address (trans chain, see i18n) - //title: { create: 'boum', edit: 'pan' }, - + title: { + create: window.modalTitle || null, + edit: window.modalTitle || null + }, /// Display each step in page or Modal - //bindModal: { step1: false, step2: false } //TODO true-false must not be possible - } + bindModal: { + step1: window.binModalStep1, + step2: window.binModalStep2 + }, + // Options only for root parent component + displayResult: true, + redirectToBackUrl: true + }, + type: 'person', + result: null // <== returned from addAddress component } } }, methods: { - submitAddress({ submited, flag }) { - console.log('@@@ CLICK button submitAddress'); - - console.log('address to post:', submited); - console.log('datas by refs: ', this.$refs.addAddress.entity.address.text); - - this.$refs.addAddress.initForm(); // to cast child method - flag.showPane = false; + displayErrors() { + return this.$refs.addAddress.errorMsg; } } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue index fc38f630b..be5e7038a 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue @@ -2,17 +2,19 @@ + @@ -36,7 +39,7 @@ {{ $t('action.edit')}} @@ -51,18 +54,20 @@ v-bind:default="this.default" v-bind:entity="this.entity" v-bind:flag="this.flag" + ref="showAddress" v-bind:insideModal="false" @openEditPane="openEditPane" - @submitAddress="$emit('submitAddress', { getSubmited , flag })"> + @submitAddress="submitAddress"> +