Approval Flow Table
An advanced version of the ‘Table View’ component. This is very similar to the ‘Managed Data Table’ component, but is specifically designed for approval flow. In addition to just displaying the table, this component allows the creator to specify: a ‘status’ column which dictates whether the row is approved or rejected, exactly which rows of the table to be shown (via a custom SQL query), a custom form for adding/modifying rows, and permissions for adding, modifying, and/or deleting rows of the table. Note that this component requires that the table have a key column. The primary add button uses the text Add followed by the table’s labelSingular when set on the table; otherwise it uses the table name.
Outline Display: Presents an editable table for approval flow that uses a modal to add/edit entries.
We will draw data from {{tab}}.
The {{status}} field indicates approval status, with Approved={{approveStatus}}, Rejected={{rejectStatus}}, and In Review={{inReviewStatus}}.
The button for Approve is labeled {{approveButtonText}} and for Reject, it’s {{rejectButtonText}}.
We will display only rows that satisfy: {{filter}}.
Permissions for deletion are set by {{delPermission}} and for adding/editing by {{modifyPermission}}.
{{customShow:The query results are shown with the following custom rules: {{customShow}}}}
When a user wants to edit a row, they will see a form constructed of:
{{rowIngredients}}
Requirements
The linkedQuery must include the table’s key column and status column in the query results.
Local scope
Names introduced within this component’s knobs:
uiArgs– virtual table holding this handler’s parameterstab– table chosen from the app’s schema (viatabknob)key– key column oftabqueryTab– result columns oflinkedQuery(referenceable as a virtual table)formFieldsTable– empty table populated by ingredientstable– renamed copy oftab
Settings
Required
-
tab: table
The table that we will be approving/rejecting entries from -
status: column oftab(type filter: exactly text; required, non-nullable)
The status field governing whether an entry is approved or rejected -
linkedQuery: SQL query
A SQL query that returns all of the rows to display.
Must produce: result matching exactly type ofstatus, then result matching exactly type ofkey, then any number of results matching any type
Scope: all columns ofuiArgs(reference as[ColumnName], e.g.,[Name],[Price]), current username as[Username](only where the handler authenticates: a logged-in page, or the calling user of an MCP tool, including inside its pipeline). -
approveStatus: constant value (type: text; required, non-nullable)
The value assigned to the status field when the row is approved -
rejectStatus: constant value (type: text; required, non-nullable)
The value assigned to the status field when the row is rejected -
inReviewStatus: constant value (type: text; required, non-nullable)
The value assigned the status field when the row is still under review
Optional
-
sqlFilter: ingredient slot ofsqlFilterIngredients(linkedQuery)(many)
GUI widgets for letting the user filter the query -
defaultSortAscending: constant value (type: bool; required, non-nullable)
Should we default to sort ascending? -
shouldShowKey: constant value (type: bool; required, non-nullable)
Should the key be one of the shown columns? -
allowAdditions: constant value (type: bool; required, non-nullable)
Should the user be able to make new rows? -
approveButtonText: constant value (type: text; required, non-nullable)
The text for the “Approve” button -
rejectButtonText: constant value (type: text; required, non-nullable)
The text for the “Reject” button -
rowIngredients: ingredient slot offormIngredients(tab, formFieldsTable)(many)
Descriptions for widgets or other ways of asking the user for information to construct a row in the table. Note that the order of the ingredients will be reflected in the order of the form and that there must be an ingredient to produce each column in the table except for the columns: [status]. Key columns should use SequentialID. -
delPermission: formula (returns bool; required, non-nullable)
A boolean formula that determines whether the user has permission to delete a row (‘True’ will allow them to delete any row)
Scope: all columns oftab(reference as[ColumnName], e.g.,[Name],[Price]) -
modifyPermission: formula (returns bool; required, non-nullable)
A boolean formula that determines whether the user has permission to modify a row (‘True’ will allow them to modify any row)
Scope: all columns oftab(reference as[ColumnName], e.g.,[Name],[Price]) -
onAdd: ingredient slot ofrowActionsIngredients(tab)(many)
The action(s) to be performed on each row that the user adds. Note that the row has already been added to the table – this field is only required if additional actions should be performed. -
onDelete: ingredient slot ofrowActionsIngredients(tab)(many)
The action(s) to be performed on each row that the user clicks to delete. Note that the row has already been deleted from the table – this field is only required if additional actions should be performed. -
onModify: ingredient slot ofrowActionsIngredients(tab)(many)
The action(s) to be performed on each row that the user modifies. Note that the row has already been modified in the table – this field is only required if additional actions should be performed. -
onApprove: ingredient slot ofrowActionsIngredients(tab)(many)
The action(s) to be performed on each row that the user approves. Note that the row will go through the typical add/modify flow as necessary – this field is only required if additional actions should be performed specifically on approval. -
customShow: ingredient slot ofcustomShowIngredientsList(table)(many)
Custom ways to show columns