Skip to content

refactor(site): Refactor the schedule controls in the workspace page #7083

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 11 commits into from
Apr 11, 2023
Prev Previous commit
Next Next commit
Fix time label
  • Loading branch information
BrunoQuaresma committed Apr 11, 2023
commit a8b8b54d374789cdd34e234cf5fd5481b3264f2a
6 changes: 4 additions & 2 deletions site/src/components/WorkspaceStats/WorkspaceStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { Workspace } from "../../api/typesGenerated"
import { Stats, StatsItem } from "components/Stats/Stats"
import upperFirst from "lodash/upperFirst"
import { autostopDisplay } from "util/schedule"
import { autostartDisplay, autostopDisplay } from "util/schedule"
import IconButton from "@material-ui/core/IconButton"
import RemoveIcon from "@material-ui/icons/RemoveOutlined"
import { makeStyles } from "@material-ui/core/styles"
Expand Down Expand Up @@ -110,7 +110,9 @@ export const WorkspaceStats: FC<WorkspaceStatsProps> = ({
to="settings/schedule"
title="Schedule settings"
>
{autostopDisplay(workspace)}
{isWorkspaceOn(workspace)
? autostopDisplay(workspace)
: autostartDisplay(workspace.autostart_schedule)}
</Link>
<span className={styles.scheduleControls}>
<IconButton
Expand Down