Skip to content

Commit

Permalink
BUG: fixing frontend build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
powersaudrey25 authored and zmorris248 committed Feb 29, 2024
1 parent 86b0fbb commit 1346e7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
15 changes: 1 addition & 14 deletions job_monitoring_app/frontend/src/components/EventTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,11 @@ export const EventTimeline: React.FC<EventTimelineProps> = ({
isLast,
metadataConfigurations
}) => {
const propKind = kind === "In progress" ? "in_progress" : KINDS[kind.toLowerCase()].toLowerCase();
const propKind = kind.toLowerCase() === "in progress" ? "in_progress" : kind.toLowerCase() as Kind;
const circleBg = bgColors[propKind];
const circleSize = propKind === "info" ? MINI_CIRCLE_SIZE : CIRCLE_SIZE;
const IconComponent = IconComponents[propKind];
const metadataRef = useRef<HTMLElement>(null);
const [timelineHeight, setTimelineHeight] = useState(
DEFAULT_TIMELINE_HEIGHT_PX
);

useEffect(() => {
if (metadataRef.current) {
if (metadataRef.current.clientHeight > DEFAULT_TIMELINE_HEIGHT_PX) {
setTimelineHeight(metadataRef.current.clientHeight);
} else {
setTimelineHeight(DEFAULT_TIMELINE_HEIGHT_PX);
}
}
}, [metadata]);

return (
<Flex width={"100%"} alignItems={"center"} flex={1} gap={3}>
Expand Down
5 changes: 4 additions & 1 deletion job_monitoring_app/frontend/src/pages/jobs/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ import { useEffect, useMemo, useState } from "react";

// Define the type for the JobEventWithNumber interface.
type JobEventWithNumber = JobEvent & { event_number: number };
// Define the type for event kinds
type Kind = "error" | "pending" | "complete" | "in_progress" | "info";


/**
* The JobPage component is a React component that displays the details of a specific job.
Expand Down Expand Up @@ -220,7 +223,7 @@ function JobPage({ initialIsPageLoading = true }) {
metadataConfigurations={
event.step_configuration?.metadata_configurations
}
kind={event.kind}
kind={event.kind as Kind}
metadata={event.event_metadata}
/>
);
Expand Down

0 comments on commit 1346e7b

Please sign in to comment.