Table structure (frontend contract)
Shape of the structure object from the control-table API and how the UI consumes it
The frontend never hard-codes columns or actions. A feature page loads structure with useTableStructure, then passes the result to ReactApiTable as the table prop.
Backend owns the contract
Field names and allowed values are defined by the control-table backend. This page describes how bolesa-app-ui reads that JSON — validate against your API response when wiring a new table.
How structure is loaded
getTableStructure({ table: '/api-table/control-tables/load-table/my-feature' });| Step | File | Behavior |
|---|---|---|
| GET | hooks/useTableStructure.ts | axiosTable.get(table, { headers: { ln: locale } }) |
| State | Same hook | tableStructure = response.data (app-specific wrapper shape) |
| Mount | ApiTablesController | dispatch(_getTableComponents({ ...table, customElement? })) |
The exact GET path is per feature (see Getting started examples).
Fields consumed by ApiTablesController
ApiTablesController spreads table into Redux via _getTableComponents and related actions:
| Field | Redux / usage | Required |
|---|---|---|
tableName | tableCore.tableName — segment in query-table/{tableName} | Yes |
columns | structureColumns → formatted for RDT | Yes |
filters | structureFilters — filter sheet; omit or [] to hide filters | No |
bulkActions | bulkActions slice | No |
rowActions | Flattened into structureRowActions; may include general_actions | No |
Optional prop customElement (not from API): see Custom elements.
Column object (columns[])
Used by formatTableColumns in ./ApiTables/table-utils/utils.tsx and cell renderers in ColumnCellTypes.tsx.
| Field | Purpose |
|---|---|
label | Header text |
data_src | Row field key |
type | Renderer — see Column types |
sortable | Server sort when true |
showable | If false, column is excluded from the table |
values_formating | Badges / boolean labels (type-specific) |
| Link-only | linkStyle, linkText, linkColor, showCopyBtn |
Per-row row.actions (object keyed by action id) is required for type: "actions" columns.
Filter object (filters[])
| Field | Purpose |
|---|---|
filter_name | Form key and appliedFilters key |
label | UI label |
type | text, number, select, boolean, null, date, multi_select — see Filters |
props | select_options, operators, selectOptions, pair_with, etc. |
Row actions (rowActions)
Two shapes:
- Flat map — action id → action definition (used directly).
general_actions— nested map; controller flattens for structure and setsactionsInRegularCellsso actions render inside regular columns instead of a dedicated actions column.
Each action typically includes action_type, method, action.api, button, need_confirmation, onSuccess, applicableAsBulkAction, action_key. See Row action types.
Bulk actions (bulkActions[])
List of bulk operations: action_key, method, action.api, need_confirmation, onSuccess, labels, etc. See Bulk actions.
Query-table response (data phase)
Not part of structure GET, but every developer needs it:
{
"items": [],
"pagination": {},
"bindings": {}
}items → tableData; pagination → TablePagination; bindings → tableBindings (optional server hints).
POST body from the client is documented in Architecture overview.