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 2022/10/21 02:22:50 UTC

[GitHub] [airflow] BobDu commented on a diff in pull request #27141: Fix some bug in web ui dags list page (auto-refresh & jump search null state)

BobDu commented on code in PR #27141:
URL: https://github.com/apache/airflow/pull/27141#discussion_r1001293687


##########
airflow/www/static/js/dags.js:
##########
@@ -204,33 +204,41 @@ function drawDagStatsForDag(dagId, states) {
     });
 
   g.append('svg:a')
-    .attr('href', (d) => `${dagRunUrl}?_flt_3_dag_id=${dagId}&_flt_3_state=${d.state}`)
+    .attr('href', (d) => {
+      const params = new URLSearchParams();
+      params.append('_flt_3_dag_id', dagId);
+      /* eslint no-unused-expressions: ["error", { "allowTernary": true }] */
+      d.state ? params.append('_flt_3_state', d.state) : params.append('_flt_8_state', '');

Review Comment:
   Sorry, we can't do this.
   See, #26584 
   If d.state is null, use params `_flt_8_state` , mean `Is Null`, else use `_flt_3_state `, mean `Equal to`.
   
   Of course, we can use `if ... else ...` statement block to  shake off eslint exception.
   But I still think use ternary expression maybe more suitable in it.



-- 
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