Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dccc11d

Browse files
committed
fix: remove "something went wrong" text for watching a workspace
This text wasn't useful to a customer anyways, because we don't get an error from EventSource. This can happen if you close your laptop and open it again, so it's better if we don't display it.
1 parent 9a79983 commit dccc11d

File tree

4 files changed

+5
-45
lines changed

4 files changed

+5
-45
lines changed

site/src/components/Workspace/Workspace.stories.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,6 @@ GetBuildsError.args = {
113113
},
114114
}
115115

116-
export const GetResourcesError = Template.bind({})
117-
GetResourcesError.args = {
118-
...Running.args,
119-
workspaceErrors: {
120-
[WorkspaceErrors.GET_RESOURCES_ERROR]: Mocks.makeMockApiError({
121-
message: "There is a problem fetching workspace resources.",
122-
}),
123-
},
124-
}
125-
126116
export const CancellationError = Template.bind({})
127117
CancellationError.args = {
128118
...Failed.args,

site/src/components/Workspace/Workspace.tsx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ import { AgentRow } from "components/Resources/AgentRow"
2626
import { Avatar } from "components/Avatar/Avatar"
2727

2828
export enum WorkspaceErrors {
29-
GET_RESOURCES_ERROR = "getResourcesError",
3029
GET_BUILDS_ERROR = "getBuildsError",
3130
BUILD_ERROR = "buildError",
3231
CANCELLATION_ERROR = "cancellationError",
33-
WORKSPACE_REFRESH_WARNING = "refreshWorkspaceWarning",
3432
}
3533

3634
export interface WorkspaceProps {
@@ -111,16 +109,6 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
111109
/>
112110
)
113111

114-
const workspaceRefreshWarning = Boolean(
115-
workspaceErrors[WorkspaceErrors.WORKSPACE_REFRESH_WARNING],
116-
) && (
117-
<AlertBanner
118-
severity="warning"
119-
text={t("warningsAndErrors.workspaceRefreshWarning")}
120-
dismissible
121-
/>
122-
)
123-
124112
let transitionStats: TypesGen.TransitionStats | undefined = undefined
125113
if (template !== undefined) {
126114
transitionStats = ActiveTransition(template, workspace)
@@ -187,7 +175,6 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
187175
>
188176
{buildError}
189177
{cancellationError}
190-
{workspaceRefreshWarning}
191178

192179
<WorkspaceDeletedBanner
193180
workspace={workspace}
@@ -207,13 +194,6 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
207194
/>
208195
)}
209196

210-
{Boolean(workspaceErrors[WorkspaceErrors.GET_RESOURCES_ERROR]) && (
211-
<AlertBanner
212-
severity="error"
213-
error={workspaceErrors[WorkspaceErrors.GET_RESOURCES_ERROR]}
214-
/>
215-
)}
216-
217197
{typeof resources !== "undefined" && resources.length > 0 && (
218198
<Resources
219199
resources={resources}

site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export const WorkspaceReadyPage = ({
4646
workspace,
4747
template,
4848
templateParameters,
49-
refreshWorkspaceWarning,
5049
builds,
5150
getBuildsError,
5251
buildError,
@@ -119,7 +118,6 @@ export const WorkspaceReadyPage = ({
119118
hideSSHButton={featureVisibility["browser_only"]}
120119
hideVSCodeDesktopButton={featureVisibility["browser_only"]}
121120
workspaceErrors={{
122-
[WorkspaceErrors.GET_RESOURCES_ERROR]: refreshWorkspaceWarning,
123121
[WorkspaceErrors.GET_BUILDS_ERROR]: getBuildsError,
124122
[WorkspaceErrors.BUILD_ERROR]: buildError,
125123
[WorkspaceErrors.CANCELLATION_ERROR]: cancellationError,

site/src/xServices/workspace/workspaceXService.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ export interface WorkspaceContext {
5858
templateParameters?: TypesGen.TemplateVersionParameter[]
5959
build?: TypesGen.WorkspaceBuild
6060
getWorkspaceError?: Error | unknown
61-
// these are labeled as warnings because they don't make the page unusable
62-
refreshWorkspaceWarning?: Error | unknown
6361
getTemplateWarning: Error | unknown
6462
getTemplateParametersWarning: Error | unknown
6563
// Builds
@@ -278,18 +276,15 @@ export const workspaceMachine = createMachine(
278276
},
279277
on: {
280278
REFRESH_WORKSPACE: {
281-
actions: [
282-
"refreshWorkspace",
283-
"clearRefreshWorkspaceWarning",
284-
],
279+
actions: ["refreshWorkspace"],
285280
},
286281
EVENT_SOURCE_ERROR: {
287282
target: "error",
288283
},
289284
},
290285
},
291286
error: {
292-
entry: "assignRefreshWorkspaceWarning",
287+
entry: "logWatchWorkspaceWarning",
293288
after: {
294289
"2000": {
295290
target: "gettingEvents",
@@ -586,12 +581,9 @@ export const workspaceMachine = createMachine(
586581
refreshWorkspace: assign({
587582
workspace: (_, event) => event.data,
588583
}),
589-
assignRefreshWorkspaceWarning: assign({
590-
refreshWorkspaceWarning: (_, event) => event,
591-
}),
592-
clearRefreshWorkspaceWarning: assign({
593-
refreshWorkspaceWarning: (_) => undefined,
594-
}),
584+
logWatchWorkspaceWarning: (_, event) => {
585+
console.error("Watch workspace error:", event)
586+
},
595587
assignGetTemplateWarning: assign({
596588
getTemplateWarning: (_, event) => event.data,
597589
}),

0 commit comments

Comments
 (0)