condition on persons to see button location

This commit is contained in:
Mathieu Jaumotte 2021-08-13 17:54:58 +02:00
parent 17dd52c3dc
commit 2d2bb117ca
2 changed files with 21 additions and 3 deletions

View File

@ -13,7 +13,7 @@
<td> <td>
<ul class="record_actions"> <ul class="record_actions">
<button-location <button-location
v-if="!participation.endDate"> v-if="hasCurrentHouseholdAddress">
</button-location> </button-location>
<li> <li>
<on-the-fly <on-the-fly
@ -60,5 +60,14 @@ export default {
}, },
props: ['participation'], props: ['participation'],
emits: ['remove', 'close'], emits: ['remove', 'close'],
computed: {
hasCurrentHouseholdAddress() {
if ( !this.participation.endDate
&& this.participation.person.current_household_address !== null ) {
return true;
}
return false;
}
}
} }
</script> </script>

View File

@ -21,7 +21,7 @@
<td> <td>
<ul class="record_actions"> <ul class="record_actions">
<button-location <button-location
v-if="resource.resource.type === 'person'"> v-if="hasCurrentHouseholdAddress">
</button-location> </button-location>
<li> <li>
<on-the-fly <on-the-fly
@ -60,6 +60,15 @@ export default {
ButtonLocation ButtonLocation
}, },
props: ['resource'], props: ['resource'],
emits: ['remove'] emits: ['remove'],
computed: {
hasCurrentHouseholdAddress() {
if ( !this.resource.resource.type === 'person'
&& this.resource.resource.current_household_address !== null ) {
return true;
}
return false;
}
}
} }
</script> </script>