ActiveUI

ActiveUI

  • User Guide
  • Developer Documentation

Home > @activeviam/activeui-sdk > ActionImplementationProperties

ActionImplementationProperties interface

Build an action offered to users in several places of the UI.

Signature:

export interface ActionImplementationProperties 

Properties

PropertyTypeDescription
execute(event: React.SyntheticEvent, actionPayload: ActionPayload) => voidCalled when the action is being interacted with.
getBadge(actionPayload: ActionPayload) => string | numberReturns a number or a string that will be displayed inside a badge on the bottom left corner of the icon. Not implementing this function means that no badge will be displayed.
getCaption(actionPayload: ActionPayload) => TranslationPayloadReturns the caption of the action. Defaults to 'errors.noCaption'.
getIconSrcKey(actionPayload: ActionPayload) => stringReturns the icon key for the action. Default to having no icon.
isAvailable(actionPayload: ActionPayload) => booleanReturns whether the action should be present in the UI. This can be used to hide actions dynamically based on the conditions in which it is used. Defaults to true.
isDisabled(actionPayload: ActionPayload) => booleanReturns whether the action should be disabled if present. This comes on top of isAvailable in order to still display the action but in a disabled mode. Defaults to false.
load(actionPayload: ActionPayload) => void | (() => void)Called when the action is loaded in the UI. Can return a function to perform some cleanup.
unload(actionPayload: ActionPayload) => voidCalled when the action is unloaded from the UI.

Remarks

For example in the title bar of a dock in a dashboard, or in context menus or other user event handlers. Most of its methods are optional but one, execute. The methods are given different payloads depending on the situation in which they are instantiated (see ActionSituation to have a list of the different situations).

  • ActionImplementationProperties interface
  • Properties
  • Remarks
Copyright © 2019 ActiveViam