Skip to content

armgit / burr

Public Imported from GitHub
0

Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.

Adds null check to partition key URL

Stefan Krawczyk9c3872bbc2db
diff --git a/telemetry/ui/src/components/routes/AppList.tsx b/telemetry/ui/src/components/routes/AppList.tsx
index af56f39d..ac8cf43c 100644
--- a/telemetry/ui/src/components/routes/AppList.tsx
+++ b/telemetry/ui/src/components/routes/AppList.tsx
@@ -40,6 +40,15 @@ const getForkID = (app: ApplicationSummary) => {
return null;
}
};
+
+const getParentPartitionKey = (app: ApplicationSummary) => {
+ if (app.parent_pointer) {
+ return app.parent_pointer.partition_key;
+ } else {
+ return null;
+ }
+};
+
/**
* Sub-application list -- handles spaned applications.
* This contains a list of applications that correspond to a parent application.
@@ -117,7 +126,9 @@ const AppSubList = (props: {
<MdForkRight
className=" hover:scale-125 h-5 w-5 text-gray-600 "
onClick={(e) => {
- props.navigate(`/project/${props.projectId}/${app.partition_key}/${forkID}`);
+ props.navigate(
+ `/project/${props.projectId}/${getParentPartitionKey(app) || 'null'}/${forkID}`
+ );
e.stopPropagation();
}}
/>
diff --git a/telemetry/ui/src/components/routes/app/StepList.tsx b/telemetry/ui/src/components/routes/app/StepList.tsx
index 4015dffa..a89dd16f 100644
--- a/telemetry/ui/src/components/routes/app/StepList.tsx
+++ b/telemetry/ui/src/components/routes/app/StepList.tsx
@@ -264,7 +264,7 @@ const LinkSubTable = (props: {
</TableCell>
<TableCell colSpan={1} className={` ${normalText} w-48 min-w-48 max-w-48 truncate`}>
<Link
- to={`/project/${props.projectId}/${subApp.child.partition_key}/${subApp.child.app_id}`}
+ to={`/project/${props.projectId}/${subApp.child.partition_key || 'null'}/${subApp.child.app_id}`}
>
<span className="hover:underline">{subApp.child.app_id}</span>
</Link>