Skip to content

refactor(site): Remove change version from the UI #6621

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 3 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 0 additions & 7 deletions site/src/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ const WorkspaceBuildPage = lazy(
() => import("./pages/WorkspaceBuildPage/WorkspaceBuildPage"),
)
const WorkspacePage = lazy(() => import("./pages/WorkspacePage/WorkspacePage"))
const WorkspaceChangeVersionPage = lazy(
() => import("./pages/WorkspaceChangeVersionPage/WorkspaceChangeVersionPage"),
)
const WorkspaceSchedulePage = lazy(
() => import("./pages/WorkspaceSchedulePage/WorkspaceSchedulePage"),
)
Expand Down Expand Up @@ -228,10 +225,6 @@ export const AppRouter: FC = () => {
path="builds/:buildNumber"
element={<WorkspaceBuildPage />}
/>
<Route
path="change-version"
element={<WorkspaceChangeVersionPage />}
/>
<Route path="settings" element={<WorkspaceSettingsPage />} />
</Route>
</Route>
Expand Down
19 changes: 0 additions & 19 deletions site/src/components/DropdownButton/ActionCtas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Button from "@material-ui/core/Button"
import { makeStyles } from "@material-ui/core/styles"
import BlockIcon from "@material-ui/icons/Block"
import CloudQueueIcon from "@material-ui/icons/CloudQueue"
import UpdateOutlined from "@material-ui/icons/UpdateOutlined"
import SettingsOutlined from "@material-ui/icons/SettingsOutlined"
import CropSquareIcon from "@material-ui/icons/CropSquare"
import DeleteOutlineIcon from "@material-ui/icons/DeleteOutline"
Expand Down Expand Up @@ -36,24 +35,6 @@ export const UpdateButton: FC<React.PropsWithChildren<WorkspaceAction>> = ({
)
}

export const ChangeVersionButton: FC<
React.PropsWithChildren<WorkspaceAction>
> = ({ handleAction }) => {
const styles = useStyles()
const { t } = useTranslation("workspacePage")

return (
<Button
variant="outlined"
className={styles.actionButton}
startIcon={<UpdateOutlined />}
onClick={handleAction}
>
{t("actionButton.changeVersion")}
</Button>
)
}

export const SettingsButton: FC<React.PropsWithChildren<WorkspaceAction>> = ({
handleAction,
}) => {
Expand Down
3 changes: 0 additions & 3 deletions site/src/components/Workspace/Workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export interface WorkspaceProps {
handleDelete: () => void
handleUpdate: () => void
handleCancel: () => void
handleChangeVersion: () => void
handleSettings: () => void
isUpdating: boolean
workspace: TypesGen.Workspace
Expand All @@ -68,7 +67,6 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
handleDelete,
handleUpdate,
handleCancel,
handleChangeVersion,
handleSettings,
workspace,
isUpdating,
Expand Down Expand Up @@ -130,7 +128,6 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
handleDelete={handleDelete}
handleUpdate={handleUpdate}
handleCancel={handleCancel}
handleChangeVersion={handleChangeVersion}
handleSettings={handleSettings}
isUpdating={isUpdating}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const renderComponent = async (props: Partial<WorkspaceActionsProps> = {}) => {
handleDelete={jest.fn()}
handleUpdate={jest.fn()}
handleCancel={jest.fn()}
handleChangeVersion={jest.fn()}
handleSettings={jest.fn()}
isUpdating={false}
/>,
Expand All @@ -37,7 +36,6 @@ const renderAndClick = async (props: Partial<WorkspaceActionsProps> = {}) => {
handleDelete={jest.fn()}
handleUpdate={jest.fn()}
handleCancel={jest.fn()}
handleChangeVersion={jest.fn()}
handleSettings={jest.fn()}
isUpdating={false}
/>,
Expand Down
6 changes: 0 additions & 6 deletions site/src/components/WorkspaceActions/WorkspaceActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useTranslation } from "react-i18next"
import { WorkspaceStatus } from "../../api/typesGenerated"
import {
ActionLoadingButton,
ChangeVersionButton,
DeleteButton,
DisabledButton,
SettingsButton,
Expand All @@ -22,7 +21,6 @@ export interface WorkspaceActionsProps {
handleDelete: () => void
handleUpdate: () => void
handleCancel: () => void
handleChangeVersion: () => void
handleSettings: () => void
isUpdating: boolean
children?: ReactNode
Expand All @@ -36,7 +34,6 @@ export const WorkspaceActions: FC<WorkspaceActionsProps> = ({
handleDelete,
handleUpdate,
handleCancel,
handleChangeVersion,
handleSettings,
isUpdating,
}) => {
Expand All @@ -50,9 +47,6 @@ export const WorkspaceActions: FC<WorkspaceActionsProps> = ({
[ButtonTypesEnum.updating]: (
<ActionLoadingButton label={t("actionButton.updating")} />
),
[ButtonTypesEnum.changeVersion]: (
<ChangeVersionButton handleAction={handleChangeVersion} />
),
[ButtonTypesEnum.settings]: (
<SettingsButton handleAction={handleSettings} />
),
Expand Down
5 changes: 0 additions & 5 deletions site/src/components/WorkspaceActions/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export enum ButtonTypesEnum {
deleting = "deleting",
update = "update",
updating = "updating",
changeVersion = "changeVersion",
settings = "settings",
// disabled buttons
canceling = "canceling",
Expand Down Expand Up @@ -45,7 +44,6 @@ const statusToAbilities: Record<WorkspaceStatus, WorkspaceAbilities> = {
actions: [
ButtonTypesEnum.stop,
ButtonTypesEnum.settings,
ButtonTypesEnum.changeVersion,
ButtonTypesEnum.delete,
],
canCancel: false,
Expand All @@ -60,7 +58,6 @@ const statusToAbilities: Record<WorkspaceStatus, WorkspaceAbilities> = {
actions: [
ButtonTypesEnum.start,
ButtonTypesEnum.settings,
ButtonTypesEnum.changeVersion,
ButtonTypesEnum.delete,
],
canCancel: false,
Expand All @@ -71,7 +68,6 @@ const statusToAbilities: Record<WorkspaceStatus, WorkspaceAbilities> = {
ButtonTypesEnum.start,
ButtonTypesEnum.stop,
ButtonTypesEnum.settings,
ButtonTypesEnum.changeVersion,
ButtonTypesEnum.delete,
],
canCancel: false,
Expand All @@ -83,7 +79,6 @@ const statusToAbilities: Record<WorkspaceStatus, WorkspaceAbilities> = {
ButtonTypesEnum.start,
ButtonTypesEnum.stop,
ButtonTypesEnum.settings,
ButtonTypesEnum.changeVersion,
ButtonTypesEnum.delete,
],
canCancel: false,
Expand Down
2 changes: 0 additions & 2 deletions site/src/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import templateSettingsPage from "./templateSettingsPage.json"
import templateVariablesPage from "./templateVariablesPage.json"
import templateVersionPage from "./templateVersionPage.json"
import loginPage from "./loginPage.json"
import workspaceChangeVersionPage from "./workspaceChangeVersionPage.json"
import workspaceSchedulePage from "./workspaceSchedulePage.json"
import appearanceSettings from "./appearanceSettings.json"
import starterTemplatesPage from "./starterTemplatesPage.json"
Expand All @@ -37,7 +36,6 @@ export const en = {
templateVariablesPage,
templateVersionPage,
loginPage,
workspaceChangeVersionPage,
workspaceSchedulePage,
appearanceSettings,
starterTemplatesPage,
Expand Down
9 changes: 0 additions & 9 deletions site/src/i18n/en/workspaceChangeVersionPage.json

This file was deleted.

1 change: 0 additions & 1 deletion site/src/i18n/en/workspacePage.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"starting": "Starting...",
"stopping": "Stopping...",
"deleting": "Deleting...",
"changeVersion": "Change version",
"settings": "Settings"
},
"disabledButton": {
Expand Down

This file was deleted.

Loading