Files
baserow/web-frontend/modules/database/components/view/grid/fields/FunctionalGridViewFieldButtonField.vue
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

52 lines
1.3 KiB
Vue

<template>
<div ref="cell" class="grid-view__cell">
<!-- 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"
type="secondary"
size="tiny"
icon="iconoir-warning-triangle"
disabled
>
{{ field.label }}
</Button>
<Button
v-else-if="canClick"
type="secondary"
size="tiny"
:loading="dispatching"
@click="dispatchWorkflowActions"
>
{{ field.label }}
</Button>
<Button v-else type="secondary" size="tiny" disabled>
{{ field.label }}
</Button>
</div>
</div>
</template>
<script>
import buttonField from '@baserow/modules/database/mixins/buttonField'
export default {
name: 'FunctionalGridViewFieldButtonField',
mixins: [buttonField],
props: {
row: { type: Object, required: true },
field: { type: Object, required: true },
value: { type: null, default: null },
workspaceId: { type: Number, required: false, default: null },
},
}
</script>