guan404ming commented on code in PR #50416:
URL: https://github.com/apache/airflow/pull/50416#discussion_r2083270673


##########
airflow-core/src/airflow/ui/src/components/DurationChart.tsx:
##########
@@ -141,6 +144,29 @@ export const DurationChart = ({
         }}
         datasetIdKey="id"
         options={{
+          onClick: (_event, elements) => {
+            const [element] = elements;
+
+            if (!element) {
+              return;
+            }
+            if (kind === "Dag Run") {

Review Comment:
   nit: maybe we could use `switch` like line 109 to preserve the coding style 
consistency and extensibility



##########
airflow-core/src/airflow/ui/src/components/DurationChart.tsx:
##########
@@ -141,6 +144,29 @@ export const DurationChart = ({
         }}
         datasetIdKey="id"
         options={{
+          onClick: (_event, elements) => {
+            const [element] = elements;
+
+            if (!element) {
+              return;
+            }
+            if (kind === "Dag Run") {
+              const entry = entries[element.index];
+              const run = entry as DAGRunResponse;
+
+              navigate(`/dags/${run.dag_id}/runs/${run.dag_run_id}`);

Review Comment:
   nit: using like `baseUrl = /dags/${run.dag_id}/runs/` to store common path 
would be easier to maintain if we have more cases added in the future.



-- 
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]

Reply via email to