Skip to content

Commit b86ed11

Browse files
refactor(site): Refactor the schedule controls in the workspace page (#7083)
1 parent b92e7d4 commit b86ed11

File tree

8 files changed

+319
-646
lines changed

8 files changed

+319
-646
lines changed

site/src/components/Stats/Stats.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const useStyles = makeStyles((theme) => ({
3030
alignItems: "center",
3131
color: theme.palette.text.secondary,
3232
margin: "0px",
33+
flexWrap: "wrap",
3334

3435
[theme.breakpoints.down("sm")]: {
3536
display: "block",

site/src/components/Workspace/Workspace.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ import { Resources } from "../Resources/Resources"
2525
import { Stack } from "../Stack/Stack"
2626
import { WorkspaceActions } from "../WorkspaceActions/WorkspaceActions"
2727
import { WorkspaceDeletedBanner } from "../WorkspaceDeletedBanner/WorkspaceDeletedBanner"
28-
import { WorkspaceScheduleButton } from "../WorkspaceScheduleButton/WorkspaceScheduleButton"
2928
import { WorkspaceStats } from "../WorkspaceStats/WorkspaceStats"
3029

3130
export enum WorkspaceErrors {
3231
GET_BUILDS_ERROR = "getBuildsError",
3332
BUILD_ERROR = "buildError",
3433
CANCELLATION_ERROR = "cancellationError",
3534
}
36-
3735
export interface WorkspaceProps {
3836
scheduleProps: {
3937
onDeadlinePlus: (hours: number) => void
@@ -129,14 +127,6 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
129127
<PageHeader
130128
actions={
131129
<Stack direction="row" spacing={1} className={styles.actions}>
132-
<WorkspaceScheduleButton
133-
workspace={workspace}
134-
onDeadlineMinus={scheduleProps.onDeadlineMinus}
135-
onDeadlinePlus={scheduleProps.onDeadlinePlus}
136-
maxDeadlineDecrease={scheduleProps.maxDeadlineDecrease}
137-
maxDeadlineIncrease={scheduleProps.maxDeadlineIncrease}
138-
canUpdateWorkspace={canUpdateWorkspace}
139-
/>
140130
<WorkspaceActions
141131
workspaceStatus={workspace.latest_build.status}
142132
isOutdated={workspace.outdated}
@@ -194,6 +184,11 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
194184
workspace={workspace}
195185
quota_budget={quota_budget}
196186
handleUpdate={handleUpdate}
187+
canUpdateWorkspace={canUpdateWorkspace}
188+
maxDeadlineDecrease={scheduleProps.maxDeadlineDecrease}
189+
maxDeadlineIncrease={scheduleProps.maxDeadlineIncrease}
190+
onDeadlineMinus={scheduleProps.onDeadlineMinus}
191+
onDeadlinePlus={scheduleProps.onDeadlinePlus}
197192
/>
198193

199194
{failedBuildLogs && (

site/src/components/WorkspaceScheduleButton/EditHours.tsx

Lines changed: 0 additions & 54 deletions
This file was deleted.

site/src/components/WorkspaceScheduleButton/WorkspaceScheduleButton.stories.tsx

Lines changed: 0 additions & 121 deletions
This file was deleted.

site/src/components/WorkspaceScheduleButton/WorkspaceScheduleButton.test.tsx

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)