mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 08:03:49 +00:00
#16 pass default variables to add-address component when it is called from another vue component
This commit is contained in:
@@ -164,7 +164,8 @@ export default {
|
||||
id: this.accompanyingCourse.id
|
||||
},
|
||||
edit: false,
|
||||
addressId: null
|
||||
addressId: null,
|
||||
defaults: window.addaddress
|
||||
}
|
||||
if (this.accompanyingCourse.location) {
|
||||
context['edit'] = true;
|
||||
|
@@ -5,6 +5,7 @@ import { fetchHouseholdByAddressReference } from 'ChillPersonAssets/lib/househol
|
||||
import { datetimeToISO, dateToISO, ISOToDate } from 'ChillMainAssets/chill/js/date.js';
|
||||
|
||||
const debug = process.env.NODE_ENV !== 'production';
|
||||
//console.log('AJAJAJA', window.addaddress);
|
||||
|
||||
const concerned = window.household_members_editor_data.persons.map(p => {
|
||||
return {
|
||||
@@ -115,6 +116,7 @@ const store = createStore({
|
||||
name: state.household.type,
|
||||
id: state.household.id
|
||||
},
|
||||
defaults: window.addaddress,
|
||||
suggestions: state.addressesSuggestion
|
||||
};
|
||||
} else {
|
||||
@@ -125,6 +127,7 @@ const store = createStore({
|
||||
name: state.household.type,
|
||||
id: state.household.id
|
||||
},
|
||||
defaults: window.addaddress,
|
||||
};
|
||||
}
|
||||
},
|
||||
|
@@ -201,7 +201,8 @@ export default {
|
||||
context: {
|
||||
target: {}, // boilerplate for getting the address id
|
||||
edit: false,
|
||||
addressId: null
|
||||
addressId: null,
|
||||
defaults: window.addaddress
|
||||
}
|
||||
},
|
||||
errors: []
|
||||
|
@@ -10,6 +10,7 @@
|
||||
<script type="text/javascript">
|
||||
window.accompanyingCourseId = {{ accompanyingCourse.id|e('js') }};
|
||||
window.vueRootComponent = 'app';
|
||||
window.addaddress = {{ add_address|json_encode|raw }};
|
||||
</script>
|
||||
{{ encore_entry_script_tags('vue_accourse') }}
|
||||
{% endblock %}
|
||||
|
@@ -19,6 +19,7 @@
|
||||
<script type="text/javascript">
|
||||
window.household_members_editor_data = {{ data|json_encode|raw }};
|
||||
window.household_members_editor_expand_suggestions = {{ expandSuggestions }};
|
||||
window.addaddress = {{ add_address|json_encode|raw }};
|
||||
</script>
|
||||
{{ encore_entry_script_tags('vue_household_members_editor') }}
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user