From a106b7b7be30008ad9f30fd72478f721128fc854 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 8 Nov 2023 21:48:09 +0100 Subject: [PATCH] fix(settings): Pass user object to user row actions This is required as otherwise the action has no information on which user it was called Signed-off-by: Ferdinand Thiessen --- apps/settings/src/components/Users/UserRow.vue | 1 + .../settings/src/components/Users/UserRowActions.vue | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/settings/src/components/Users/UserRow.vue b/apps/settings/src/components/Users/UserRow.vue index 15995d2e4e7..2d03783b53f 100644 --- a/apps/settings/src/components/Users/UserRow.vue +++ b/apps/settings/src/components/Users/UserRow.vue @@ -288,6 +288,7 @@ :actions="userActions" :disabled="isLoadingField" :edit="editing" + :user="user" @update:edit="toggleEdit" /> diff --git a/apps/settings/src/components/Users/UserRowActions.vue b/apps/settings/src/components/Users/UserRowActions.vue index 61134367bf6..fc7881aba6a 100644 --- a/apps/settings/src/components/Users/UserRowActions.vue +++ b/apps/settings/src/components/Users/UserRowActions.vue @@ -38,7 +38,7 @@ :disabled="disabled" :aria-label="text" :icon="icon" - @click="action"> + @click="(event) => action(event, { ...user })"> {{ text }} @@ -54,7 +54,7 @@ import SvgCheck from '@mdi/svg/svg/check.svg?raw' import SvgPencil from '@mdi/svg/svg/pencil.svg?raw' interface UserAction { - action: (event: MouseEvent) => void, + action: (event: MouseEvent, user: Record) => void, icon: string, text: string } @@ -90,6 +90,14 @@ export default defineComponent({ type: Boolean, required: true, }, + + /** + * Target of this actions + */ + user: { + type: Object, + required: true, + }, }, computed: { -- 2.39.5