Skip to content

Commit c969df5

Browse files
committed
Move deprecated notification
1 parent 17ecf0e commit c969df5

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

site/src/pages/WorkspacePage/Workspace.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export interface WorkspaceProps {
4444
hideVSCodeDesktopButton?: boolean;
4545
buildInfo?: TypesGen.BuildInfoResponse;
4646
sshPrefix?: string;
47-
template?: TypesGen.Template;
47+
template: TypesGen.Template;
4848
canRetryDebugMode: boolean;
4949
handleBuildRetry: () => void;
5050
handleBuildRetryDebug: () => void;
@@ -189,6 +189,7 @@ export const Workspace: FC<WorkspaceProps> = ({
189189
<Stack direction="column" css={styles.firstColumnSpacer} spacing={4}>
190190
<WorkspaceNotifications
191191
workspace={workspace}
192+
template={template}
192193
latestVersion={latestVersion}
193194
permissions={permissions}
194195
onRestartWorkspace={handleRestart}
@@ -222,13 +223,6 @@ export const Workspace: FC<WorkspaceProps> = ({
222223
</Alert>
223224
)}
224225

225-
{template?.deprecated && (
226-
<Alert severity="warning">
227-
<AlertTitle>Workspace using deprecated template</AlertTitle>
228-
<AlertDetail>{template?.deprecation_message}</AlertDetail>
229-
</Alert>
230-
)}
231-
232226
{transitionStats !== undefined && (
233227
<WorkspaceBuildProgress
234228
workspace={workspace}

site/src/pages/WorkspacePage/WorkspaceNotifications.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import AlertTitle from "@mui/material/AlertTitle";
22
import Button from "@mui/material/Button";
33
import { workspaceResolveAutostart } from "api/queries/workspaceQuota";
4-
import { TemplateVersion, Workspace } from "api/typesGenerated";
4+
import { Template, TemplateVersion, Workspace } from "api/typesGenerated";
55
import { Alert, AlertDetail } from "components/Alert/Alert";
66
import { FC, useEffect, useState } from "react";
77
import { useQuery } from "react-query";
@@ -11,6 +11,7 @@ import dayjs from "dayjs";
1111

1212
type WorkspaceNotificationsProps = {
1313
workspace: Workspace;
14+
template: Template;
1415
permissions: WorkspacePermissions;
1516
onRestartWorkspace: () => void;
1617
latestVersion?: TemplateVersion;
@@ -19,7 +20,13 @@ type WorkspaceNotificationsProps = {
1920
export const WorkspaceNotifications: FC<WorkspaceNotificationsProps> = (
2021
props,
2122
) => {
22-
const { workspace, latestVersion, permissions, onRestartWorkspace } = props;
23+
const {
24+
workspace,
25+
template,
26+
latestVersion,
27+
permissions,
28+
onRestartWorkspace,
29+
} = props;
2330

2431
// Outdated
2532
const canAutostartResponse = useQuery(
@@ -136,6 +143,13 @@ export const WorkspaceNotifications: FC<WorkspaceNotificationsProps> = (
136143
</AlertDetail>
137144
</Alert>
138145
)}
146+
147+
{template.deprecated && (
148+
<Alert severity="warning">
149+
<AlertTitle>Workspace using deprecated template</AlertTitle>
150+
<AlertDetail>{template.deprecation_message}</AlertDetail>
151+
</Alert>
152+
)}
139153
</>
140154
);
141155
};

0 commit comments

Comments
 (0)