Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions airflow-core/docs/administration-and-deployment/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ definitions in Airflow.

.. seealso:: :doc:`/howto/define-extra-link`

.. _plugin-scoping:

Scoping a view to specific Dags and tasks
-----------------------------------------

Expand Down Expand Up @@ -566,6 +568,53 @@ Each invocation is a fresh process, so every warning for every plugin is reporte
who knows the ``url_route`` can still navigate to it directly. Use access control to
restrict who may view a plugin's data.

.. _plugin-ui-actions:

UI actions
----------

``ui_actions`` adds a button beside the actions Airflow already draws for an entity, rather
than a whole page. See :doc:`/howto/custom-action-plugin` for the full guide; the fields are:

.. code-block:: python

link_action = {
# Required. The button's tooltip and its accessible label, so write it as a label.
# A React action is also registered on the page under this name, which must therefore
# be unique across every React app and React action in the deployment.
"name": "Open runbook",
# Required. "link" opens a URL; "react" mounts a component of your own.
"action_type": "link",
# Required. Which entity the button belongs to, and so which surfaces it appears on:
# "dag", "dag_run" or "task_instance".
"destination": "dag",
# Required for "link". Templated with the entity's context, the same
# {DAG_ID}-style tokens an external view's href accepts.
"href": "https://runbooks.example.com/{DAG_ID}",
# Optional icon, url to an svg file. Defaults to a generic action icon.
"icon": "https://example.com/icon.svg",
# Optional dark icon for the dark theme, url to an svg file. If not provided, "icon"
# will be used for both light and dark themes.
"icon_dark_mode": "https://example.com/dark_icon.svg",
# Optional scoping, the same block external views and React apps take.
# See "Scoping a view to specific Dags and tasks" above.
"applies_to": {"dag.tags.name": ["production"]},
}

react_action = {
"name": "Inspect payload",
"action_type": "react",
"destination": "task_instance",
# Required for "react". Each React action needs its own bundle: the shared global is
# cleared before each import, and a browser will not re-execute a module it already has.
"bundle_url": "https://example.com/static/js/inspect_payload.js",
}

An action naming a field no record has is withheld rather than shown unscoped, and an action
Airflow cannot render is skipped with a warning while the plugin's other contributions load.

.. _plugin-react-props:

React app context props
-----------------------

Expand Down
Loading
Loading