Skip to content

Commit ae9ae04

Browse files
Update default sort for connections and dags (#50600)
Co-authored-by: pierrejeambrun <[email protected]>
1 parent daa6115 commit ae9ae04

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

airflow-core/src/airflow/ui/src/pages/Connections/Connections.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ const columns: Array<ColumnDef<ConnectionResponse>> = [
8585
];
8686

8787
export const Connections = () => {
88-
const { setTableURLState, tableURLState } = useTableURLState({
89-
sorting: [{ desc: false, id: "connection_id" }],
90-
});
88+
const { setTableURLState, tableURLState } = useTableURLState();
9189
const [searchParams, setSearchParams] = useSearchParams();
9290
const { NAME_PATTERN: NAME_PATTERN_PARAM }: SearchParamsKeysType = SearchParamsKeys;
9391
const [connectionIdPattern, setConnectionIdPattern] = useState(
@@ -97,7 +95,7 @@ export const Connections = () => {
9795
useConnectionTypeMeta(); // Pre-fetch connection type metadata
9896
const { pagination, sorting } = tableURLState;
9997
const [sort] = sorting;
100-
const orderBy = sort ? `${sort.desc ? "-" : ""}${sort.id}` : "-connection_id";
98+
const orderBy = sort ? `${sort.desc ? "-" : ""}${sort.id}` : "connection_id";
10199
const { data, error, isFetching, isLoading } = useConnectionServiceGetConnections({
102100
connectionIdPattern: connectionIdPattern ?? undefined,
103101
limit: pagination.pageSize,

airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const columns: Array<ColumnDef<DAGWithLatestDagRunsResponse>> = [
7171
},
7272
},
7373
{
74-
accessorKey: "dag_id",
74+
accessorKey: "dag_display_name",
7575
cell: ({ row: { original } }) => (
7676
<Link asChild color="fg.info" fontWeight="bold">
7777
<RouterLink to={`/dags/${original.dag_id}`}>{original.dag_display_name}</RouterLink>
@@ -180,7 +180,7 @@ export const DagsList = () => {
180180
);
181181

182182
const [sort] = sorting;
183-
const orderBy = sort ? `${sort.desc ? "-" : ""}${sort.id}` : "-last_run_start_date";
183+
const orderBy = sort ? `${sort.desc ? "-" : ""}${sort.id}` : "dag_display_name";
184184

185185
const handleSearchChange = (value: string) => {
186186
if (value) {

0 commit comments

Comments
 (0)