1
1
import AlertTitle from "@mui/material/AlertTitle" ;
2
2
import Button from "@mui/material/Button" ;
3
3
import { workspaceResolveAutostart } from "api/queries/workspaceQuota" ;
4
- import { TemplateVersion , Workspace } from "api/typesGenerated" ;
4
+ import { Template , TemplateVersion , Workspace } from "api/typesGenerated" ;
5
5
import { Alert , AlertDetail } from "components/Alert/Alert" ;
6
6
import { FC , useEffect , useState } from "react" ;
7
7
import { useQuery } from "react-query" ;
@@ -11,6 +11,7 @@ import dayjs from "dayjs";
11
11
12
12
type WorkspaceNotificationsProps = {
13
13
workspace : Workspace ;
14
+ template : Template ;
14
15
permissions : WorkspacePermissions ;
15
16
onRestartWorkspace : ( ) => void ;
16
17
latestVersion ?: TemplateVersion ;
@@ -19,7 +20,13 @@ type WorkspaceNotificationsProps = {
19
20
export const WorkspaceNotifications : FC < WorkspaceNotificationsProps > = (
20
21
props ,
21
22
) => {
22
- const { workspace, latestVersion, permissions, onRestartWorkspace } = props ;
23
+ const {
24
+ workspace,
25
+ template,
26
+ latestVersion,
27
+ permissions,
28
+ onRestartWorkspace,
29
+ } = props ;
23
30
24
31
// Outdated
25
32
const canAutostartResponse = useQuery (
@@ -136,6 +143,13 @@ export const WorkspaceNotifications: FC<WorkspaceNotificationsProps> = (
136
143
</ AlertDetail >
137
144
</ Alert >
138
145
) }
146
+
147
+ { template . deprecated && (
148
+ < Alert severity = "warning" >
149
+ < AlertTitle > Workspace using deprecated template</ AlertTitle >
150
+ < AlertDetail > { template . deprecation_message } </ AlertDetail >
151
+ </ Alert >
152
+ ) }
139
153
</ >
140
154
) ;
141
155
} ;
0 commit comments