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/21 19:19:42 UTC

[GitHub] [airflow] bbovenzi commented on a change in pull request #18405: Move tags filter cookie to frontend

bbovenzi commented on a change in pull request #18405:
URL: https://github.com/apache/airflow/pull/18405#discussion_r713348938



##########
File path: airflow/www/static/js/dags.js
##########
@@ -37,6 +37,20 @@ const lastDagRunsUrl = getMetaValue('last_dag_runs_url');
 const dagStatsUrl = getMetaValue('dag_stats_url');
 const taskStatsUrl = getMetaValue('task_stats_url');
 
+const FILTER_TAGS = 'filter_tags';
+
+const filterTags = localStorage.getItem(FILTER_TAGS);
+const initialQuery = new URLSearchParams(window.location.search);
+
+// Update the url if there is no tags query but localstorage has tags saved
+if (!initialQuery.has('tags') && filterTags) {
+  const tags = JSON.parse(filterTags);
+  tags.forEach((tag) => {
+    initialQuery.append('tags', tag);
+  });
+  window.location = `${DAGS_INDEX}?${initialQuery.toString()}`;

Review comment:
       Unfortunately, this one needed to stay. but reseting to no tags no longer requires 2 redirects.




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