pierrejeambrun commented on code in PR #51889:
URL: https://github.com/apache/airflow/pull/51889#discussion_r2161989907


##########
airflow-core/docs/administration-and-deployment/plugins.rst:
##########
@@ -195,18 +195,24 @@ definitions in Airflow.
     }
 
     # Creating a iframe view that will be rendered in the Airflow UI.
-    iframe_view_with_metadata = {
+    external_view_with_metadata = {
         "name": "Name of the Iframe View as displayed in the UI",
-        # Source URL of the iframe. This URL can be templated using context 
variables, depending on the location where the iframe is rendered
-        # the context variables available will be different, i.e a subset of 
(DAG_ID, RUN_ID, TASK_ID, MAP_INDEX)
-        "src": "https://example.com/{DAG_ID}/{RUN_ID}/{TASK_ID}";,
+        # Source URL of the external view. This URL can be templated using 
context variables, depending on the location where the external view is rendered
+        # the context variables available will be different, i.e a subset of 
(DAG_ID, RUN_ID, TASK_ID, MAP_INDEX).
+        "href": "https://example.com/{DAG_ID}/{RUN_ID}/{TASK_ID}";,
         # Destination of the iframe view. This is used to determine where the 
iframe will be loaded in the UI.
-        # Supported locations are Literal["nav", "dag", "dag_run", "task", 
"task_instance"]
+        # Supported locations are Literal["nav", "dag", "dag_run", "task", 
"task_instance"], default to "nav".
         "destination": "dag_run",
         # Optional icon, url to an svg file.
         "icon": "https://example.com/icon.svg";,
-        # Optional parameters, relative URL location when opening the iframe
-        "url_route": "/my_iframe_view",
+        # 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.
+        "dark_mode_icon": "https://example.com/dark_icon.svg";,
+        # Optional parameters, relative URL location for the iframe rendering. 
If not provided, external view will be rendeded as an external link. Should
+        # not contain a leading slash.
+        "url_route": "my_iframe_view",

Review Comment:
   We didn't plan this at the moment but that's a good point.
   
   I think it needs to work a bit differently, we don't need templating from 
the backend for this, but probably a way to store UI context variable via the 
url to be able to link directly to this. Just a thought, but for instance maybe 
we can store the the context variables inside query params, 
`url_route?dag_id=xxx&run_id=xxx`, this way in the IFrame components we can 
retrieve them and template the `href` to directly point to the appropriate 
resource. Allowing to share links/entrypoint on the iframe page.
   
   
   cc: @bbovenzi (I think that's UI work only at this point).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to