Skip to content

chore(site): refactor workspace quota to use react-query instead of XState #9626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename quota_budget to quotaBudget
  • Loading branch information
BrunoQuaresma committed Sep 12, 2023
commit 83b834fea24bbe679571f11ae0037cf4a0872afe
6 changes: 3 additions & 3 deletions site/src/pages/WorkspacePage/Workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export interface WorkspaceProps {
buildInfo?: TypesGen.BuildInfoResponse;
sshPrefix?: string;
template?: TypesGen.Template;
quota_budget?: number;
quotaBudget?: number;
handleBuildRetry: () => void;
buildLogs?: React.ReactNode;
}
Expand Down Expand Up @@ -101,7 +101,7 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
buildInfo,
sshPrefix,
template,
quota_budget,
quotaBudget,
handleBuildRetry,
templateWarnings,
buildLogs,
Expand Down Expand Up @@ -183,7 +183,7 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({

<WorkspaceStats
workspace={workspace}
quota_budget={quota_budget}
quotaBudget={quotaBudget}
handleUpdate={handleUpdate}
canUpdateWorkspace={canUpdateWorkspace}
maxDeadlineDecrease={scheduleProps.maxDeadlineDecrease}
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export const WorkspaceReadyPage = ({
buildInfo={buildInfo}
sshPrefix={sshPrefix}
template={template}
quota_budget={quota?.budget}
quotaBudget={quota?.budget}
templateWarnings={templateVersion?.warnings}
buildLogs={
shouldDisplayBuildLogs && (
Expand Down
6 changes: 3 additions & 3 deletions site/src/pages/WorkspacePage/WorkspaceStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ export interface WorkspaceStatsProps {
maxDeadlineIncrease: number;
maxDeadlineDecrease: number;
canUpdateWorkspace: boolean;
quota_budget?: number;
quotaBudget?: number;
onDeadlinePlus: (hours: number) => void;
onDeadlineMinus: (hours: number) => void;
handleUpdate: () => void;
}

export const WorkspaceStats: FC<WorkspaceStatsProps> = ({
workspace,
quota_budget,
quotaBudget,
maxDeadlineDecrease,
maxDeadlineIncrease,
canUpdateWorkspace,
Expand Down Expand Up @@ -169,7 +169,7 @@ export const WorkspaceStats: FC<WorkspaceStatsProps> = ({
className={styles.statsItem}
label={Language.costLabel}
value={`${workspace.latest_build.daily_cost} ${
quota_budget ? `/ ${quota_budget}` : ""
quotaBudget ? `/ ${quotaBudget}` : ""
}`}
/>
)}
Expand Down