Skip to content

Commit 3936683

Browse files
authored
Use dag_display_name aliases when possible in the UI (#50305)
1 parent 407ef72 commit 3936683

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

airflow-core/src/airflow/ui/src/components/TriggerDag/TriggerDAGForm.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { Checkbox } from "../ui/Checkbox";
3434
import EditableMarkdown from "./EditableMarkdown";
3535

3636
type TriggerDAGFormProps = {
37+
readonly dagDisplayName: string;
3738
readonly dagId: string;
3839
readonly isPaused: boolean;
3940
readonly onClose: () => void;
@@ -47,7 +48,7 @@ export type DagRunTriggerParams = {
4748
note: string;
4849
};
4950

50-
const TriggerDAGForm = ({ dagId, isPaused, onClose, open }: TriggerDAGFormProps) => {
51+
const TriggerDAGForm = ({ dagDisplayName, dagId, isPaused, onClose, open }: TriggerDAGFormProps) => {
5152
const [errors, setErrors] = useState<{ conf?: string; date?: unknown }>({});
5253
const [formError, setFormError] = useState(false);
5354
const initialParamsDict = useDagParams(dagId, open);
@@ -149,7 +150,7 @@ const TriggerDAGForm = ({ dagId, isPaused, onClose, open }: TriggerDAGFormProps)
149150
</ConfigForm>
150151
{isPaused ? (
151152
<Checkbox checked={unpause} colorPalette="blue" onChange={() => setUnpause(!unpause)}>
152-
Unpause {dagId} on trigger
153+
Unpause {dagDisplayName} on trigger
153154
</Checkbox>
154155
) : undefined}
155156
<ErrorAlert error={errors.date ?? errorTrigger} />

airflow-core/src/airflow/ui/src/components/TriggerDag/TriggerDAGModal.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,13 @@ const TriggerDAGModal: React.FC<TriggerDAGModalProps> = ({
114114
) : undefined}
115115

116116
{runMode === RunMode.SINGLE ? (
117-
<TriggerDAGForm dagId={dagId} isPaused={isPaused} onClose={onClose} open={open} />
117+
<TriggerDAGForm
118+
dagDisplayName={dagDisplayName}
119+
dagId={dagId}
120+
isPaused={isPaused}
121+
onClose={onClose}
122+
open={open}
123+
/>
118124
) : (
119125
hasSchedule && dag && <RunBackfillForm dag={dag} onClose={onClose} />
120126
)}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const runColumns = (dagId?: string): Array<ColumnDef<DAGRunResponse>> => [
5353
? []
5454
: [
5555
{
56-
accessorKey: "dag_id",
56+
accessorKey: "dag_display_name",
5757
enableSorting: false,
5858
header: "Dag ID",
5959
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const taskInstanceColumns = (
5757
? []
5858
: [
5959
{
60-
accessorKey: "dag_id",
60+
accessorKey: "dag_display_name",
6161
enableSorting: false,
6262
header: "Dag ID",
6363
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const columns: Array<ColumnDef<XComResponse>> = [
4040
accessorKey: "dag_id",
4141
cell: ({ row: { original } }) => (
4242
<Link asChild color="fg.info" fontWeight="bold">
43-
<RouterLink to={`/dags/${original.dag_id}`}>{original.dag_id}</RouterLink>
43+
<RouterLink to={`/dags/${original.dag_id}`}>{original.dag_display_name}</RouterLink>
4444
</Link>
4545
),
4646
enableSorting: false,

0 commit comments

Comments
 (0)