From 7ab57eba9a1d40dfb5facaf3fe23e9f48e1f42ad Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 16 Sep 2021 22:01:10 +0200 Subject: [PATCH] AddAddress: adding useDate.validFrom/validTo options --- .../vuejs/Address/components/AddAddress.vue | 20 ++++++++--- .../Address/components/ShowAddressPane.vue | 33 ++++++++++++++++--- .../Resources/public/vuejs/Address/i18n.js | 1 + .../Resources/public/vuejs/Address/index.js | 12 +++---- .../Address/_insert_vue_address.html.twig | 8 +++++ .../components/CourseLocation.vue | 5 ++- .../components/Household.vue | 5 ++- .../Resources/views/Address/new.html.twig | 2 ++ 8 files changed, 67 insertions(+), 19 deletions(-) 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 17e1a1a27..2a210e992 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue @@ -29,7 +29,6 @@ v-bind:options="this.options" v-bind:default="this.default" v-bind:entity="this.entity" - v-bind:valid="this.context.valid" v-bind:flag="this.flag" ref="showAddress"> @@ -55,7 +54,6 @@ v-bind:options="this.options" v-bind:default="this.default" v-bind:entity="this.entity" - v-bind:valid="this.context.valid" v-bind:flag="this.flag" v-bind:insideModal="false" @openEditPane="openEditPane" @@ -153,6 +151,10 @@ export default { step1: true, step2: true, }, + useDate: { + validFrom: false, + validTo: false + } }, entity: { address: {}, // <== loaded and returned @@ -173,6 +175,10 @@ export default { writeNew: { address: false, postcode: false + }, + valid: { + from: new Date(), + to: new Date() } }, addressMap: { @@ -187,9 +193,6 @@ export default { }, computed: { step1WithModal() { - //console.log('options displayText', this.options.button.displayText); - //console.log('options bindModal.step1', this.options.bindModal.step1); - //console.log('options bindModal.step2', this.options.bindModal.step2); return (typeof this.options.bindModal !== 'undefined' && typeof this.options.bindModal.step1 !== 'undefined') ? this.options.bindModal.step1 : this.default.bindModal.step1; }, @@ -236,6 +239,13 @@ export default { } }, mounted() { + + //console.log('options displayText', this.options.button.displayText); + //console.log('options bindModal.step1', this.options.bindModal.step1); + //console.log('options bindModal.step2', this.options.bindModal.step2); + console.log('options useDate.validFrom', this.options.useDate.validFrom); + console.log('options useDate.validTo', this.options.useDate.validTo); + if (!this.step1WithModal) { //console.log('Mounted now !'); this.openShowPane(); diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowAddressPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowAddressPane.vue index 4e9e59874..7e55f0c1b 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowAddressPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowAddressPane.vue @@ -27,6 +27,18 @@ +
+

{{ $t(getValidToDateText) }}

+
+ + +
+
+