Button Block Addon (buttonBlockAddon)

The purpose of this block is to display interactive buttons in documents source block (interfaceDocumentsSourceBlock).

Usage

As shown in the example below, buttonBlockAddon blocks should be placed inside interfaceDocumentsSourceBlock blocks.

Properties

Property NameDescriptionExampleStatus

Button Name (name)

The label (name) of the button as displayed to the user

"Approve", "Reject"

UI Class (uiClass)

The UI class of the button

β€œbtn-approve”, β€œbtn-reject”, β€œbtn-link”

Dialog (dialog)

Determines if a dialog should be opened after the button is clicked

true, false.

Dialog Options (dialogOptions)

Will be shown only if the Dialog setting is set to true.

  1. Dialog Title (dialogOptions.dialogTitle): The title of the dialog. Example: β€œRejection”.

  2. Dialog Description (dialogOptions.dialogDescription): The description of the dialog. Example: β€œEnter reject reason”.

  3. Dialog Result Field Path (dialogOptions.dialogResultFieldPath): The field which will contain the result value from the dialog. Example: β€œoption.comment”.

Events

Button block addon events will be automatically added to document source.

API

The API for the buttonBlockAddon features both GET and POST methods:

  1. Example response to the GET request:

{
    "id": "4e43f63f-f2e9-4336-a69e-931ec4aafaee",
    "blockType": "buttonBlockAddon",
    "dialog": true,
    "dialogOptions": {
        "dialogTitle": "Reject",
        "dialogDescription": "Enter reject reason",
        "dialogResultFieldPath": "option.comment"
    },
    "name": "Reject",
    "uiClass": "btn-reject",
}

The response to the GET request includes all block settings.

  1. Example payload for the POST request:

{
  "documentId": "66b2838927c34db3c18e3c49",
  "dialogResult": "Typo in name"
}

Where

documentId - selected document identifier.

dialogResult is used for the dialog only.

Last updated