[data-reveal]{opacity:1!important;transform:none!important}
Quick Actions
Interfaces

Quick Actions

A quick action is a shortcut the backend contributes to the dashboard's command palette: a labelled entry, grouped under a category, that points at a registered page, a table creation form, a table toolbar button, or…

Overview

A quick action is a shortcut the backend contributes to the dashboard's command palette: a labelled entry, grouped under a category, that points at a registered page, a table creation form, a table toolbar button, or an event. Actions register at import time. Access follows the target page and, for a form or a button, the permission of what it opens.

Both functions live in @antelopejs/interface-dms/quick-actions.

Declare a Category and Its Actions

QuickActionCategory(id, info) registers the group; QuickAction(id, info) registers an entry in it. Both return the registered record. Create the category first: registering an action whose category is unknown throws.

This example assumes your application exports a registered TasksPage from ./pages/tasks.

import { TasksPage } from "./pages/tasks";
import {
  QuickAction,
  QuickActionCategory,
} from "@antelopejs/interface-dms/quick-actions";

const tasks = QuickActionCategory("tasks", {
  displayName: "$my_app.quick_actions.tasks",
  icon: "i-ph-check-square",
  order: 10,
});

QuickAction("tasks-new", {
  category: tasks,
  displayName: "$my_app.quick_actions.tasks_new",
  icon: "i-ph-plus",
  target: { type: "navigate", page: TasksPage },
});

Actions are keyed by their category id and their own id, so the same action id may appear under two categories. Registering an id that is already taken keeps the first registration.

QuickActionCategoryInfo

FieldTypeDescription
idstringCategory id. Supplied as the first argument of QuickActionCategory, not inside info.
displayNamestringGroup label. Required.
iconstringIcon name.
ordernumberSort order among categories.

QuickActionInfo

FieldTypeDescription
idstringAction id. Supplied as the first argument of QuickAction, not inside info.
categoryQuickActionCategoryInfoThe record returned by QuickActionCategory. Required.
displayNamestringEntry label. Required.
iconstringIcon name. Required.
ordernumberSort order within the category.
targetQuickActionTargetWhat running the action does. Required.

Access is computed per caller from the registered target page, including its permission and tenant access gate (Permissions). An openForm target also checks the selected table's create action; a button target checks the button's own permission. Configure access on the destination rather than adding a separate permission property to the quick action.

QuickActionTarget

Every target requires page, the registered page controller class. The frontend URL derives from that page, so renaming a route does not leave a stale URL in the action.

VariantFieldsMeaning
"navigate"page, optional queryNavigate to the page with optional string query parameters.
"openForm"page, optional componentOpen a table's creation form. Select the component explicitly if the page has more than one eligible table.
"button"page, button, optional componentOpen the page and press the table toolbar button whose id is button, e.g. to open the modal it opens. Select the component explicitly if several components of the page declare that button id.
"event"page, name, optional payloadNavigate to the page and emit the named event.

The following examples assume an existing registered BooksPage with a TableView stored in its static table field. For a nested table, pass a target such as BooksPage.content.targetChild("table") instead.

import { BooksPage } from "./pages/books";
import {
  QuickAction,
  QuickActionCategory,
} from "@antelopejs/interface-dms/quick-actions";

const catalog = QuickActionCategory("catalog", {
  displayName: "$my_app.quick_actions.catalog",
  icon: "i-ph-books",
});

QuickAction("catalog-new-book", {
  category: catalog,
  displayName: "$my_app.quick_actions.new_book",
  icon: "i-ph-plus",
  target: { type: "openForm", page: BooksPage, component: BooksPage.table },
});

// BooksPage.table declares customButtons: [{ id: "import", permission: "add", … }]
QuickAction("catalog-import", {
  category: catalog,
  displayName: "$my_app.quick_actions.import_books",
  icon: "i-ph-upload",
  target: { type: "button", page: BooksPage, button: "import" },
});

QuickAction("catalog-refresh", {
  category: catalog,
  displayName: "$my_app.quick_actions.refresh",
  icon: "i-ph-arrows-clockwise",
  target: { type: "event", page: BooksPage, name: "catalog:refresh", payload: { force: true } },
});

Declare quick actions in a file imported by your module so the registrations run at import time, next to the pages they point at.

Layout Banners covers the other global surface a backend module contributes to: messages under the dashboard header.