Skip to content

Commit df0bc5b

Browse files
committed
Format
1 parent 2226fea commit df0bc5b

File tree

7 files changed

+133
-126
lines changed

7 files changed

+133
-126
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Started.args = {
2020
handleStart: action("start"),
2121
handleStop: action("stop"),
2222
handleRetry: action("retry"),
23-
workspaceStatus: "started"
23+
workspaceStatus: "started",
2424
}
2525

2626
export const Starting = Template.bind({})

site/src/components/Workspace/Workspace.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ export interface WorkspaceProps {
2020
/**
2121
* Workspace is the top-level component for viewing an individual workspace
2222
*/
23-
export const Workspace: React.FC<WorkspaceProps> = ({ organization, template, workspace, handleStart, handleStop, handleRetry, workspaceStatus }) => {
23+
export const Workspace: React.FC<WorkspaceProps> = ({
24+
organization,
25+
template,
26+
workspace,
27+
handleStart,
28+
handleStop,
29+
handleRetry,
30+
workspaceStatus,
31+
}) => {
2432
const styles = useStyles()
2533

2634
return (

site/src/components/WorkspaceStatusBar/WorkspaceStatusBar.tsx

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import Box from "@material-ui/core/Box"
22
import Button from "@material-ui/core/Button"
3-
import Divider from "@material-ui/core/Divider"
43
import { makeStyles } from "@material-ui/core/styles"
54
import Typography from "@material-ui/core/Typography"
6-
import CloudCircleIcon from "@material-ui/icons/CloudCircle"
75
import React from "react"
86
import { Link } from "react-router-dom"
97
import * as Types from "../../api/types"
@@ -23,7 +21,7 @@ const Language = {
2321
stopped: "Stopped",
2422
starting: "Building",
2523
stopping: "Stopping",
26-
error: "Build Failed"
24+
error: "Build Failed",
2725
}
2826

2927
export interface WorkspaceStatusBarProps {
@@ -46,7 +44,7 @@ export const WorkspaceStatusBar: React.FC<WorkspaceStatusBarProps> = ({
4644
handleStart,
4745
handleStop,
4846
handleRetry,
49-
workspaceStatus
47+
workspaceStatus,
5048
}) => {
5149
const styles = useStyles()
5250

@@ -55,23 +53,21 @@ export const WorkspaceStatusBar: React.FC<WorkspaceStatusBarProps> = ({
5553
return (
5654
<WorkspaceSection>
5755
<Stack spacing={1}>
58-
5956
<div className={combineClasses([styles.horizontal, styles.reverse])}>
6057
<div className={styles.horizontal}>
61-
<Link className={styles.link} to={`workspaces/${workspace.id}/edit`}>
62-
{Language.settings}
63-
</Link>
58+
<Link className={styles.link} to={`workspaces/${workspace.id}/edit`}>
59+
{Language.settings}
60+
</Link>
6461
</div>
6562

66-
{organization && template &&
63+
{organization && template && (
6764
<Typography variant="body2" color="textSecondary">
6865
Back to{" "}
6966
<Link className={styles.link} to={templateLink}>
7067
{template.name}
7168
</Link>
7269
</Typography>
73-
}
74-
70+
)}
7571
</div>
7672

7773
<div className={styles.horizontal}>
@@ -87,28 +83,23 @@ export const WorkspaceStatusBar: React.FC<WorkspaceStatusBarProps> = ({
8783
</div>
8884

8985
<div className={styles.horizontal}>
90-
{workspaceStatus === "started" &&
91-
(<Button onClick={handleStop} color="primary">
86+
{workspaceStatus === "started" && (
87+
<Button onClick={handleStop} color="primary">
9288
{Language.stop}
93-
</Button>)
94-
}
95-
{workspaceStatus === "stopped" &&
96-
(<Button onClick={handleStart} color="primary">
89+
</Button>
90+
)}
91+
{workspaceStatus === "stopped" && (
92+
<Button onClick={handleStart} color="primary">
9793
{Language.start}
98-
</Button>)
99-
}
100-
{workspaceStatus === "error" &&
101-
(<Button onClick={handleRetry} color="primary">
94+
</Button>
95+
)}
96+
{workspaceStatus === "error" && (
97+
<Button onClick={handleRetry} color="primary">
10298
{Language.retry}
103-
</Button>)
104-
}
105-
106-
{workspace.outdated && (
107-
<Button color="primary">
108-
{Language.update}
10999
</Button>
110100
)}
111101

102+
{workspace.outdated && <Button color="primary">{Language.update}</Button>}
112103
</div>
113104
</div>
114105
</Stack>
@@ -133,12 +124,12 @@ const useStyles = makeStyles((theme) => {
133124
gap: theme.spacing(2),
134125
},
135126
reverse: {
136-
flexDirection: 'row-reverse'
127+
flexDirection: "row-reverse",
137128
},
138129
statusChip: {
139130
border: `solid 1px ${theme.palette.text.hint}`,
140131
borderRadius: theme.shape.borderRadius,
141-
padding: theme.spacing(1)
132+
padding: theme.spacing(1),
142133
},
143134
vertical: {
144135
display: "flex",

site/src/pages/TemplatesPages/OrganizationPage/TemplatePage/TemplatePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react"
22
import { Link, useNavigate, useParams } from "react-router-dom"
33
import useSWR from "swr"
4-
import { Organization, Template, Workspace, WorkspaceBuild } from "../../../../api/types"
4+
import { Organization, Template, Workspace } from "../../../../api/types"
55
import { EmptyState } from "../../../../components/EmptyState/EmptyState"
66
import { ErrorSummary } from "../../../../components/ErrorSummary/ErrorSummary"
77
import { Header } from "../../../../components/Header/Header"

site/src/pages/WorkspacePage/WorkspacePage.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,21 @@ export const WorkspacePage: React.FC = () => {
4242

4343
if (workspaceState.matches("error")) {
4444
return <ErrorSummary error={getWorkspaceError || getTemplateError || getOrganizationError} />
45-
} else if (!workspace){
45+
} else if (!workspace) {
4646
return <FullScreenLoader />
4747
} else {
4848
return (
4949
<Margins>
5050
<Stack spacing={4}>
51-
<Workspace organization={organization} template={template} workspace={workspace}
51+
<Workspace
52+
organization={organization}
53+
template={template}
54+
workspace={workspace}
5255
handleStart={() => workspaceSend("START")}
5356
handleStop={() => workspaceSend("STOP")}
5457
handleRetry={() => workspaceSend("RETRY")}
5558
workspaceStatus={workspaceStatus}
56-
/>
59+
/>
5760
</Stack>
5861
</Margins>
5962
)

site/src/testHelpers/entities.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,19 @@ export const MockWorkspaceAutostopEnabled: WorkspaceAutostartRequest = {
8282
}
8383

8484
export const MockProvisionerJob = {
85-
id: "test-provisioner-job",
86-
created_at: "",
87-
started_at: "",
88-
completed_at: "",
89-
error: "",
90-
status: "succeeded" as ProvisionerJobStatus,
91-
worker_id: "test-worker-id"
85+
id: "test-provisioner-job",
86+
created_at: "",
87+
started_at: "",
88+
completed_at: "",
89+
error: "",
90+
status: "succeeded" as ProvisionerJobStatus,
91+
worker_id: "test-worker-id",
9292
}
9393

9494
export const MockWorkspaceBuild = {
9595
id: "test-workspace-build",
9696
transition: "start" as WorkspaceBuildTransition,
97-
job: MockProvisionerJob
97+
job: MockProvisionerJob,
9898
}
9999

100100
// These are special cases of MockWorkspaceBuild for more precise testing

0 commit comments

Comments
 (0)