From 41f04bee627147fc1c17c2d0bee7aca98e59a46b Mon Sep 17 00:00:00 2001 From: Kira Pilot Date: Mon, 24 Apr 2023 12:32:09 -0700 Subject: [PATCH] Revert "feat(UI): add workspace restart button (#7137)" This reverts commit 9ec16d445451fc538fe9f11533ff06773cfc61b7. --- site/src/components/Workspace/Workspace.tsx | 3 -- .../components/WorkspaceActions/Buttons.tsx | 33 ++++--------------- .../WorkspaceActions.stories.tsx | 1 - .../WorkspaceActions/WorkspaceActions.tsx | 4 --- .../components/WorkspaceActions/constants.ts | 3 +- site/src/i18n/en/workspacePage.json | 1 - .../WorkspacePage/WorkspaceReadyPage.tsx | 1 - 7 files changed, 8 insertions(+), 38 deletions(-) diff --git a/site/src/components/Workspace/Workspace.tsx b/site/src/components/Workspace/Workspace.tsx index f7090b45b4eec..b0377eeb29847 100644 --- a/site/src/components/Workspace/Workspace.tsx +++ b/site/src/components/Workspace/Workspace.tsx @@ -41,7 +41,6 @@ export interface WorkspaceProps { } handleStart: () => void handleStop: () => void - handleRestart: () => void handleDelete: () => void handleUpdate: () => void handleCancel: () => void @@ -73,7 +72,6 @@ export const Workspace: FC> = ({ scheduleProps, handleStart, handleStop, - handleRestart, handleDelete, handleUpdate, handleCancel, @@ -134,7 +132,6 @@ export const Workspace: FC> = ({ isOutdated={workspace.outdated} handleStart={handleStart} handleStop={handleStop} - handleRestart={handleRestart} handleDelete={handleDelete} handleUpdate={handleUpdate} handleCancel={handleCancel} diff --git a/site/src/components/WorkspaceActions/Buttons.tsx b/site/src/components/WorkspaceActions/Buttons.tsx index d6207952a4ac8..b8c38469df68f 100644 --- a/site/src/components/WorkspaceActions/Buttons.tsx +++ b/site/src/components/WorkspaceActions/Buttons.tsx @@ -3,9 +3,8 @@ import BlockIcon from "@material-ui/icons/Block" import CloudQueueIcon from "@material-ui/icons/CloudQueue" import CropSquareIcon from "@material-ui/icons/CropSquare" import PlayCircleOutlineIcon from "@material-ui/icons/PlayCircleOutline" -import ReplayIcon from "@material-ui/icons/Replay" import { LoadingButton } from "components/LoadingButton/LoadingButton" -import { FC, PropsWithChildren } from "react" +import { FC } from "react" import { useTranslation } from "react-i18next" import { makeStyles } from "@material-ui/core/styles" @@ -13,7 +12,7 @@ interface WorkspaceAction { handleAction: () => void } -export const UpdateButton: FC> = ({ +export const UpdateButton: FC> = ({ handleAction, }) => { const { t } = useTranslation("workspacePage") @@ -31,7 +30,7 @@ export const UpdateButton: FC> = ({ ) } -export const StartButton: FC> = ({ +export const StartButton: FC> = ({ handleAction, }) => { const { t } = useTranslation("workspacePage") @@ -49,7 +48,7 @@ export const StartButton: FC> = ({ ) } -export const StopButton: FC> = ({ +export const StopButton: FC> = ({ handleAction, }) => { const { t } = useTranslation("workspacePage") @@ -67,25 +66,7 @@ export const StopButton: FC> = ({ ) } -export const RestartButton: FC> = ({ - handleAction, -}) => { - const { t } = useTranslation("workspacePage") - const styles = useStyles() - - return ( - - ) -} - -export const CancelButton: FC> = ({ +export const CancelButton: FC> = ({ handleAction, }) => { return ( @@ -99,7 +80,7 @@ interface DisabledProps { label: string } -export const DisabledButton: FC> = ({ +export const DisabledButton: FC> = ({ label, }) => { return ( @@ -113,7 +94,7 @@ interface LoadingProps { label: string } -export const ActionLoadingButton: FC> = ({ +export const ActionLoadingButton: FC> = ({ label, }) => { const styles = useStyles() diff --git a/site/src/components/WorkspaceActions/WorkspaceActions.stories.tsx b/site/src/components/WorkspaceActions/WorkspaceActions.stories.tsx index b2b2526811d0d..090e81cb2bb03 100644 --- a/site/src/components/WorkspaceActions/WorkspaceActions.stories.tsx +++ b/site/src/components/WorkspaceActions/WorkspaceActions.stories.tsx @@ -15,7 +15,6 @@ const Template: Story = (args) => ( const defaultArgs = { handleStart: action("start"), handleStop: action("stop"), - handleRestart: action("restart"), handleDelete: action("delete"), handleUpdate: action("update"), handleCancel: action("cancel"), diff --git a/site/src/components/WorkspaceActions/WorkspaceActions.tsx b/site/src/components/WorkspaceActions/WorkspaceActions.tsx index 2cc4bbfcac203..d7508ed64405b 100644 --- a/site/src/components/WorkspaceActions/WorkspaceActions.tsx +++ b/site/src/components/WorkspaceActions/WorkspaceActions.tsx @@ -12,7 +12,6 @@ import { DisabledButton, StartButton, StopButton, - RestartButton, UpdateButton, } from "./Buttons" import { @@ -29,7 +28,6 @@ export interface WorkspaceActionsProps { isOutdated: boolean handleStart: () => void handleStop: () => void - handleRestart: () => void handleDelete: () => void handleUpdate: () => void handleCancel: () => void @@ -45,7 +43,6 @@ export const WorkspaceActions: FC = ({ isOutdated, handleStart, handleStop, - handleRestart, handleDelete, handleUpdate, handleCancel, @@ -94,7 +91,6 @@ export const WorkspaceActions: FC = ({ key={ButtonTypesEnum.stopping} /> ), - [ButtonTypesEnum.restart]: , [ButtonTypesEnum.deleting]: ( = { canAcceptJobs: false, }, running: { - actions: [ButtonTypesEnum.stop, ButtonTypesEnum.restart], + actions: [ButtonTypesEnum.stop], canCancel: false, canAcceptJobs: true, }, diff --git a/site/src/i18n/en/workspacePage.json b/site/src/i18n/en/workspacePage.json index fdcfc6ea31a65..fa5e9f8335021 100644 --- a/site/src/i18n/en/workspacePage.json +++ b/site/src/i18n/en/workspacePage.json @@ -21,7 +21,6 @@ "actionButton": { "start": "Start", "stop": "Stop", - "restart": "Restart", "delete": "Delete", "cancel": "Cancel", "update": "Update", diff --git a/site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx b/site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx index 1a910a8a0c6ff..6066b75e64b8e 100644 --- a/site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx +++ b/site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx @@ -123,7 +123,6 @@ export const WorkspaceReadyPage = ({ workspace={workspace} handleStart={() => workspaceSend({ type: "START" })} handleStop={() => workspaceSend({ type: "STOP" })} - handleRestart={() => workspaceSend({ type: "START" })} handleDelete={() => workspaceSend({ type: "ASK_DELETE" })} handleUpdate={() => workspaceSend({ type: "UPDATE" })} handleCancel={() => workspaceSend({ type: "CANCEL" })}