Skip to content

@serenity-is/corelib / DialogAddon

Interface: DialogAddon

Defined in: src/ui/dialogs/dialogaddons.tsx:27

Something that a feature adds to the dialogs of an entity type: a tab, e.g. the history of the record or a dashboard, or a toolbar button or menu item, e.g. a link to a page with the record in its address. The addons of an entity type come from the sources (see DialogAddons.addSource), e.g. the providers of the server, and the components of the tabs from DialogAddons.registerComponent.

The texts of Title, Url and Options may have placeholders of the fields of the record, e.g. "~/Dashboards/customer?f.Customer=", which are filled from the record as it is edited, URL-encoded in the address. An addon whose placeholder has no value, e.g. as no customer is chosen yet, is not shown until it has one.

Properties

Component?

optional Component: string

Defined in: src/ui/dialogs/dialogaddons.tsx:41

The key of the component that a tab shows, or that a button or a menu item opens in a dialog.


Hint?

optional Hint: string

Defined in: src/ui/dialogs/dialogaddons.tsx:37

The hint of a button or a menu item.


Icon?

optional Icon: string

Defined in: src/ui/dialogs/dialogaddons.tsx:35

The icon, e.g. "fa fa-history".


Key

Key: string

Defined in: src/ui/dialogs/dialogaddons.tsx:29

The key of the addon, unique in a dialog, e.g. "History", which is the key of its tab.


Options?

optional Options: Record<string, any>

Defined in: src/ui/dialogs/dialogaddons.tsx:51

The options of the component.


Order?

optional Order: number

Defined in: src/ui/dialogs/dialogaddons.tsx:39

The order of the addon among the others, lower first.


Placement?

optional Placement: string

Defined in: src/ui/dialogs/dialogaddons.tsx:31

Where it is placed, a tab by default.


ShowForNew?

optional ShowForNew: boolean

Defined in: src/ui/dialogs/dialogaddons.tsx:49

Whether it is shown for a new record too, false by default.


Target?

optional Target: string

Defined in: src/ui/dialogs/dialogaddons.tsx:45

The target of the address, e.g. "_blank".


Title?

optional Title: string

Defined in: src/ui/dialogs/dialogaddons.tsx:33

The title of the tab, the button or the menu item, which may be a local text key.


Url?

optional Url: string

Defined in: src/ui/dialogs/dialogaddons.tsx:43

The address that a button or a menu item opens, instead of a component.


VisibleOnTab?

optional VisibleOnTab: string

Defined in: src/ui/dialogs/dialogaddons.tsx:47

The key of the tab of the form that a button or a menu item is shown on only.