Skip to content

fix: make workspace buttons less confusing when errors happen #10609

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

Closed
wants to merge 16 commits into from
Closed
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
Next Next commit
chore: update handleBuildRetry to auto-detect debug permissions
  • Loading branch information
Parkreiner committed Nov 15, 2023
commit 713e981ce7b8486ada7d6699e6a09a780f45e44f
12 changes: 9 additions & 3 deletions site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,16 @@ export const WorkspaceReadyPage = ({
handleCancel={cancelBuildMutation.mutate}
handleSettings={() => navigate("settings")}
handleBuildRetry={() => {
const logLevel = canRetryDebugMode ? "debug" : undefined;
switch (workspace.latest_build.transition) {
case "start":
startWorkspaceMutation.mutate({ logLevel: "debug" });
startWorkspaceMutation.mutate({ logLevel });
break;
case "stop":
stopWorkspaceMutation.mutate({ logLevel: "debug" });
stopWorkspaceMutation.mutate({ logLevel });
break;
case "delete":
deleteWorkspaceMutation.mutate({ logLevel: "debug" });
deleteWorkspaceMutation.mutate({ logLevel });
break;
}
}}
Expand Down Expand Up @@ -297,6 +298,7 @@ export const WorkspaceReadyPage = ({
}
canAutostart={canAutostart}
/>

<WorkspaceDeleteDialog
workspace={workspace}
canUpdateTemplate={canDeleteWorkspace}
Expand All @@ -310,6 +312,7 @@ export const WorkspaceReadyPage = ({
}}
workspaceBuildDateStr={dayjs(workspace.created_at).fromNow()}
/>

<UpdateBuildParametersDialog
missedParameters={
changeVersionMutation.error instanceof MissingBuildParameters
Expand All @@ -329,6 +332,7 @@ export const WorkspaceReadyPage = ({
}
}}
/>

<UpdateBuildParametersDialog
missedParameters={
updateWorkspaceMutation.error instanceof MissingBuildParameters
Expand All @@ -345,6 +349,7 @@ export const WorkspaceReadyPage = ({
}
}}
/>

<ChangeVersionDialog
templateVersions={allVersions?.reverse()}
template={template}
Expand All @@ -360,6 +365,7 @@ export const WorkspaceReadyPage = ({
changeVersionMutation.mutate({ versionId: templateVersion.id });
}}
/>

<WarningDialog
open={isConfirmingUpdate}
onConfirm={() => {
Expand Down