Skip to main content
Quick actions are shortcuts that appear in the FDO application’s quick action toolbar. When a user selects one, FDO sends a UI_MESSAGE to your plugin with the message_type you specified. You register a handler for that type in init() to respond.

The QuickAction type

type QuickAction = {
    name: string;         // display label shown in the toolbar
    message_type: string; // handler name triggered when the user selects this action
    subtitle?: string;    // optional secondary text shown below the name
    icon?: string;        // optional icon identifier
};

Adding QuickActionMixin

Apply QuickActionMixin to your plugin class to unlock the defineQuickActions() method. The mixin pattern wraps your base class — you can chain multiple mixins:
import {
    FDO_SDK,
    FDOInterface,
    PluginMetadata,
    QuickActionMixin,
    QuickAction,
} from "@anikitenko/fdo-sdk";

const MyPluginBase = QuickActionMixin(FDO_SDK);

export default class MyPlugin extends MyPluginBase implements FDOInterface {
    // ...
}
If you need both QuickActionMixin and SidePanelMixin, chain them:
const MyPluginBase = SidePanelMixin(QuickActionMixin(FDO_SDK));

Defining quick actions

Override defineQuickActions() and return an array of QuickAction objects. FDO calls this method during plugin initialization to collect the actions it should display.
defineQuickActions(): QuickAction[] {
    return [
        {
            name: "Search Plugin Data",
            message_type: "quickSearch",
            subtitle: "Search through plugin data",
            icon: "search.png"
        },
        {
            name: "Create New Item",
            message_type: "quickCreate",
            subtitle: "Create a new item in the plugin",
            icon: "create.png"
        },
        {
            name: "Plugin Settings",
            message_type: "quickSettings",
            icon: "settings.png"
        }
    ];
}
Return an empty array from defineQuickActions() if an error occurs — never throw. A thrown exception here will prevent plugin initialization from completing.
defineQuickActions(): QuickAction[] {
    try {
        return [ /* ... */ ];
    } catch (error) {
        this.error(error as Error);
        return [];
    }
}

Registering handlers

Every message_type value you use in defineQuickActions() needs a matching handler registered in init(). When the user selects a quick action, FDO sends a UI_MESSAGE with that message_type as the handler name.
init(): void {
    PluginRegistry.registerHandler("quickSearch", (data: any) => {
        this.log("Quick search triggered");
        return { success: true, view: "search" };
    });

    PluginRegistry.registerHandler("quickCreate", (data: any) => {
        this.log("Quick create triggered");
        return { success: true, view: "create" };
    });

    PluginRegistry.registerHandler("quickSettings", (data: any) => {
        this.log("Quick settings triggered");
        return { success: true, view: "settings" };
    });
}
If you define a quick action with a message_type that has no registered handler, selecting that action will result in an error response from the plugin. Register all handlers in init() before the plugin finishes loading.

Icon field

The icon field is a string identifier for the icon displayed alongside the action name in the FDO UI. Refer to the FDO host documentation for supported icon identifiers.

Full example

The following is adapted from examples/04-ui-extensions-plugin.ts:
import {
    FDO_SDK,
    FDOInterface,
    PluginMetadata,
    PluginRegistry,
    QuickActionMixin,
    SidePanelMixin,
    QuickAction,
    SidePanelConfig,
    DOMText,
    DOMNested,
    DOMInput,
    DOMButton,
} from "@anikitenko/fdo-sdk";

const UIExtensionsPluginBase = SidePanelMixin(QuickActionMixin(FDO_SDK));

export default class UIExtensionsPlugin extends UIExtensionsPluginBase implements FDOInterface {
    private readonly _metadata: PluginMetadata = {
        name: "UI Extensions Plugin Example",
        version: "1.0.0",
        author: "FDO SDK Team",
        description: "Demonstrates quick actions and side panel integration using mixins",
        icon: "panel-table"
    };

    private currentView: string = "default";

    get metadata(): PluginMetadata { return this._metadata; }

    init(): void {
        try {
            this.log("UIExtensionsPlugin initialized!");

            PluginRegistry.registerHandler("quickSearch", (data: any) => {
                this.currentView = "search";
                this.log("Quick search triggered");
                return { success: true, view: "search", message: "Search view activated" };
            });

            PluginRegistry.registerHandler("quickCreate", (data: any) => {
                this.currentView = "create";
                this.log("Quick create triggered");
                return { success: true, view: "create", message: "Create view activated" };
            });

            PluginRegistry.registerHandler("quickSettings", (data: any) => {
                this.currentView = "settings";
                this.log("Quick settings triggered");
                return { success: true, view: "settings", message: "Settings view activated" };
            });
        } catch (error) {
            this.error(error as Error);
        }
    }

    defineQuickActions(): QuickAction[] {
        try {
            return [
                {
                    name: "Search Plugin Data",
                    message_type: "quickSearch",
                    subtitle: "Search through plugin data",
                    icon: "search.png"
                },
                {
                    name: "Create New Item",
                    message_type: "quickCreate",
                    subtitle: "Create a new item in the plugin",
                    icon: "create.png"
                },
                {
                    name: "Plugin Settings",
                    message_type: "quickSettings",
                    icon: "settings.png"
                }
            ];
        } catch (error) {
            this.error(error as Error);
            return [];
        }
    }

    render(): string {
        const domText = new DOMText();
        const domNested = new DOMNested();

        return domNested.createBlockDiv([
            domText.createHText(1, this._metadata.name),
            domText.createPText(this._metadata.description),
            domNested.createBlockDiv([
                domText.createHText(3, "Quick Actions"),
                domText.createPText("Use the quick action menu to trigger the following:"),
                domNested.createList([
                    "Search Plugin Data",
                    "Create New Item",
                    "Plugin Settings"
                ])
            ], {
                style: {
                    marginTop: "20px",
                    padding: "15px",
                    backgroundColor: "#fff3cd",
                    borderRadius: "5px"
                }
            })
        ], {
            style: { padding: "20px", fontFamily: "Arial, sans-serif" }
        });
    }
}

new UIExtensionsPlugin();

Checklist

1

Apply QuickActionMixin

Wrap FDO_SDK (or a chained mixin) with QuickActionMixin before defining your class.
2

Override defineQuickActions()

Return an array of QuickAction objects. Wrap the body in try/catch and return [] on error.
3

Register a handler for each message_type

In init(), call PluginRegistry.registerHandler(message_type, handler) for every message_type defined in your quick actions.
4

Handle the response in your plugin

Your handler receives the data sent by the FDO host and should return a result. Use the returned data to update plugin state or trigger a re-render.