mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
Address: replace variable entity.type by entity.name
This commit is contained in:
parent
da32afeb3f
commit
9ff58fe0c3
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<add-address
|
<add-address
|
||||||
v-bind:key="context.entity.type"
|
v-bind:key="context.entity.name"
|
||||||
v-bind:context="context"
|
v-bind:context="context"
|
||||||
v-bind:options="options"
|
v-bind:options="options"
|
||||||
v-bind:addressChanged="submitAddress"
|
v-bind:addressChanged="submitAddress"
|
||||||
|
@ -437,7 +437,7 @@ export default {
|
|||||||
if ('newPostcode' in payload) {
|
if ('newPostcode' in payload) {
|
||||||
|
|
||||||
let postcodeBody = payload.newPostcode;
|
let postcodeBody = payload.newPostcode;
|
||||||
if (this.context.entity.type === 'person') {
|
if (this.context.entity.name === 'person') {
|
||||||
postcodeBody = Object.assign(postcodeBody, {'origin': 3});
|
postcodeBody = Object.assign(postcodeBody, {'origin': 3});
|
||||||
}
|
}
|
||||||
return postPostalCode(postcodeBody)
|
return postPostalCode(postcodeBody)
|
||||||
@ -459,7 +459,7 @@ export default {
|
|||||||
this.flag.loading = false;
|
this.flag.loading = false;
|
||||||
this.flag.success = true;
|
this.flag.success = true;
|
||||||
resolve({
|
resolve({
|
||||||
entity: this.context.entity.type,
|
entity: this.context.entity.name,
|
||||||
entityId: this.context.entity.id,
|
entityId: this.context.entity.id,
|
||||||
addressId: this.entity.address.address_id
|
addressId: this.entity.address.address_id
|
||||||
}
|
}
|
||||||
@ -505,7 +505,7 @@ export default {
|
|||||||
this.flag.loading = false;
|
this.flag.loading = false;
|
||||||
this.flag.success = true;
|
this.flag.success = true;
|
||||||
return resolve({
|
return resolve({
|
||||||
entity: this.context.entity.type,
|
entity: this.context.entity.name,
|
||||||
entityId: this.context.entity.id,
|
entityId: this.context.entity.id,
|
||||||
addressId: this.entity.address.address_id
|
addressId: this.entity.address.address_id
|
||||||
});
|
});
|
||||||
@ -523,7 +523,7 @@ export default {
|
|||||||
submitNewAddress()
|
submitNewAddress()
|
||||||
{
|
{
|
||||||
let payload = {
|
let payload = {
|
||||||
entity: this.context.entity.type,
|
entity: this.context.entity.name,
|
||||||
entityId: this.context.entity.id,
|
entityId: this.context.entity.id,
|
||||||
addressId: this.entity.address.address_id
|
addressId: this.entity.address.address_id
|
||||||
};
|
};
|
||||||
|
@ -82,10 +82,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getValidFromDateText() {
|
getValidFromDateText() {
|
||||||
return (this.context.entity.type === 'household') ? 'move_date' : 'validFrom';
|
return (this.context.entity.name === 'household') ? 'move_date' : 'validFrom';
|
||||||
},
|
},
|
||||||
getSuccessText() {
|
getSuccessText() {
|
||||||
switch (this.context.entity.type) {
|
switch (this.context.entity.name) {
|
||||||
/*
|
/*
|
||||||
case 'household':
|
case 'household':
|
||||||
return (this.context.edit) ? 'household_address_edit_success' : 'household_address_move_success';
|
return (this.context.edit) ? 'household_address_edit_success' : 'household_address_move_success';
|
||||||
|
@ -15,7 +15,7 @@ containers.forEach((container) => {
|
|||||||
addAddress: {
|
addAddress: {
|
||||||
context: {
|
context: {
|
||||||
entity: {
|
entity: {
|
||||||
type: container.dataset.targetEntityName,
|
name: container.dataset.targetEntityName,
|
||||||
id: container.dataset.targetEntityId
|
id: container.dataset.targetEntityId
|
||||||
},
|
},
|
||||||
edit: container.dataset.mode === 'edit', //boolean
|
edit: container.dataset.mode === 'edit', //boolean
|
||||||
|
@ -54,7 +54,7 @@ export default {
|
|||||||
assignAddress() {
|
assignAddress() {
|
||||||
//console.log('assignAddress id', this.person.current_household_address);
|
//console.log('assignAddress id', this.person.current_household_address);
|
||||||
let payload = {
|
let payload = {
|
||||||
entity: this.context.entity.type,
|
entity: this.context.entity.name,
|
||||||
entityId: this.context.entity.id,
|
entityId: this.context.entity.id,
|
||||||
locationStatusTo: 'person',
|
locationStatusTo: 'person',
|
||||||
personId: this.person.id
|
personId: this.person.id
|
||||||
|
@ -119,7 +119,7 @@ export default {
|
|||||||
initAddressContext() {
|
initAddressContext() {
|
||||||
let context = {
|
let context = {
|
||||||
entity: {
|
entity: {
|
||||||
type: this.accompanyingCourse.type,
|
name: this.accompanyingCourse.type,
|
||||||
id: this.accompanyingCourse.id
|
id: this.accompanyingCourse.id
|
||||||
},
|
},
|
||||||
edit: false,
|
edit: false,
|
||||||
@ -134,7 +134,7 @@ export default {
|
|||||||
removeAddress() {
|
removeAddress() {
|
||||||
//console.log('remove address');
|
//console.log('remove address');
|
||||||
let payload = {
|
let payload = {
|
||||||
entity: this.context.entity.type,
|
entity: this.context.entity.name,
|
||||||
entityId: this.context.entity.id,
|
entityId: this.context.entity.id,
|
||||||
locationStatusTo: 'none'
|
locationStatusTo: 'none'
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user