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 <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2023-11-08 21:48:09 +01:00
parent 1acc7c0468
commit a106b7b7be
No known key found for this signature in database
GPG key ID: 45FAE7268762B400
2 changed files with 11 additions and 2 deletions

View file

@ -288,6 +288,7 @@
:actions="userActions"
:disabled="isLoadingField"
:edit="editing"
:user="user"
@update:edit="toggleEdit" />
</td>
</tr>

View 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: {