Skip to content

Commit

Permalink
Adds null check to partition key URL
Browse files Browse the repository at this point in the history
  • Loading branch information
skrawcz committed Aug 14, 2024
1 parent a91d5df commit 9c3872b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion telemetry/ui/src/components/routes/AppList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
}}
/>
Expand Down
2 changes: 1 addition & 1 deletion telemetry/ui/src/components/routes/app/StepList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 9c3872b

Please sign in to comment.