diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue
index e4d332289..a1496e7d6 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue
@@ -33,8 +33,8 @@ export default {
},
mounted() {
- console.log('AddAddress: data context', this.context);
- console.log('AddAddress: data options', this.options);
+ //console.log('AddAddress: data context', this.context);
+ //console.log('AddAddress: data options', this.options);
},
methods: {
displayErrors() {
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ActionButtons.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ActionButtons.vue
index a0bb66f33..afe059da6 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ActionButtons.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ActionButtons.vue
@@ -2,19 +2,23 @@
@@ -24,7 +28,16 @@ export default {
props: [ 'options', 'default' ],
computed: {
isStickyForm() {
- return (typeof this.options.stickyActions !== 'undefined') ? this.options.stickyActions : this.default.stickyActions;
+ return (typeof this.options.stickyActions !== 'undefined') ?
+ this.options.stickyActions : this.default.stickyActions;
+ },
+ },
+ methods: {
+ resetPane() {
+ this.flag.suggestPane = false;
+ this.flag.editPane = false;
+ this.flag.datePane = false;
+ this.flag.showPane = true;
}
}
}
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 1948535dc..259266c92 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue
@@ -12,10 +12,10 @@
-
+
+ @close="resetPane">
{{ $t(getTextTitle) }}
@@ -42,9 +42,11 @@
class="btn btn-update">
{{ $t('action.edit')}}
+
@@ -63,10 +65,10 @@
-
+
+ @close="resetPane">
{{ $t(getTextTitle) }}
@@ -116,10 +118,10 @@
-
+
+ @close="resetPane">
{{ $t(getTextTitle) }}
@@ -247,10 +249,24 @@ export default {
}
},
computed: {
- InModal() {
+ inModal() {
return (typeof this.options.openPanesInModal !== 'undefined') ?
this.options.openPanesInModal : this.default.openPanesInModal;
},
+ useDatePane() {
+ let vFrom = (typeof this.options.useDate !== 'undefined'
+ && typeof this.options.useDate.validFrom !== 'undefined') ?
+ this.options.useDate.validFrom : this.default.useDate.validFrom ;
+ let vTo = (typeof this.options.useDate !== 'undefined'
+ && typeof this.options.useDate.validTo !== 'undefined') ?
+ this.options.useDate.validTo : this.default.useDate.validTo ;
+ return (vFrom || vTo) ? true : false;
+ },
+ hasSuggestions() {
+ // TODO
+ //return addressSuggestions.length > 0
+ return true;
+ },
getTextTitle() {
if ( typeof this.options.title !== 'undefined'
&& ( this.options.title.edit !== null
@@ -260,22 +276,23 @@ export default {
}
return (this.context.edit) ? this.default.title.edit : this.default.title.create;
},
- //context() {
- // return this.context;
- //}
+ bypassFirstStep() {
+ // exception: passing step0 if new address and pane are not in modal
+ return !this.context.edit && !this.inModal && this.flag.editPane === false
+ }
},
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);
+ //console.log('options useDate.validFrom', this.options.useDate.validFrom);
+ //console.log('options useDate.validTo', this.options.useDate.validTo);
+ console.log('useDatePane', this.useDatePane);
+
+ //console.log('Mounted now !');
+ this.openShowPane();
- if (!this.step1WithModal) {
- //console.log('Mounted now !');
- this.openShowPane();
- }
},
methods: {
@@ -283,35 +300,72 @@ export default {
* Opening and closing Panes when interacting with buttons
*/
openShowPane() {
-
if (this.context.edit) {
+ console.log('getInitialAddress');
this.getInitialAddress(this.context.addressId);
}
- // when create new address, start first with editPane !!
- if ( this.context.edit === false
- && this.flag.editPane === false
- ) {
+ if (this.bypassFirstStep) {
+ this.closeShowPane();
this.openEditPane();
- this.flag.editPane = true;
} else {
this.flag.showPane = true;
- console.log('step1: open the Show Panel');
+ console.log('step0: open the Show Panel');
}
},
-
+ closeShowPane() {
+ // Show pane can be closed only when openPanesInModal is false
+ if (!this.inModal) {
+ this.flag.showPane = false;
+ console.log('step0: close the Show Panel');
+ }
+ },
+ openSuggestPane() {
+ this.flag.suggestPane = true;
+ console.log('step1: open the Suggestion Panel');
+ },
+ closeSuggestPane() {
+ this.flag.suggestPane = false;
+ console.log('step1: close the Suggestion Panel');
+ },
openEditPane() {
- console.log('step2: open the Edit panel');
+ /*
+ if (!this.context.edit && this.hasSuggestions) {
+ this.openSuggestPane();
+ } else {
+ }
+ */
this.initForm();
this.getCountries();
+ this.flag.editPane = true;
+ console.log('step2: open the Edit panel');
},
-
closeEditPane() {
- console.log('step2: close the Edit Panel');
this.applyChanges();
- this.flag.showPane = true;
this.flag.editPane = false;
+ console.log('step2: close the Edit Panel');
+ /*
+ if (!this.context.edit && this.useDatePane) {
+ this.openDatePane();
+ } else {
+ }
+ */
+ this.openShowPane()
+ },
+ openDatePane() {
+ this.flag.datePane = true;
+ console.log('step3: open the Date Panel');
+ },
+ closeDatePane() {
+ this.flag.datePane = false;
+ console.log('step3: close the Date Panel');
+ },
+ resetPane() {
+ this.flag.suggestPane = false;
+ this.flag.editPane = false;
+ this.flag.datePane = false;
+ this.flag.showPane = true;
},
/*
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue
index d91bec958..ed461ffb5 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue
@@ -39,7 +39,10 @@
-
+
-
-
+
{{ $t('action.cancel') }}
-
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue
index f57340bf0..2738f7775 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue
@@ -13,21 +13,29 @@
-
+
+
+
+
+
+
+