jedcunningham commented on code in PR #48450:
URL: https://github.com/apache/airflow/pull/48450#discussion_r2017076134
##########
airflow-core/src/airflow/api_fastapi/common/types.py:
##########
@@ -96,3 +96,11 @@ class MenuItem(Enum):
PROVIDERS = "Providers"
VARIABLES = "Variables"
XCOMS = "XComs"
+
+
+class UIAlert(BaseModel):
+ """Optional alert to be shown at the top of the page."""
+
+ text: str
Review Comment:
Does this support markup too?
##########
airflow-core/src/airflow/settings.py:
##########
@@ -128,6 +130,19 @@
"upstream_failed": "orange",
}
+# Display alerts on the dashboard
+# Useful for warning about setup issues or announcing changes to end users
+# List of UIAlerts, which allows for specifying the message, category, and
roles the
+# message should be shown to. For example:
+# from airflow.www.utils import UIAlert
Review Comment:
```suggestion
# from airflow.api_fastapi.common.types import UIAlert
```
##########
airflow-core/src/airflow/api_fastapi/common/types.py:
##########
@@ -96,3 +96,11 @@ class MenuItem(Enum):
PROVIDERS = "Providers"
VARIABLES = "Variables"
XCOMS = "XComs"
+
+
+class UIAlert(BaseModel):
+ """Optional alert to be shown at the top of the page."""
+
+ text: str
+ category: Literal["info", "warning", "error"] | None = None
+ role: str | None = None
Review Comment:
We should drop the role part of this - there are no "roles" in core any
longer.
--
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]