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 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
Merge branch 'main' into bq/remove-change-version
  • Loading branch information
BrunoQuaresma committed Mar 16, 2023
commit 9803af289d1a29ac12aeca0b4fec8981960320bb
5 changes: 1 addition & 4 deletions site/src/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,7 @@ export const AppRouter: FC = () => {
path="builds/:buildNumber"
element={<WorkspaceBuildPage />}
/>
<Route
path="build-parameters"
element={<WorkspaceBuildParametersPage />}
/>
<Route path="settings" element={<WorkspaceSettingsPage />} />
</Route>
</Route>
</Route>
Expand Down
6 changes: 3 additions & 3 deletions site/src/components/DropdownButton/ActionCtas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export const UpdateButton: FC<React.PropsWithChildren<WorkspaceAction>> = ({
)
}

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

Expand Down
6 changes: 3 additions & 3 deletions site/src/components/Workspace/Workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface WorkspaceProps {
handleDelete: () => void
handleUpdate: () => void
handleCancel: () => void
handleBuildParameters: () => void
handleSettings: () => void
isUpdating: boolean
workspace: TypesGen.Workspace
resources?: TypesGen.WorkspaceResource[]
Expand All @@ -67,7 +67,7 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
handleDelete,
handleUpdate,
handleCancel,
handleBuildParameters,
handleSettings,
workspace,
isUpdating,
resources,
Expand Down Expand Up @@ -128,7 +128,7 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
handleDelete={handleDelete}
handleUpdate={handleUpdate}
handleCancel={handleCancel}
handleBuildParameters={handleBuildParameters}
handleSettings={handleSettings}
isUpdating={isUpdating}
/>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const renderComponent = async (props: Partial<WorkspaceActionsProps> = {}) => {
handleDelete={jest.fn()}
handleUpdate={jest.fn()}
handleCancel={jest.fn()}
handleBuildParameters={jest.fn()}
handleSettings={jest.fn()}
isUpdating={false}
/>,
)
Expand All @@ -36,7 +36,7 @@ const renderAndClick = async (props: Partial<WorkspaceActionsProps> = {}) => {
handleDelete={jest.fn()}
handleUpdate={jest.fn()}
handleCancel={jest.fn()}
handleBuildParameters={jest.fn()}
handleSettings={jest.fn()}
isUpdating={false}
/>,
)
Expand Down
8 changes: 4 additions & 4 deletions site/src/components/WorkspaceActions/WorkspaceActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface WorkspaceActionsProps {
handleDelete: () => void
handleUpdate: () => void
handleCancel: () => void
handleBuildParameters: () => void
handleSettings: () => void
isUpdating: boolean
children?: ReactNode
}
Expand All @@ -34,7 +34,7 @@ export const WorkspaceActions: FC<WorkspaceActionsProps> = ({
handleDelete,
handleUpdate,
handleCancel,
handleBuildParameters,
handleSettings,
isUpdating,
}) => {
const { t } = useTranslation("workspacePage")
Expand All @@ -47,8 +47,8 @@ export const WorkspaceActions: FC<WorkspaceActionsProps> = ({
[ButtonTypesEnum.updating]: (
<ActionLoadingButton label={t("actionButton.updating")} />
),
[ButtonTypesEnum.buildParameters]: (
<BuildParametersButton handleAction={handleBuildParameters} />
[ButtonTypesEnum.settings]: (
<SettingsButton handleAction={handleSettings} />
),
[ButtonTypesEnum.start]: <StartButton handleAction={handleStart} />,
[ButtonTypesEnum.starting]: (
Expand Down
11 changes: 6 additions & 5 deletions site/src/components/WorkspaceActions/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export enum ButtonTypesEnum {
deleting = "deleting",
update = "update",
updating = "updating",
buildParameters = "buildParameters",
settings = "settings",
// disabled buttons
canceling = "canceling",
deleted = "deleted",
Expand Down Expand Up @@ -43,7 +43,7 @@ const statusToAbilities: Record<WorkspaceStatus, WorkspaceAbilities> = {
running: {
actions: [
ButtonTypesEnum.stop,
ButtonTypesEnum.buildParameters,
ButtonTypesEnum.settings,
ButtonTypesEnum.delete,
],
canCancel: false,
Expand All @@ -57,7 +57,7 @@ const statusToAbilities: Record<WorkspaceStatus, WorkspaceAbilities> = {
stopped: {
actions: [
ButtonTypesEnum.start,
ButtonTypesEnum.buildParameters,
ButtonTypesEnum.settings,
ButtonTypesEnum.delete,
],
canCancel: false,
Expand All @@ -67,7 +67,7 @@ const statusToAbilities: Record<WorkspaceStatus, WorkspaceAbilities> = {
actions: [
ButtonTypesEnum.start,
ButtonTypesEnum.stop,
ButtonTypesEnum.buildParameters,
ButtonTypesEnum.settings,
ButtonTypesEnum.delete,
],
canCancel: false,
Expand All @@ -77,7 +77,8 @@ const statusToAbilities: Record<WorkspaceStatus, WorkspaceAbilities> = {
failed: {
actions: [
ButtonTypesEnum.start,
ButtonTypesEnum.buildParameters,
ButtonTypesEnum.stop,
ButtonTypesEnum.settings,
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 workspaceBuildParametersPage from "./workspaceBuildParametersPage.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,
workspaceBuildParametersPage,
workspaceSchedulePage,
appearanceSettings,
starterTemplatesPage,
Expand Down
2 changes: 1 addition & 1 deletion site/src/i18n/en/workspacePage.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"starting": "Starting...",
"stopping": "Stopping...",
"deleting": "Deleting...",
"buildParameters": "Build parameters"
"settings": "Settings"
},
"disabledButton": {
"canceling": "Canceling",
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 @@ -111,7 +111,7 @@ export const WorkspaceReadyPage = ({
handleDelete={() => workspaceSend({ type: "ASK_DELETE" })}
handleUpdate={() => workspaceSend({ type: "UPDATE" })}
handleCancel={() => workspaceSend({ type: "CANCEL" })}
handleBuildParameters={() => navigate("build-parameters")}
handleSettings={() => navigate("settings")}
resources={workspace.latest_build.resources}
builds={builds}
canUpdateWorkspace={canUpdateWorkspace}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.