Skip to content

Commit

Permalink
fix(ui): logs terminal was still referencing layer.id which doesn't e…
Browse files Browse the repository at this point in the history
…xist anymore
  • Loading branch information
Alan-pad committed May 17, 2024
1 parent 87d3c2d commit 94ad18a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const router = createBrowserRouter([
element: <Pulls />,
},
{
path: "logs/:namespace/:layerId?/:runId?",
path: "logs/:namespace?/:layerId?/:runId?",
element: <Logs />,
},
],
Expand Down
1 change: 0 additions & 1 deletion ui/src/clients/layers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export type Layers = {
};

export type Layer = {
id: string;
namespace: string;
name: string;
state: LayerState;
Expand Down
10 changes: 5 additions & 5 deletions ui/src/pages/Logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Layer } from "@/clients/layers/types";

const Logs: React.FC = () => {
const { theme } = useContext(ThemeContext);
const { layerId, runId } = useParams();
const { namespace, layerId, runId } = useParams();
const [searchParams, setSerchParams] = useSearchParams();
const navigate = useNavigate();

Expand Down Expand Up @@ -113,7 +113,7 @@ const Logs: React.FC = () => {
run
? `/${run}`
: layer.latestRuns.length > 0
? `/${layer.lastRun}`
? `/${layer.lastRun.id}`
: ""
}`,
search: searchParams.toString(),
Expand Down Expand Up @@ -249,7 +249,7 @@ const Logs: React.FC = () => {
<RunCard
key={index}
variant={theme}
isActive={layerId === layer.id}
isActive={layerId === layer.name}
onClick={() => handleActive(layer)}
handleActive={handleActive}
layer={layer}
Expand All @@ -273,7 +273,7 @@ const Logs: React.FC = () => {
{layersQuery.isSuccess &&
layersQuery.data.results.length > 0 &&
(layerId &&
layersQuery.data.results.some((layer) => layer.id === layerId) ? (
layersQuery.data.results.some((layer) => layer.name === layerId) ? (
runId ? (
((activeLayerObject) =>
activeLayerObject && (
Expand All @@ -284,7 +284,7 @@ const Logs: React.FC = () => {
variant={theme}
/>
))(
layersQuery.data.results.find((layer) => layer.id === layerId)
layersQuery.data.results.find((layer) => layer.name === layerId)
)
) : (
<div className="flex items-center justify-center flex-1 min-w-0 sticky top-0">
Expand Down

0 comments on commit 94ad18a

Please sign in to comment.