Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-3067

(www_rbac) Flask flash messages are not displayed properly (no background color)

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.10.0
    • Fix Version/s: 1.10.1
    • Component/s: ui
    • Labels:

      Description

      The Flask flash messages are not categorized properly (ref: http://flask.pocoo.org/docs/1.0/patterns/flashing/#flashing-with-categories). Then the default category would be 'message'. Flask AppBuilder would assign CSS class `alert-[category]` to that message when displaying it (ref: https://github.com/dpgaspar/Flask-AppBuilder/blob/master/flask_appbuilder/templates/appbuilder/flash.html ). But 'alert-message' is not specified in bootstrap-theme.css. This makes the the flash messages in the www_rbac UI come with no background color (please check the screenshots attached. We don't see this issue in www UI as all flash messages without categories are classed into 'info').

      Solution:

      • Add proper category when we invoke flash().
      • We can't use category 'error'. In bootstrap-theme.css, we don't have `alert-error` (we have `alert-danger` instead).

       

      Latest update:

      we update bootstrap-theme.css, to add CSS classes 'alert-message' and 'alert-error'. This may help minimize the changes we need to do.

        Attachments

        1. 1.png
          306 kB
          Xiaodong Deng
        2. 2.png
          329 kB
          Xiaodong Deng

          Issue Links

            Activity

              People

              • Assignee:
                xddeng Xiaodong Deng
                Reporter:
                xddeng Xiaodong Deng
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: