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 2019/07/03 14:14:26 UTC

[GitHub] [airflow] shuwen-zhang commented on a change in pull request #5516: [AIRFLOW-4884] Roll up import_errors in UI

shuwen-zhang commented on a change in pull request #5516: [AIRFLOW-4884] Roll up import_errors in UI
URL: https://github.com/apache/airflow/pull/5516#discussion_r299979821
 
 

 ##########
 File path: airflow/www/templates/appbuilder/flash.html
 ##########
 @@ -0,0 +1,68 @@
+<!-- Adapted from: https://github.com/dpgaspar/Flask-AppBuilder/blob/master/flask_appbuilder/templates/appbuilder/flash.html -->
+
+<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/flash.css') }}">
+
+<!-- Split array into two arrays: one about Broken DAG, another normal alert  -->
+{% with messages = get_flashed_messages(with_categories=true) %}
+    {% if messages %}
+
+        {% set broken_dag_messages = [] %}
+        {% set other_messages = [] %}
+
+        {% for category, m in messages %}
+            {% if m.startswith('Broken DAG') %}
 
 Review comment:
   Hi @ashb thanks for reviewing. Instead of matching string-prefix we could create another `category` like `quiet_error` or `collapsible_error`, and flash the Broken DAG error in airflow/www/views.py with that category instead. (Others could also flash messages with that category elsewhere.) Then in the flash.html file, we could filter for that new category and apply the alert-error css so those messages have the red background in the collapsible. What do you think of this approach?
   
   We’ll also add in the missing Apache license headers that led to the build fail.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services