Files
alamin-br 9b4fbdff7e fix: button field follow-ups from the #6086 review (#6135)
* fix: keep a button action card open when its save finishes

A created action is keyed by its new id once the list is refetched, which closed the card while the context was still on screen.

* fix: give the button action error a line height

* fix: outline the selected button field cell

* fix: name the button actions that ran before one failed

Completed actions are not rolled back, and the old message left the clicker to assume nothing had happened.

* fix: disable a button field for users who may not click it

The dispatch operation is now scoped to the field, which is the only id a cell has to ask with. Roles attach no lower than the table, so one check on the field answers the same as one per action.

* fix: refetch permissions when a field is created or restored

A role on the table or database lists the fields it covers, so a field
added after the page loaded was refused by every field scoped check
until a reload.

* test: cover the disabled button in the row modal and on a card

* fix: keep a button action card in place while its save finishes

The refetched list keyed a created or retyped action by its new id, so
its card remounted and the editor scrolled to the top mid-save.
2026-09-23 16:00:14 +02:00

47 lines
1.1 KiB
Vue

<template>
<div ref="cell" class="grid-view__cell active">
<!-- A disabled button fires no mouse events, so the tooltip sits on the
wrapper. -->
<div
v-tooltip="
requiresReconfiguration
? $t('buttonField.requiresReconfiguration')
: disabledReason
"
class="grid-field-button"
>
<Button
v-if="requiresReconfiguration"
size="tiny"
type="secondary"
icon="iconoir-warning-triangle"
disabled
>
{{ field.label }}
</Button>
<Button
v-else-if="canClick"
size="tiny"
type="secondary"
:loading="dispatching"
@click="dispatchWorkflowActions"
>
{{ field.label }}
</Button>
<Button v-else size="tiny" type="secondary" disabled>
{{ field.label }}
</Button>
</div>
</div>
</template>
<script>
import gridField from '@baserow/modules/database/mixins/gridField'
import buttonField from '@baserow/modules/database/mixins/buttonField'
export default {
name: 'GridViewFieldButtonField',
mixins: [gridField, buttonField],
}
</script>