Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

fix: fix frontend handling undefined flow url #52

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions kontrol-frontend/src/components/CytoscapeGraph/Legend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,21 @@ const Legend = () => {
<Td>{flowId}</Td>
<Td textTransform={"capitalize"}>{isBaseline.toString()}</Td>
<Td whiteSpace={"nowrap"}>
<Link
href={`http://${flowUrls[0]}`}
isExternal
target="_blank"
display={"flex"}
alignItems={"center"}
gap={2}
>
{flowUrls[0].hostname}
<FiExternalLink size={12} />
</Link>
{flowUrls[0]?.hostname != null ? (
<Link
href={`http://${flowUrls[0]}`}
isExternal
target="_blank"
display={"flex"}
alignItems={"center"}
gap={2}
>
{flowUrls[0].hostname}
<FiExternalLink size={12} />
</Link>
) : (
"—"
)}
</Td>
<Td textAlign={"right"}>
{flowVisibility[flowId] === true ? (
Expand Down
7 changes: 4 additions & 3 deletions kontrol-frontend/src/contexts/ApiContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,21 @@ export interface ApiContextType {

const defaultContextValue: ApiContextType = {
deleteFlow: async () => [],
deleteTemplate: async () => { },
deleteTemplate: async () => {},
error: null,
getFlows: async () => [],
getTemplates: async () => { },
getTemplates: async () => {},
getTopology: async () => {
return { nodes: [], edges: [] };
},
loading: false,
postFlowCreate: async () => ({
"flow-id": "",
"access-entry": [],
"flow-urls": [],
isBaseline: false,
}),
postTemplateCreate: async () => { },
postTemplateCreate: async () => {},
templates: [],
};

Expand Down
Loading