bbovenzi commented on code in PR #41144:
URL: https://github.com/apache/airflow/pull/41144#discussion_r1713979913
##########
airflow/www/static/js/connection_form.js:
##########
@@ -234,11 +234,18 @@ $(document).ready(() => {
/**
* Displays the Flask style alert on UI via JS
*
- * @param {boolean} status - true for success, false for error
+ * @param {string} status - Status can be either success, error, or warning
* @param {string} message - The text message to show in alert box
*/
function displayAlert(status, message) {
- const alertClass = status ? "alert-success" : "alert-error";
+ let alertClass;
+ if (status === "success") {
+ alertClass = "alert-success";
+ } else if (status === "error") {
+ alertClass = "alert-error";
+ } else if (status === "warning") {
+ alertClass = "alert-warning";
+ }
Review Comment:
```suggestion
const alertClass = `alert-${status}`;
```
--
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]