feat(12.1-01): list row states from one controller call per page
- pact.ListRowStates with the fixed RowState set deleted, negative, disabled - list response meta.row_states keyed by row id; unknown values dropped - list messages rowStateDeleted, rowStateNegative, rowStateDisabled - update writes through the scope the load used, so a soft-deleted record a controller includes stays soft-deleted - DataTable row state badges and text styles - roster fixture, smoke tests, OpenAPI, TS types, dist, READMEs, docs
This commit is contained in:
@@ -78,6 +78,13 @@ const toolbarButtons = computed(() =>
|
||||
buttons.value.filter((button) => button === 'delete' || toolbarActions.value.some((action) => action.name === button)),
|
||||
)
|
||||
const busyAction = ref<string | null>(null)
|
||||
// Row states of the current page and their badge labels (D-12).
|
||||
const rowStates = computed(() => meta.value?.row_states ?? {})
|
||||
const stateLabels = computed(() => ({
|
||||
deleted: message(messages.value?.rowStateDeleted),
|
||||
negative: message(messages.value?.rowStateNegative),
|
||||
disabled: message(messages.value?.rowStateDisabled),
|
||||
}))
|
||||
// Declared bulk actions the admin may run (D-09), in declared order. The
|
||||
// built-in delete stays the toolbar button and is not part of the menu.
|
||||
const bulkActions = computed(() => (schema.value?.bulkActions ?? []).filter((action) => action.name !== 'delete'))
|
||||
@@ -393,6 +400,8 @@ async function onAction(name: string): Promise<void> {
|
||||
:selected="selected"
|
||||
:sortable="schema?.showSorting ?? false"
|
||||
:sort="sort"
|
||||
:row-states="rowStates"
|
||||
:state-labels="stateLabels"
|
||||
@update:selected="(ids: RowId[]) => (selected = ids)"
|
||||
@sort="onSort"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user