bbovenzi commented on code in PR #59095:
URL: https://github.com/apache/airflow/pull/59095#discussion_r2598892499
##########
airflow-core/src/airflow/ui/src/components/DurationChart.tsx:
##########
@@ -191,9 +192,17 @@ export const DurationChart = ({
}
case "Task Instance": {
const entry = entries[element.index] as TaskInstanceResponse |
undefined;
- const baseUrl =
`/dags/${entry?.dag_id}/runs/${entry?.dag_run_id}`;
- navigate(`${baseUrl}/tasks/${entry?.task_id}`);
+ const baseUrl = buildTaskInstanceUrl({
+ currentPathname: location.pathname,
+ dagId: entry?.dag_id ?? "",
Review Comment:
We could add a quick check to make sure entry isn't undefined before
creating the baseUrl. Then we wouldn't need these checks
##########
airflow-core/src/airflow/ui/src/components/DurationChart.tsx:
##########
@@ -191,9 +192,17 @@ export const DurationChart = ({
}
case "Task Instance": {
const entry = entries[element.index] as TaskInstanceResponse |
undefined;
- const baseUrl =
`/dags/${entry?.dag_id}/runs/${entry?.dag_run_id}`;
- navigate(`${baseUrl}/tasks/${entry?.task_id}`);
+ const baseUrl = buildTaskInstanceUrl({
+ currentPathname: location.pathname,
+ dagId: entry?.dag_id ?? "",
Review Comment:
We could add a quick check to make sure entry isn't undefined before
creating the baseUrl. Then we wouldn't need so many conditions
--
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]