FleetbaseFleetbase
Order PresentationCustomizing

Actions

Hide Fleet-Ops' built-in order actions — dispatch, driver assignment, cancel, delete and more — from the orders table and the order details menu for your order type, with hidden.actions.

Actions

hidden.actions removes Fleet-Ops' built-in order actions, by id, from:

  • the orders table: each row's "…" menu;
  • the order details view: the header's "…" menu.
hidden: {
    actions: ['dispatch', 'assign-driver', 'unassign-driver', 'view-label'],
},

Action Ids

IdActionOrders tableDetails menu
viewView order✓
dispatchDispatch order✓
assign-driverAssign driver✓✓
unassign-driverUnassign driver✓✓
edit-order-detailsEdit details✓
update-activityUpdate activity✓
view-labelView order label✓
listen-to-socket-channelListen to socket channel✓
view-metadataView metadata✓
cancelCancel order✓✓
deleteDelete order✓✓

These are the same ids the order views use in their resource view registries, so hidden.actions: ['cancel'] and another extension's .before('cancel') refer to the same action.

Ids are matched exactly. assign-driver and unassign-driver are two actions: the menu shows one or the other depending on whether the order has a driver, so hide both if neither applies.

The details menu drops separators that hiding leaves at its start, its end, or next to each other.

Examples

An Order Type That Is Never Dispatched

hidden: {
    actions: ['dispatch', 'assign-driver', 'unassign-driver', 'view-label'],
},

One That Can't Be Deleted from the Console

hidden: {
    actions: ['delete'],
},

One Managed Entirely from Your Own Screens

hidden: {
    actions: ['dispatch', 'assign-driver', 'unassign-driver', 'edit-order-details', 'update-activity', 'cancel', 'delete'],
},

Your Own Actions

Hiding applies to Fleet-Ops' built-in actions. To add an action for your order type, register it in the order views' resource view registries, and show it only for your orders:

import { ResourceAction } from '@fleetbase/ember-core/contracts';

universe.getService('resource-view').register(
    'fleet-ops:order:details:menu',
    new ResourceAction({ id: 'acme-extend-rental', label: 'Extend rental…', icon: 'calendar-plus' })
        .before('cancel')
        .visibleWhen((order) => order.order_config?.meta?.presentation_profile === 'acme-rental')
        .withHandler((order, ctx) => openExtendDialog(order, ctx))
);

The check reads the order config's meta directly: handlers run in the console's context, where Fleet-Ops' order-presentation service isn't available. See Menu Items and Row Actions.

Hiding an action isn't a permission. The action's API endpoint still works for anyone allowed to call it. To stop an order type being dispatched, or moved to activities outside its flow, give its config a configured lifecycle with dispatch: false and strict_transitions: true, which the API enforces.

Actions | Fleetbase