pierrejeambrun commented on code in PR #47849:
URL: https://github.com/apache/airflow/pull/47849#discussion_r2020629735


##########
airflow/ui/src/pages/DagsList/DagsList.tsx:
##########
@@ -166,8 +166,7 @@ export const DagsList = () => {
     searchParams.get(NAME_PATTERN_PARAM) ?? undefined,
   );
 
-  const [sort] = sorting;
-  const orderBy = sort ? `${sort.desc ? "-" : ""}${sort.id}` : 
"-last_run_start_date";
+  const orderBy = new 
URLSearchParams(globalThis.location.search).getAll("sort");

Review Comment:
   Also there are plenty of other places where we do sorting like that and that 
need to be updated to work with a list:
   `AssetList`, `Variables`, `Connections` etc.... (you can search for `const 
[sort] = sorting` in the code base)



##########
airflow/ui/src/pages/DagsList/DagsList.tsx:
##########
@@ -166,8 +166,7 @@ export const DagsList = () => {
     searchParams.get(NAME_PATTERN_PARAM) ?? undefined,
   );
 
-  const [sort] = sorting;
-  const orderBy = sort ? `${sort.desc ? "-" : ""}${sort.id}` : 
"-last_run_start_date";
+  const orderBy = new 
URLSearchParams(globalThis.location.search).getAll("sort");

Review Comment:
   You are missing the default sorting value.
   
   By default if sort wasn't defined it would default to `-last_run_start_date`



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

Reply via email to