|
1 | 1 | import { type Interpolation, type Theme } from "@emotion/react";
|
2 |
| -import Button from "@mui/material/Button"; |
3 | 2 | import AlertTitle from "@mui/material/AlertTitle";
|
4 | 3 | import { type FC } from "react";
|
5 | 4 | import { useNavigate } from "react-router-dom";
|
@@ -43,9 +42,9 @@ export interface WorkspaceProps {
|
43 | 42 | buildInfo?: TypesGen.BuildInfoResponse;
|
44 | 43 | sshPrefix?: string;
|
45 | 44 | template: TypesGen.Template;
|
46 |
| - canRetryDebugMode: boolean; |
47 |
| - handleBuildRetry: () => void; |
48 |
| - handleBuildRetryDebug: () => void; |
| 45 | + canDebugMode: boolean; |
| 46 | + handleRetry: (buildParameters?: TypesGen.WorkspaceBuildParameter[]) => void; |
| 47 | + handleDebug: (buildParameters?: TypesGen.WorkspaceBuildParameter[]) => void; |
49 | 48 | buildLogs?: React.ReactNode;
|
50 | 49 | latestVersion?: TypesGen.TemplateVersion;
|
51 | 50 | permissions: WorkspacePermissions;
|
@@ -75,9 +74,9 @@ export const Workspace: FC<WorkspaceProps> = ({
|
75 | 74 | buildInfo,
|
76 | 75 | sshPrefix,
|
77 | 76 | template,
|
78 |
| - canRetryDebugMode, |
79 |
| - handleBuildRetry, |
80 |
| - handleBuildRetryDebug, |
| 77 | + canDebugMode, |
| 78 | + handleRetry, |
| 79 | + handleDebug, |
81 | 80 | buildLogs,
|
82 | 81 | latestVersion,
|
83 | 82 | permissions,
|
@@ -129,12 +128,12 @@ export const Workspace: FC<WorkspaceProps> = ({
|
129 | 128 | handleUpdate={handleUpdate}
|
130 | 129 | handleCancel={handleCancel}
|
131 | 130 | handleSettings={handleSettings}
|
132 |
| - handleBuildRetry={handleBuildRetry} |
133 |
| - handleBuildRetryDebug={handleBuildRetryDebug} |
| 131 | + handleRetry={handleRetry} |
| 132 | + handleDebug={handleDebug} |
134 | 133 | handleChangeVersion={handleChangeVersion}
|
135 | 134 | handleDormantActivate={handleDormantActivate}
|
136 | 135 | handleToggleFavorite={handleToggleFavorite}
|
137 |
| - canRetryDebugMode={canRetryDebugMode} |
| 136 | + canDebugMode={canDebugMode} |
138 | 137 | canChangeVersions={canChangeVersions}
|
139 | 138 | isUpdating={isUpdating}
|
140 | 139 | isRestarting={isRestarting}
|
@@ -208,20 +207,7 @@ export const Workspace: FC<WorkspaceProps> = ({
|
208 | 207 | )}
|
209 | 208 |
|
210 | 209 | {workspace.latest_build.job.error && (
|
211 |
| - <Alert |
212 |
| - severity="error" |
213 |
| - actions={ |
214 |
| - <Button |
215 |
| - onClick={ |
216 |
| - canRetryDebugMode ? handleBuildRetryDebug : handleBuildRetry |
217 |
| - } |
218 |
| - variant="text" |
219 |
| - size="small" |
220 |
| - > |
221 |
| - Retry{canRetryDebugMode && " in debug mode"} |
222 |
| - </Button> |
223 |
| - } |
224 |
| - > |
| 210 | + <Alert severity="error"> |
225 | 211 | <AlertTitle>Workspace build failed</AlertTitle>
|
226 | 212 | <AlertDetail>{workspace.latest_build.job.error}</AlertDetail>
|
227 | 213 | </Alert>
|
|
0 commit comments