How to add a custom button to the document quick actions bar?

Tabla de contenidos

Athento allows you to add 3 types of buttons to the quick actions bar in the document view:

  • Link type: so that when clicking, the user is redirected to a specific link
  • Button type: to execute an operation
  • Custom type: allows embedding the HTML code that the user wants

Screenshot 2024-07-28 at 16.22.04.png

These buttons are added and configured from the advanced administration, in Action Buttons.

Screenshot 2024-07-28 at 16.23.17.png

Create a new Action Button using the Add Action Button option.

Next, you must configure the following options:

  • Target content type: Select the value “doctypes | document type”.
  • Target object id: The form id where you want these buttons to appear.
  • Label: The help text that appears when hovering the mouse over the button.
  • Style: (in json format) The custom icon we want this button to have:

    • icon: icon we want to appear.
{"icon" : "fal fa-file-invoice"}
  • Place: The place where the button will appear. You must select “Document – Document quick actions”.
  • Operations: The operations that will be executed when pressing the button(if it is of type button).
  • Type: Select the type of button we want in the document view.

    • button: The selected operations are executed
    • link: The link we want to be redirected to is added when clicking
    • custom: The HTML element that we have configured in the html attribute of the button is displayed.

  • Params: If it is a Link type button, the URL must be added here in JSON format.
  • Html: If the button is of type Custom, this other attribute must be configured. It is the element to be displayed represented by the HTML code to render. For this functionality it is possible to include tags from the Django template engine.
  • Requires confirm: Only for button type buttons. If checked, the user is asked to confirm before executing the button operations. See the section Request confirmation before executing the operations.

Selección_203.png

Request confirmation before executing the operations

In button type buttons you can ask the user to confirm the action before executing the operations. It is useful for actions that have effects outside Athento or that should not be triggered by mistake, such as resending a signature reminder or sending a notification.

  1. Open the Action Button in the advanced administration.
  2. Check the Requires confirm option.
  3. Optionally, customize the confirmation window text in Params with the confirm_message key:
{"confirm_message": "Are you sure you want to resend the signature reminder?"}

When pressing the button, a confirmation window opens with that text. The operations are only executed if the user clicks Confirm; if they click Cancel, nothing is executed.

Considerations:

  • If you check Requires confirm but do not define confirm_message, a generic confirmation message is shown.
  • If Requires confirm is unchecked, the button executes the operations directly, as before, even if there is a confirm_message in Params.
  • Confirmation works the same in all places where an button type Action Button can be placed (for example, the document table of a tray or the Side Panel), not only in the quick actions bar.