Fix vue3 refresh for name, address cards in profile view

This commit is contained in:
Lance Edgar 2024-06-03 16:51:29 -05:00
parent ab523719a6
commit 9243edf7af

View file

@ -78,7 +78,9 @@
</%def> </%def>
<%def name="render_personal_name_card()"> <%def name="render_personal_name_card()">
<div class="card personal"> <div class="card personal"
## nb. hack to force refresh for vue3
:key="refreshPersonalCard">
<header class="card-header"> <header class="card-header">
<p class="card-header-title">Name</p> <p class="card-header-title">Name</p>
</header> </header>
@ -184,7 +186,9 @@
</%def> </%def>
<%def name="render_personal_address_card()"> <%def name="render_personal_address_card()">
<div class="card personal"> <div class="card personal"
## nb. hack to force refresh for vue3
:key="refreshAddressCard">
<header class="card-header"> <header class="card-header">
<p class="card-header-title">Address</p> <p class="card-header-title">Address</p>
</header> </header>
@ -1822,6 +1826,10 @@
let PersonalTabData = { let PersonalTabData = {
refreshTabURL: '${url('people.profile_tab_personal', uuid=person.uuid)}', refreshTabURL: '${url('people.profile_tab_personal', uuid=person.uuid)}',
// nb. hack to force refresh for vue3
refreshPersonalCard: 1,
refreshAddressCard: 1,
% if request.has_perm('people_profile.edit_person'): % if request.has_perm('people_profile.edit_person'):
editNameShowDialog: false, editNameShowDialog: false,
editNameFirst: null, editNameFirst: null,
@ -1971,6 +1979,8 @@
this.editNameShowDialog = false this.editNameShowDialog = false
this.refreshTab() this.refreshTab()
this.editNameSaving = false this.editNameSaving = false
// nb. hack to force refresh for vue3
this.refreshPersonalCard += 1
}, response => { }, response => {
this.editNameSaving = false this.editNameSaving = false
}) })
@ -2002,6 +2012,8 @@
this.$emit('profile-changed', response.data) this.$emit('profile-changed', response.data)
this.editAddressShowDialog = false this.editAddressShowDialog = false
this.refreshTab() this.refreshTab()
// nb. hack to force refresh for vue3
this.refreshAddressCard += 1
}) })
}, },