Skip to content

Commit

Permalink
frontend: Fix issues with dependencies when updating workflow layout …
Browse files Browse the repository at this point in the history
…context (#3183)
  • Loading branch information
septum authored Nov 19, 2024
1 parent f29174a commit d96e350
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions frontend/workflows/audit/src/logs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ const AuditLog: React.FC<AuditLogProps> = ({ heading, detailsPathPrefix, downloa

const theme = useTheme();
const shrink = useMediaQuery(theme.breakpoints.down("md"));
const workflowLayoutContent = useWorkflowLayoutContext();
const workflowLayoutContext = useWorkflowLayoutContext();

const genTimeRangeKey = () => `${startTime}-${endTime}-${new Date().toString()}`;

React.useEffect(() => {
if (theme.clutch.useWorkflowLayout) {
workflowLayoutContent.setHeaderContent(
workflowLayoutContext.setHeaderContent(
<Stack
direction={shrink ? "column" : "row"}
spacing={1}
Expand Down Expand Up @@ -113,7 +113,7 @@ const AuditLog: React.FC<AuditLogProps> = ({ heading, detailsPathPrefix, downloa
</Stack>
);
}
}, [isLoading, shrink]);
}, [isLoading, shrink, startTime, endTime]);

return (
<RootContainer spacing={2} direction="column" padding={theme.clutch.layout.gutter}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const CatalogLayout = ({
);
const projInfo = React.useMemo(() => ({ projectId, projectInfo }), [projectId, projectInfo]);
const theme = useTheme();
const workflowLayoutContent = useWorkflowLayoutContext();
const workflowLayoutContext = useWorkflowLayoutContext();

const redirectNotFound = () => navigate(`/${projectId}/notFound`, { replace: true });

Expand Down Expand Up @@ -74,13 +74,13 @@ const CatalogLayout = ({

React.useEffect(() => {
if (theme.clutch.useWorkflowLayout) {
workflowLayoutContent.setTitle(
workflowLayoutContext.setTitle(
`${projectInfo?.name ?? projectId}${title ? ` ${title}` : ""}`
);

workflowLayoutContent.setSubtitle(description ?? (projectInfo?.data?.description as string));
workflowLayoutContext.setSubtitle(description ?? (projectInfo?.data?.description as string));

workflowLayoutContent.setHeaderContent(
workflowLayoutContext.setHeaderContent(
projectInfo ? (
<QuickLinksAndSettings
linkGroups={(projectInfo.linkGroups as QuickLinkGroup[]) || []}
Expand All @@ -90,7 +90,7 @@ const CatalogLayout = ({
) : null
);
}
}, [description, projectInfo, title]);
}, [projectInfo, projectId, title, description, configLinks, quickLinkSettings]);

return (
<ProjectDetailsContext.Provider value={projInfo}>
Expand Down

0 comments on commit d96e350

Please sign in to comment.