Setting the file. One moment.
Subchapter 2.20
references/auto-patterns-dashboard/entity-page-view-actions.mdMarkdown2 KBView on GitHub
interface EntityPageViewActions {
primaryActions?: ActionGroup;
secondaryActions?: ActionGroup;
moreActions?: (CustomActionItem | DividerItem)[];
}
type ActionGroup = | { type: 'action'; action: { item: ActionItem } } | { type: 'menu'; menu: { label: string; items: (ActionItem | DividerItem)[] } };
interface DividerItem {
type: 'divider';
}
interface ActionItem {
id: string; // Must match resolver if custom
label: string;
type: 'create' | 'custom';
biName: string; // MANDATORY
create?: {
mode: 'page';
page: { id: string };
};
}
type CustomEntityPageActionResolver = (params: {
actionParams: { entity: any };
sdk: AutoPatternsSDK;
}) => ResolvedAction;'view' THEN supports primaryActions, secondaryActions, AND moreActions.'create' THEN create config is REQUIRED.'custom' THEN resolver implementation is REQUIRED.primaryActions for main workflow (e.g. Create).secondaryActions for supporting workflows.moreActions for less common/admin tasks.errorHandler for Wix APIs, none for external/SDK.{
primaryActions: {
type: 'action',
action: {
item: {
id: 'createEntity',
label: 'Create New',
type: 'create',
biName: 'create-entity-action',
create: {
mode: 'page',
page: { id: 'entity-edit-page' }
}
}
}
},
moreActions: [
{
id: 'duplicateEntity',
type: 'custom',
label: 'Duplicate',
biName: 'duplicate-entity-action'
}
]
}