File

src/app/core/entity-details/entity-actions-menu/entity-action.interface.ts

Description

Details of an action that users can trigger for a specific entity, displayed in the context menu.

Index

Properties

Properties

action
action: string
Type : string

ID for identifying this action in analytics, etc.

execute
execute: function
Type : function

The method being executed when the action is triggered.

icon
icon: string
Type : string
label
label: string
Type : string

human-readable label displayed in menu

permission
permission: EntityActionPermission
Type : EntityActionPermission
Optional

The "operation" for Entity Permissions checks that the user needs permission for executing this action.

primaryAction
primaryAction: boolean
Type : boolean
Optional

If marked as primary action, it will be displayed directly rather than hidden in the three-dot menu in some contexts.

tooltip
tooltip: string
Type : string
Optional
import { Entity } from "../../entity/model/entity";
import { EntityActionPermission } from "../../permissions/permission-types";

/**
 * Details of an action that users can trigger for a specific entity, displayed in the context menu.
 */
export interface EntityAction {
  /**
   * ID for identifying this action in analytics, etc.
   */
  action: string;

  /**
   * human-readable label displayed in menu
   */
  label: string;
  icon: string;
  tooltip?: string;

  /**
   * If marked as primary action, it will be displayed directly rather than hidden in the three-dot menu in some contexts.
   */
  primaryAction?: boolean;

  /**
   * The "operation" for Entity Permissions checks that the user needs permission for executing this action.
   */
  permission?: EntityActionPermission;

  /**
   * The method being executed when the action is triggered.
   * @param e The entity on which the action is executed
   */
  execute: (entity: Entity, navigateOnDelete?: boolean) => Promise<boolean>;
}

results matching ""

    No results matching ""