Skip to content

Commit

Permalink
Handle known type but unknown route in the ReconciledObjects table
Browse files Browse the repository at this point in the history
  • Loading branch information
jpellizzari committed Dec 6, 2022
1 parent f643741 commit 6392e90
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ui/components/ReconciledObjectsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,14 @@ function ReconciledObjectsTable({
// and we want to be able to link to those within this table.
// The resolver func provided by the context will decide what URL this routes to.
const resolved = resolver && resolver(u.type, params);
return kind || resolved ? (
<Link
to={resolved || formatURL(objectTypeToRoute(kind), params)}
>
{u.name}
</Link>
) : (
const route = objectTypeToRoute(kind);
const formatted = formatURL(route, params);

if (route || resolved) {
return <Link to={resolved || formatted}>{u.name}</Link>;
}

return (
<Text
onClick={() => (secret ? null : setNodeYaml(u))}
color={secret ? "neutral40" : "primary10"}
Expand Down

0 comments on commit 6392e90

Please sign in to comment.