You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/09/15 23:48:32 UTC
[GitHub] [airflow] jedcunningham commented on a change in pull request #18284: Display flash messages on dashboard from local settings
jedcunningham commented on a change in pull request #18284:
URL: https://github.com/apache/airflow/pull/18284#discussion_r709651623
##########
File path: airflow/settings.py
##########
@@ -519,3 +520,13 @@ def initialize():
# By default this is off, but is automatically configured on when running task
# instances
MASK_SECRETS_IN_LOGS = False
+
+# Display flash messages on the dashboard
+# Useful for warning about setup issues or announcing changes to end users
+# You can choose what role(s) the message will be shown to as well, or pass None to show to all users
+# (message, category, [role(s)]), for example:
+# ("Airflow update happening next week", "warning", ["User"])
+# You can also pass the message as flask.Markup to include HTML in the message:
+# (Markup('Visit <a href="http://airflow.apache.org">airflow.apache.org</a>'), "info", None)
+FlashMessage = Tuple[Union[str, Markup], str, Optional[str]]
Review comment:
I considered creating a class so we can simplify the experience here a bit, e.g. something like:
```
DASHBOARD_FLASH_MESSAGES = [
FlashMessage("Hello"),
FlashMessage("Word", roles=["Admin"]),
FlashMessage("example", category="Warning"),
]
```
Thoughts?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org