Skip to content

feat: add frontend warning when autostart disabled due to automatic updates #10508

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

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
some minor updates
  • Loading branch information
sreya committed Nov 9, 2023
commit 97f9dedc334e846f9910c26d8405b41a59125c42
4 changes: 3 additions & 1 deletion site/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,9 @@ export const updateWorkspace = async (
export const getWorkspaceResolveAutostart = async (
workspaceId: string,
): Promise<TypesGen.ResolveAutostartResponse> => {
const response = await axios.get(`/api/v2/workspaces/${workspaceId}/resolve`);
const response = await axios.get(
`/api/v2/workspaces/${workspaceId}/resolve-autostart`,
);
return response.data;
};

Expand Down
36 changes: 19 additions & 17 deletions site/src/pages/WorkspacePage/Workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,23 +230,25 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({

<Margins css={styles.content}>
<Stack direction="column" css={styles.firstColumnSpacer} spacing={4}>
{requiresManualUpdate && workspace.outdated && (
<Alert severity="info">
<AlertTitle>An update is available for your workspace</AlertTitle>
{updateMessage && <AlertDetail>{updateMessage}</AlertDetail>}
</Alert>
)}
{requiresManualUpdate && (
<Alert severity="warning">
<AlertTitle>
Autostart has been disabled for your workspace.
</AlertTitle>
<AlertDetail>
Autostart is unable to automatically update your workspace.
Manually update your workspace to reenable Autostart.
</AlertDetail>
</Alert>
)}
{workspace.outdated &&
(requiresManualUpdate ? (
<Alert severity="warning">
<AlertTitle>
Autostart has been disabled for your workspace.
</AlertTitle>
<AlertDetail>
Autostart is unable to automatically update your workspace.
Manually update your workspace to reenable Autostart.
</AlertDetail>
</Alert>
) : (
<Alert severity="info">
<AlertTitle>
An update is available for your workspace
</AlertTitle>
{updateMessage && <AlertDetail>{updateMessage}</AlertDetail>}
</Alert>
))}
{buildError}
{cancellationError}
{workspace.latest_build.status === "running" &&
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/WorkspacePage/WorkspaceActions/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const actionsByWorkspaceStatus = (
}
if (
workspace.outdated &&
workspaceUpdatePolicy(workspace, canChangeVersions)
workspaceUpdatePolicy(workspace, canChangeVersions) === "always"
) {
if (status === "running") {
return {
Expand Down