8000 feat: update workspace deadline when workspace ttl updated by johnstcn · Pull Request #2165 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: update workspace deadline when workspace ttl updated #2165

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 20 commits into from
Jun 9, 2022
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
Next Next commit
Merge remote-tracking branch 'origin/main' into cj/1783/updating-work…
…space-ttl-updates-deadline
  • Loading branch information
johnstcn committed Jun 9, 2022
commit a52d8156f8c4580b006f38049fc186ca535b97b3
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import utc from "dayjs/plugin/utc"
import * as Mocks from "../../testHelpers/entities"
import {
WorkspaceScheduleForm,
WorkspaceScheduleFormInitialValues,
defaultWorkspaceSchedule,
WorkspaceScheduleFormProps,
} from "./WorkspaceScheduleForm"

Expand All @@ -26,7 +26,7 @@ export const WorkspaceNotRunning = Template.bind({})
WorkspaceNotRunning.args = {
now: dayjs("2022-05-17T17:40:00Z"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise: Thank you for making this constant.

initialValues: {
...WorkspaceScheduleFormInitialValues,
...defaultWorkspaceSchedule(5, "asdfasdf"),
timezone: "UTC",
},
workspace: {
Expand All @@ -45,7 +45,7 @@ export const WorkspaceWillNotShutDown = Template.bind({})
WorkspaceWillNotShutDown.args = {
now: dayjs("2022-05-17T17:40:00Z"),
initialValues: {
...WorkspaceScheduleFormInitialValues,
...defaultWorkspaceSchedule(5, "asdfasdf"),
timezone: "UTC",
ttl: 0,
},
8000 Expand All @@ -64,7 +64,7 @@ export const WorkspaceWillShutdown = Template.bind({})
WorkspaceWillShutdown.args = {
now: dayjs("2022-05-17T17:40:00Z"),
initialValues: {
...WorkspaceScheduleFormInitialValues,
...defaultWorkspaceSchedule(5, "asdfasdf"),
timezone: "UTC",
},
workspace: {
Expand All @@ -82,7 +82,7 @@ export const WorkspaceWillShutdownSoon = Template.bind({})
WorkspaceWillShutdownSoon.args = {
now: dayjs("2022-05-17T18:10:00Z"),
initialValues: {
...WorkspaceScheduleFormInitialValues,
...defaultWorkspaceSchedule(5, "asdfasdf"),
timezone: "UTC",
ttl: 1,
},
Expand All @@ -101,7 +101,7 @@ export const WorkspaceWillShutdownImmediately = Template.bind({})
WorkspaceWillShutdownImmediately.args = {
now: dayjs("2022-05-17T18:40:00Z"),
initialValues: {
...WorkspaceScheduleFormInitialValues,
...defaultWorkspaceSchedule(5, "asdfasdf"),
timezone: "UTC",
ttl: 1,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,6 @@ export interface WorkspaceScheduleFormValues {
ttl: number
}

export const WorkspaceScheduleFormInitialValues = {
sunday: false,
monday: true,
tuesday: true,
wednesday: true,
thursday: true,
friday: true,
saturday: false,

startTime: "09:30",
timezone: "",
ttl: 5,
}

export const validationSchema = Yup.object({
sunday: Yup.boolean(),
monday: Yup.boolean().test("at-least-one-day", Language.errorNoDayOfWeek, function (value) {
Expand Down Expand Up @@ -197,7 +183,7 @@ export const defaultWorkspaceSchedule = (

export const WorkspaceScheduleForm: FC<WorkspaceScheduleFormProps> = ({
fieldErrors,
initialValues = WorkspaceScheduleFormInitialValues,
initialValues = defaultWorkspaceSchedule(),
isLoading,
now = dayjs(),
onCancel,
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0