bbovenzi commented on code in PR #70699:
URL: https://github.com/apache/airflow/pull/70699#discussion_r3806790934


##########
airflow-core/src/airflow/ui/src/router.tsx:
##########
@@ -185,21 +185,22 @@ export const routerConfig = [
       pluginRoute,
       {
         children: [
-          { element: <Overview />, index: true },
-          { element: <DagRuns />, path: "runs" },
-          { element: <Tasks />, path: "tasks" },
-          { element: <Calendar />, path: "calendar" },
+          { element: <Overview />, handle: { entity: "dag", tab: "" }, index: 
true },
+          { element: <DagRuns />, handle: { entity: "dag", tab: "runs" }, 
path: "runs" },
+          { element: <Tasks />, handle: { entity: "dag", tab: "tasks" }, path: 
"tasks" },
+          { element: <Calendar />, handle: { entity: "dag", tab: "calendar" }, 
path: "calendar" },
           // The Required Actions tab is now a button + modal; this keeps old 
/required_actions
           // deep links alive by rendering the overview, where the route sync 
opens the modal.
           { element: <Overview />, path: "required_actions" },
-          { element: <Backfills />, path: "backfills" },
+          { element: <Backfills />, handle: { entity: "dag", tab: "backfills" 
}, path: "backfills" },
           { element: <Backfills />, path: "backfills/:backfillId" },
-          { element: <Events />, path: "events" },
-          { element: <Code />, path: "code" },
-          { element: <DagDetails />, path: "details" },
+          { element: <Events />, handle: { entity: "dag", tab: "events" }, 
path: "events" },
+          { element: <Code />, handle: { entity: "dag", tab: "code" }, path: 
"code" },
+          { element: <DagDetails />, handle: { entity: "dag", tab: "details" 
}, path: "details" },
           pluginRoute,
         ],
         element: <Dag />,
+        handle: { entity: "dag" },

Review Comment:
   ```suggestion
   ```
   
   Dead code



##########
airflow-core/src/airflow/ui/src/utils/links.ts:
##########
@@ -54,6 +54,49 @@ export const getRedirectPath = (targetPath: string): string 
=> {
 export const getNextHref = (location: Pick<Location, "hash" | "pathname" | 
"search">): string =>
   `${location.pathname}${location.search}${location.hash}`;
 
+type RouteMatch = {
+  readonly handle: unknown;
+  readonly params: Record<string, string | undefined>;

Review Comment:
   We're never reading `match.params`



##########
airflow-core/src/airflow/ui/src/utils/links.ts:
##########
@@ -54,6 +54,49 @@ export const getRedirectPath = (targetPath: string): string 
=> {
 export const getNextHref = (location: Pick<Location, "hash" | "pathname" | 
"search">): string =>
   `${location.pathname}${location.search}${location.hash}`;
 
+type RouteMatch = {
+  readonly handle: unknown;
+  readonly params: Record<string, string | undefined>;
+};
+
+type TabRouteHandle = {
+  readonly entity: string;
+  readonly tab?: string;

Review Comment:
   These should probably be enums for better type safety.



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