bbovenzi commented on code in PR #47849:
URL: https://github.com/apache/airflow/pull/47849#discussion_r2058851370
##########
airflow/ui/src/pages/Asset/Asset.tsx:
##########
@@ -37,8 +37,8 @@ export const Asset = () => {
const { setTableURLState, tableURLState } = useTableURLState();
const { pagination, sorting } = tableURLState;
- const [sort] = sorting;
- const orderBy = sort ? `${sort.desc ? "-" : ""}${sort.id}` : "-timestamp";
+ const orderBy = new
URLSearchParams(globalThis.location.search).getAll("sort").length === 0 ?
+ ["-timestamp"] : new
URLSearchParams(globalThis.location.search).getAll("sort");
Review Comment:
```suggestion
const sortParam = new
URLSearchParams(globalThis.location.search).getAll("sort")
const orderBy = sortParam.length === 0 ?
["-timestamp"] : sortParam;
```
##########
airflow/ui/src/pages/Asset/Asset.tsx:
##########
@@ -37,8 +37,8 @@ export const Asset = () => {
const { setTableURLState, tableURLState } = useTableURLState();
const { pagination, sorting } = tableURLState;
- const [sort] = sorting;
- const orderBy = sort ? `${sort.desc ? "-" : ""}${sort.id}` : "-timestamp";
+ const orderBy = new
URLSearchParams(globalThis.location.search).getAll("sort").length === 0 ?
+ ["-timestamp"] : new
URLSearchParams(globalThis.location.search).getAll("sort");
Review Comment:
I won't comment on every single occurrence but let's try to keep our code
DRY.
Since this is so common, maybe we can even pull it into its own util
function or hook?
--
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]