Improves user display in audit log and requests

Uses usernames instead of user IDs in the audit log and
approval request listings to improve readability. If a user
is not found, it displays a truncated version of the user ID.
This commit is contained in:
padreug 2025-11-01 09:25:22 +01:00
parent d1f22dfda8
commit 762f5cc411
2 changed files with 6 additions and 2 deletions

View file

@ -857,6 +857,10 @@ window.app = Vue.createApp({
const account = this.accounts.find(a => a.id === accountId)
return account ? account.name : accountId
},
getUserName(userId) {
const user = this.users.find(u => u.user_id === userId)
return user ? user.username : userId.substring(0, 16) + '...'
},
async loadReconciliationSummary() {
if (!this.isSuperUser) return

View file

@ -79,7 +79,7 @@
{% raw %}{{ formatDate(entry.entry_date) }}{% endraw %}
</q-item-label>
<q-item-label caption v-if="entry.meta && entry.meta.user_id">
User: {% raw %}{{ entry.meta.user_id.substring(0, 16) }}...{% endraw %}
User: {% raw %}{{ getUserName(entry.meta.user_id) }}{% endraw %}
</q-item-label>
<q-item-label caption v-if="entry.reference" class="text-grey">
Ref: {% raw %}{{ entry.reference }}{% endraw %}
@ -285,7 +285,7 @@
<q-item-section>
<q-item-label>{% raw %}{{ request.description }}{% endraw %}</q-item-label>
<q-item-label caption>
User: {% raw %}{{ request.user_id.substring(0, 16) }}...{% endraw %}
User: {% raw %}{{ getUserName(request.user_id) }}{% endraw %}
</q-item-label>
<q-item-label caption>
Requested: {% raw %}{{ formatDate(request.created_at) }}{% endraw %}