shubhamraj-git commented on code in PR #43231:
URL: https://github.com/apache/airflow/pull/43231#discussion_r1810300060
##########
airflow/ui/src/pages/DagsList/DagsList.tsx:
##########
@@ -200,21 +200,33 @@ export const DagsList = () => {
<Heading py={3} size="md">
{pluralize("DAG", data?.total_entries)}
</Heading>
- {display === "card" ? (
- <Select
- data-testid="sort-by-select"
- onChange={handleSortChange}
- placeholder="Sort by…"
- value={orderBy}
- variant="flushed"
- width="200px"
- >
- <option value="dag_id">Sort by DAG ID (A-Z)</option>
- <option value="-dag_id">Sort by DAG ID (Z-A)</option>
- </Select>
- ) : (
- false
- )}
+ <Select
+ data-testid="sort-by-select"
+ onChange={handleSortChange}
+ placeholder="Sort by…"
+ value={orderBy}
+ variant="flushed"
+ width="200px"
+ >
+ <option value="dag_display_name">Sort by Display Name
(A-Z)</option>
+ <option value="-dag_display_name">
+ Sort by Display Name (A-Z)
+ </option>
+ <option value="next_dagrun">Sort by Next DAG Run (A-Z)</option>
+ <option value="-next_dagrun">Sort by Next DAG Run (Z-A)</option>
+ <option value="last_dagrun_state">
+ Sort by Last Run State (A-Z)
+ </option>
+ <option value="-last_dagrun_state">
Review Comment:
My bad,
I was directly searching in the database `dag`, where I couldn't find these
columns, so thought to give a dummy name for now. But later found out that last
dag run state and start are in `dag_run` with name as `state` and `start_date`.
We follow a mapping :
`"last_run_state": DagRun.state,
"last_run_start_date": DagRun.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]