mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
improve addAddress
This commit is contained in:
@@ -54,8 +54,8 @@ export default {
|
||||
assignAddress() {
|
||||
//console.log('assignAddress id', this.person.current_household_address);
|
||||
let payload = {
|
||||
entity: this.context.entity.name,
|
||||
entityId: this.context.entity.id,
|
||||
target: this.context.target.name,
|
||||
targetId: this.context.target.id,
|
||||
locationStatusTo: 'person',
|
||||
personId: this.person.id
|
||||
};
|
||||
|
@@ -94,7 +94,7 @@ export default {
|
||||
useDate: {
|
||||
validFrom: true
|
||||
},
|
||||
onlyButton: true
|
||||
hideAddress: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@ export default {
|
||||
methods: {
|
||||
initAddressContext() {
|
||||
let context = {
|
||||
entity: {
|
||||
target: {
|
||||
name: this.accompanyingCourse.type,
|
||||
id: this.accompanyingCourse.id
|
||||
},
|
||||
@@ -136,8 +136,8 @@ export default {
|
||||
removeAddress() {
|
||||
//console.log('remove address');
|
||||
let payload = {
|
||||
entity: this.context.entity.name,
|
||||
entityId: this.context.entity.id,
|
||||
target: this.context.target.name,
|
||||
targetId: this.context.target.id,
|
||||
locationStatusTo: 'none'
|
||||
};
|
||||
this.$store.dispatch('updateLocation', payload);
|
||||
|
@@ -261,7 +261,7 @@ let initPromise = getAccompanyingCourse(id)
|
||||
},
|
||||
updateLocation({ commit }, payload) {
|
||||
//console.log('## action: updateLocation', payload.locationStatusTo);
|
||||
let body = { 'type': payload.entity, 'id': payload.entityId };
|
||||
let body = { 'type': payload.target, 'id': payload.targetId };
|
||||
let location = {};
|
||||
if (payload.locationStatusTo === 'person') { // patch for person address (don't remove addressLocation)
|
||||
location = { 'personLocation': { 'type': 'person', 'id': payload.personId }};
|
||||
@@ -273,7 +273,7 @@ let initPromise = getAccompanyingCourse(id)
|
||||
location = { 'personLocation': null };
|
||||
}
|
||||
Object.assign(body, location);
|
||||
patchAccompanyingCourse(payload.entityId, body)
|
||||
patchAccompanyingCourse(payload.targetId, body)
|
||||
.then(accompanyingCourse => new Promise((resolve, reject) => {
|
||||
commit('updateLocation', {
|
||||
location: accompanyingCourse.location,
|
||||
|
@@ -186,8 +186,8 @@ export default {
|
||||
return {
|
||||
addAddress: {
|
||||
context: {
|
||||
entity: {
|
||||
type: 'household_create',
|
||||
target: {
|
||||
name: 'household_create',
|
||||
id: 0
|
||||
},
|
||||
edit: false,
|
||||
|
@@ -9,10 +9,10 @@
|
||||
{# include vue_address component #}
|
||||
{% include '@ChillMain/Address/_insert_vue_address.html.twig' with {
|
||||
targetEntity: { name: 'household', id: household.id },
|
||||
backUrl: path('chill_person_household_addresses', { 'household_id': household.id }),
|
||||
stickyActions: true
|
||||
} %}
|
||||
{#
|
||||
stickyActions: true
|
||||
backUrl: path('chill_person_household_addresses', { 'household_id': household.id }),
|
||||
openPanesInModal: false,
|
||||
#}
|
||||
</div>
|
||||
|
@@ -10,9 +10,11 @@
|
||||
{% include '@ChillMain/Address/_insert_vue_address.html.twig' with {
|
||||
targetEntity: { name: 'household', id: household.id },
|
||||
backUrl: path('chill_person_household_addresses', { 'household_id': household.id }),
|
||||
openPanesInModal: false,
|
||||
stickyActions: true
|
||||
stickyActions: true,
|
||||
} %}
|
||||
{#
|
||||
openPanesInModal: false,
|
||||
#}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
@@ -18,13 +18,15 @@
|
||||
{% include '@ChillMain/Address/_insert_vue_address.html.twig' with {
|
||||
targetEntity: { name: 'household', id: household.id },
|
||||
backUrl: path('chill_person_household_addresses', { 'household_id': household.id }),
|
||||
forceRedirect: true,
|
||||
mode: 'new',
|
||||
useValidFrom: true,
|
||||
buttonSize: 'btn-lg',
|
||||
buttonText: 'Move household',
|
||||
modalTitle: 'Move household',
|
||||
forceRedirect: true,
|
||||
} %}
|
||||
{#
|
||||
#}
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user