]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(settings): Pass user object to user row actions
authorFerdinand Thiessen <opensource@fthiessen.de>
Wed, 8 Nov 2023 20:48:09 +0000 (21:48 +0100)
committerFerdinand Thiessen <opensource@fthiessen.de>
Wed, 8 Nov 2023 20:49:26 +0000 (21:49 +0100)
This is required as otherwise the action has no information on which user it was called

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
apps/settings/src/components/Users/UserRow.vue
apps/settings/src/components/Users/UserRowActions.vue

index 15995d2e4e7c078e8744559920015be509081711..2d03783b53fa2f4c5be65d3251e8ba23caf6ee95 100644 (file)
                                :actions="userActions"
                                :disabled="isLoadingField"
                                :edit="editing"
+                               :user="user"
                                @update:edit="toggleEdit" />
                </td>
        </tr>
index 61134367bf6fef542f8bca0025666481d7328ca9..fc7881aba6a564f78d265ba2aa14887775384e2a 100644 (file)
@@ -38,7 +38,7 @@
                        :disabled="disabled"
                        :aria-label="text"
                        :icon="icon"
-                       @click="action">
+                       @click="(event) => action(event, { ...user })">
                        {{ text }}
                </NcActionButton>
        </NcActions>
@@ -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<string, unknown>) => 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: {