Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend: Fix issues with dependencies when updating workflow layout context #3183

Merged
merged 1 commit into from
Nov 19, 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
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
Loading