Skip to content

Commit 4a57152

Browse files
committed
Format
1 parent 7727a1b commit 4a57152

File tree

4 files changed

+44
-24
lines changed

4 files changed

+44
-24
lines changed

site/src/components/WorkspaceStatusBar/WorkspaceStatusBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const Language = {
2222
starting: "Building",
2323
stopping: "Stopping",
2424
error: "Build Failed",
25-
loading: "Loading Status"
25+
loading: "Loading Status",
2626
}
2727

2828
export interface WorkspaceStatusBarProps {

site/src/pages/WorkspacePage/WorkspacePage.test.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import { screen } from "@testing-library/react"
22
import { rest } from "msw"
33
import React from "react"
4-
import { MockFailedWorkspace, MockStoppedWorkspace, MockTemplate, MockWorkspace, renderWithAuth } from "../../testHelpers"
4+
import {
5+
MockFailedWorkspace,
6+
MockStoppedWorkspace,
7+
MockTemplate,
8+
MockWorkspace,
9+
renderWithAuth,
10+
} from "../../testHelpers"
511
import { server } from "../../testHelpers/server"
612
import { WorkspacePage } from "./WorkspacePage"
713

site/src/testHelpers/entities.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,6 @@ export const MockFailedWorkspace: Workspace = {
176176
latest_build: MockFailedWorkspaceBuild,
177177
}
178178

179-
180-
181179
export const MockWorkspaceAgent: WorkspaceAgent = {
182180
id: "test-workspace-agent",
183181
name: "a-workspace-agent",

site/src/xServices/workspace/workspaceXService.ts

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -186,18 +186,25 @@ export const workspaceMachine = createMachine(
186186
id: "refreshWorkspace",
187187
src: "refreshWorkspace",
188188
onDone: [
189-
{ cond: "jobSucceeded", target: "#workspaceState.ready.build.started", actions: ["clearBuildError", "assignWorkspace"]},
189+
{
190+
cond: "jobSucceeded",
191+
target: "#workspaceState.ready.build.started",
192+
actions: ["clearBuildError", "assignWorkspace"],
193+
},
190194
{ cond: "jobPendingOrRunning", target: "waiting", actions: "assignWorkspace" },
191-
{ target: "#workspaceState.ready.build.error", actions: ["assignWorkspace", "assignBuildError"] }
195+
{
196+
target: "#workspaceState.ready.build.error",
197+
actions: ["assignWorkspace", "assignBuildError"],
198+
},
192199
],
193-
onError: { target: "waiting", actions: "assignRefreshWorkspaceError"}
194-
}
200+
onError: { target: "waiting", actions: "assignRefreshWorkspaceError" },
201+
},
195202
},
196203
waiting: {
197204
after: {
198-
1000: "refreshingWorkspace"
199-
}
200-
}
205+
1000: "refreshingWorkspace",
206+
},
207+
},
201208
},
202209
tags: ["buildLoading", "starting"],
203210
},
@@ -210,18 +217,25 @@ export const workspaceMachine = createMachine(
210217
id: "refreshWorkspace",
211218
src: "refreshWorkspace",
212219
onDone: [
213-
{ cond: "jobSucceeded", target: "#workspaceState.ready.build.stopped", actions: ["clearBuildError", "assignWorkspace"]},
220+
{
221+
cond: "jobSucceeded",
222+
target: "#workspaceState.ready.build.stopped",
223+
actions: ["clearBuildError", "assignWorkspace"],
224+
},
214225
{ cond: "jobPendingOrRunning", target: "waiting", actions: "assignWorkspace" },
215-
{ target: "#workspaceState.ready.build.error", actions: ["assignWorkspace", "assignBuildError"] }
226+
{
227+
target: "#workspaceState.ready.build.error",
228+
actions: ["assignWorkspace", "assignBuildError"],
229+
},
216230
],
217-
onError: { target: "waiting", actions: "assignRefreshWorkspaceError"}
218-
}
231+
onError: { target: "waiting", actions: "assignRefreshWorkspaceError" },
232+
},
219233
},
220234
waiting: {
221235
after: {
222-
1000: "refreshingWorkspace"
223-
}
224-
}
236+
1000: "refreshingWorkspace",
237+
},
238+
},
225239
},
226240
tags: ["buildLoading", "stopping"],
227241
},
@@ -289,12 +303,14 @@ export const workspaceMachine = createMachine(
289303
assign({
290304
buildError: undefined,
291305
}),
292-
assignRefreshWorkspaceError: (_, event) => assign({
293-
refreshWorkspaceError: event.data
294-
}),
295-
clearRefreshWorkspaceError: (_) => assign({
296-
refreshWorkspaceError: undefined
297-
})
306+
assignRefreshWorkspaceError: (_, event) =>
307+
assign({
308+
refreshWorkspaceError: event.data,
309+
}),
310+
clearRefreshWorkspaceError: (_) =>
311+
assign({
312+
refreshWorkspaceError: undefined,
313+
}),
298314
},
299315
guards: {
300316
workspaceIsStarted: (context) =>

0 commit comments

Comments
 (0)