8000 Revert "feat(UI): add workspace restart button (#7137)" (#7268) · coder/coder@96a12d1 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 96a12d1

Browse files
authored
Revert "feat(UI): add workspace restart button (#7137)" (#7268)
This reverts commit 9ec16d4.
1 parent 3129741 commit 96a12d1

File tree

7 files changed

+8
-38
lines changed

7 files changed

+8
-38
lines changed

site/src/components/Workspace/Workspace.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export interface WorkspaceProps {
4141
}
4242
handleStart: () => void
4343
handleStop: () => void
44-
handleRestart: () => void
4544
handleDelete: () => void
4645
handleUpdate: () => void
4746
handleCancel: () => void
@@ -73,7 +72,6 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
7372
scheduleProps,
7473
handleStart,
7574
handleStop,
76-
handleRestart,
7775
handleDelete,
7876
handleUpdate,
7977
handleCancel,
@@ -134,7 +132,6 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
134132
isOutdated={workspace.outdated}
135133
handleStart={handleStart}
136134
handleStop={handleStop}
137-
handleRestart={handleRestart}
138135
handleDelete={handleDelete}
139136
handleUpdate={handleUpdate}
140137
handleCancel={handleCancel}

site/src/components/WorkspaceActions/Buttons.tsx

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ import BlockIcon from "@material-ui/icons/Block"
33
import CloudQueueIcon from "@material-ui/icons/CloudQueue"
44
import CropSquareIcon from "@material-ui/icons/CropSquare"
55
import PlayCircleOutlineIcon from "@material-ui/icons/PlayCircleOutline"
6-
import ReplayIcon from "@material-ui/icons/Replay"
76
import { LoadingButton } from "components/LoadingButton/LoadingButton"
8-
import { FC, PropsWithChildren } from "react"
7+
import { FC } from "react"
98
import { useTranslation } from "react-i18next"
109
import { makeStyles } from "@material-ui/core/styles"
1110

1211
interface WorkspaceAction {
1312
handleAction: () => void
1413
}
1514

16-
export const UpdateButton: FC<PropsWithChildren<WorkspaceAction>> = ({
15+
export const UpdateButton: FC<React.PropsWithChildren<WorkspaceAction>> = ({
1716
handleAction,
1817
}) => {
1918
const { t } = useTranslation("workspacePage")
@@ -31,7 +30,7 @@ export const UpdateButton: FC<PropsWithChildren<WorkspaceAction>> = ({
3130
)
3231
}
3332

34-
export const StartButton: FC<PropsWithChildren<WorkspaceAction>> = ({
33+
export const StartButton: FC<React.PropsWithChildren<WorkspaceAction>> = ({
3534
handleAction,
3635
}) => {
3736
const { t } = useTranslation("workspacePage")
@@ -49,7 +48,7 @@ export const StartButton: FC<PropsWithChildren<WorkspaceAction>> = ({
4948
)
5049
}
5150

52-
export const StopButton: FC<PropsWithChildren<WorkspaceAction>> = ({
51+
export const StopButton: FC<React.PropsWithChildren<WorkspaceAction>> = ({
5352
handleAction,
5453
}) => {
5554
const { t } = useTranslation("workspacePage")
@@ -67,25 +66,7 @@ export const StopButton: FC<PropsWithChildren<WorkspaceAction>> = ({
6766
)
6867
}
6968

70-
export const RestartButton: FC<PropsWithChildren<WorkspaceAction>> = ({
71-
handleAction,
72-
}) => {
73-
const { t } = useTranslation("workspacePage")
74-
const styles = useStyles()
75-
76-
return (
77-
<Button
78-
variant="outlined"
79-
startIcon={<ReplayIcon />}
80-
onClick={handleAction}
81-
className={styles.fixedWidth}
82-
>
83-
{t("actionButton.restart")}
84-
</Button>
85-
)
86-
}
87-
88-
export const CancelButton: FC<PropsWithChildren<WorkspaceAction>> = ({
69+
export const CancelButton: FC<React.PropsWithChildren<WorkspaceAction>> = ({
8970
handleAction,
9071
}) => {
9172
return (
@@ -99,7 +80,7 @@ interface DisabledProps {
9980
label: string
10081
}
10182

102-
export const DisabledButton: FC<PropsWithChildren<DisabledProps>> = ({
83+
export const DisabledButton: FC<React.PropsWithChildren<DisabledProps>> = ({
10384
label,
10485
}) => {
10586
return (
@@ -113,7 +94,7 @@ interface LoadingProps {
11394
label: string
11495
}
11596

116-
export const ActionLoadingButton: FC<PropsWithChildren<LoadingProps>> = ({
97+
export const ActionLoadingButton: FC<React.PropsWithChildren<LoadingProps>> = ({
11798
label,
11899
}) => {
119100
const styles = useStyles()

site/src/components/WorkspaceActions/WorkspaceActions.stories.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const Template: Story<WorkspaceActionsProps> = (args) => (
1515
const defaultArgs = {
1616
handleStart: action("start"),
1717
handleStop: action("stop"),
18-
handleRestart: action("restart"),
1918
handleDelete: action("delete"),
2019
handleUpdate: action("update"),
2120
handleCancel: action("cancel"),

site/src/components/WorkspaceActions/WorkspaceActions.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
DisabledButton,
1313
StartButton,
1414
StopButton,
15-
RestartButton,
1615
UpdateButton,
1716
} from "./Buttons"
1817
import {
@@ -29,7 +28,6 @@ export interface WorkspaceActionsProps {
2928
isOutdated: boolean
3029
handleStart: () => void
3130
handleStop: () => void
32-
handleRestart: () => void
3331
handleDelete: () => void
3432
handleUpdate: () => void
3533
handleCancel: () => void
@@ -45,7 +43,6 @@ export const WorkspaceActions: FC<WorkspaceActionsProps> = ({
4543
isOutdated,
4644
handleStart,
4745
handleStop,
48-
handleRestart,
4946
handleDelete,
5047
handleUpdate,
5148
handleCancel,
@@ -94,7 +91,6 @@ export const WorkspaceActions: FC<WorkspaceActionsProps> = ({
9491
key={ButtonTypesEnum.stopping}
9592
/>
9693
),
97-
[ButtonTypesEnum.restart]: <RestartButton handleAction={handleRestart} />,
9894
[ButtonTypesEnum.deleting]: (
99< F438 code>95
<ActionLoadingButton
10096
label={t("actionButton.deleting")}

site/src/components/WorkspaceActions/constants.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export enum ButtonTypesEnum {
77
starting = "starting",
88
stop = "stop",
99
stopping = "stopping",
10-
restart = "restart",
1110
deleting = "deleting",
1211
update = "update",
1312
updating = "updating",
@@ -40,7 +39,7 @@ const statusToActions: Record<WorkspaceStatus, WorkspaceAbilities> = {
4039
canAcceptJobs: false,
4140
},
4241
running: {
43-
actions: [ButtonTypesEnum.stop, ButtonTypesEnum.restart],
42+
actions: [ButtonTypesEnum.stop],
4443
canCancel: false,
4544
canAcceptJobs: true,
4645
},

site/src/i18n/en/workspacePage.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"actionButton": {
2222
"start": "Start",
2323
"stop": "Stop",
24-
"restart": "Restart",
2524
"delete": "Delete",
2625
"cancel": "Cancel",
2726
"update": "Update",

site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ export const WorkspaceReadyPage = ({
123123
workspace={workspace}
124124
handleStart={() => workspaceSend({ type: "START" })}
125125
handleStop={() => workspaceSend({ type: "STOP" })}
126-
handleRestart={() => workspaceSend({ type: "START" })}
127126
handleDelete={() => workspaceSend({ type: "ASK_DELETE" })}
128127
handleUpdate={() => workspaceSend({ type: "UPDATE" })}
129128
handleCancel={() => workspaceSend({ type: "CANCEL" })}

0 commit comments

Comments
 (0)
0