Skip to content

Commit 370a409

Browse files
committed
fmt
1 parent 2caa836 commit 370a409

File tree

3 files changed

+30
-16
lines changed

3 files changed

+30
-16
lines changed

site/src/components/WorkspaceQuota/WorkspaceQuota.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ export const WorkspaceQuota: FC<WorkspaceQuotaProps> = ({ quota, error }) => {
2828
<Box>
2929
<Stack spacing={1} className={styles.stack}>
3030
<span className={styles.title}>Workspace Quota</span>
31-
<ErrorSummary
32-
error={error}
33-
/>
31+
<ErrorSummary error={error} />
3432
</Stack>
3533
</Box>
3634
)

site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export enum CreateWorkspaceErrors {
2222
GET_TEMPLATES_ERROR = "getTemplatesError",
2323
GET_TEMPLATE_SCHEMA_ERROR = "getTemplateSchemaError",
2424
CREATE_WORKSPACE_ERROR = "createWorkspaceError",
25-
GET_WORKSPACE_QUOTA_ERROR = "getWorkspaceQuotaError"
25+
GET_WORKSPACE_QUOTA_ERROR = "getWorkspaceQuotaError",
2626
}
2727

2828
export interface CreateWorkspacePageViewProps {
@@ -113,7 +113,10 @@ export const CreateWorkspacePageView: FC<React.PropsWithChildren<CreateWorkspace
113113
)
114114
}
115115

116-
const canSubmit = props.quota && props.quota.user_workspace_limit > 0 ? props.quota.user_workspace_count < props.quota.user_workspace_limit : true
116+
const canSubmit =
117+
props.quota && props.quota.user_workspace_limit > 0
118+
? props.quota.user_workspace_count < props.quota.user_workspace_limit
119+
: true
117120

118121
return (
119122
<FullPageForm title="Create workspace" onCancel={props.onCancel}>
@@ -166,13 +169,21 @@ export const CreateWorkspacePageView: FC<React.PropsWithChildren<CreateWorkspace
166169
)}
167170

168171
{props.quota ? (
169-
<WorkspaceQuota quota={props.quota} error={props.createWorkspaceErrors[CreateWorkspaceErrors.GET_WORKSPACE_QUOTA_ERROR]}/>
170-
) : (
171-
<></>
172-
)
173-
}
172+
<WorkspaceQuota
173+
quota={props.quota}
174+
error={
175+
props.createWorkspaceErrors[CreateWorkspaceErrors.GET_WORKSPACE_QUOTA_ERROR]
176+
}
177+
/>
178+
) : (
179+
<></>
180+
)}
174181

175-
<FormFooter onCancel={props.onCancel} isLoading={props.creatingWorkspace} submitDisabled={!canSubmit}/>
182+
<FormFooter
183+
onCancel={props.onCancel}
184+
isLoading={props.creatingWorkspace}
185+
submitDisabled={!canSubmit}
186+
/>
176187
</>
177188
)}
178189
</Stack>

site/src/xServices/createWorkspace/createWorkspaceXService.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { assign, createMachine } from "xstate"
2-
import { createWorkspace, getTemplates, getTemplateVersionSchema, getWorkspaceQuota } from "../../api/api"
2+
import {
3+
createWorkspace,
4+
getTemplates,
5+
getTemplateVersionSchema,
6+
getWorkspaceQuota,
7+
} from "../../api/api"
38
import {
49
CreateWorkspaceRequest,
510
ParameterSchema,
@@ -39,16 +44,16 @@ export const createWorkspaceMachine = createMachine(
3944
services: {} as {
4045
getTemplates: {
4146
data: Template[]
42-
},
47+
}
4348
getTemplateSchema: {
4449
data: ParameterSchema[]
45-
},
50+
}
4651
getWorkspaceQuota: {
4752
data: WorkspaceQuota
48-
},
53+
}
4954
createWorkspace: {
5055
data: Workspace
51-
},
56+
}
5257
},
5358
},
5459
initial: "gettingTemplates",

0 commit comments

Comments
 (0)