From 03d6696a8adbeeab3f20ef620ea30f440a43054d Mon Sep 17 00:00:00 2001 From: Colin Adler Date: Wed, 31 Jan 2024 19:19:41 +0000 Subject: [PATCH 1/3] chore(site): update time until shutdown tooltip language --- .../WorkspaceSchedulePage/WorkspaceScheduleForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceScheduleForm.tsx b/site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceScheduleForm.tsx index ac7a04bb19395..22f9b8f836243 100644 --- a/site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceScheduleForm.tsx +++ b/site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceScheduleForm.tsx @@ -458,6 +458,6 @@ export const ttlShutdownAt = (formTTL: number): string => { return `Your workspace will shut down ${formatDuration( intervalToDuration({ start: 0, end: formTTL * 60 * 60 * 1000 }), { delimiter: " and " }, - )} after its next start. We delay shutdown by this time whenever we detect activity.`; + )} after its next start. We delay shutdown by 1 hour whenever we detect activity.`; } }; From c38f4110c7b5844b2b80d602645bc42d8d36d6bf Mon Sep 17 00:00:00 2001 From: Colin Adler Date: Wed, 31 Jan 2024 19:27:57 +0000 Subject: [PATCH 2/3] fix tests --- .../WorkspaceScheduleForm.test.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceScheduleForm.test.tsx b/site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceScheduleForm.test.tsx index e43a8617d1dcc..12955658cec2e 100644 --- a/site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceScheduleForm.test.tsx +++ b/site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceScheduleForm.test.tsx @@ -202,42 +202,42 @@ describe("ttlShutdownAt", () => { [ "One hour --> helper text shows shutdown after 1 hour", 1, - `Your workspace will shut down 1 hour after its next start. We delay shutdown by this time whenever we detect activity.`, + `Your workspace will shut down 1 hour after its next start. We delay shutdown 1 hour whenever we detect activity.`, ], [ "Two hours --> helper text shows shutdown after 2 hours", 2, - `Your workspace will shut down 2 hours after its next start. We delay shutdown by this time whenever we detect activity.`, + `Your workspace will shut down 2 hours after its next start. We delay shutdown 1 hour whenever we detect activity.`, ], [ "24 hours --> helper text shows shutdown after 1 day", 24, - `Your workspace will shut down 1 day after its next start. We delay shutdown by this time whenever we detect activity.`, + `Your workspace will shut down 1 day after its next start. We delay shutdown 1 hour whenever we detect activity.`, ], [ "48 hours --> helper text shows shutdown after 2 days", 48, - `Your workspace will shut down 2 days after its next start. We delay shutdown by this time whenever we detect activity.`, + `Your workspace will shut down 2 days after its next start. We delay shutdown 1 hour whenever we detect activity.`, ], [ "1.2 hours --> helper text shows shutdown after 1 hour and 12 minutes", 1.2, - `Your workspace will shut down 1 hour and 12 minutes after its next start. We delay shutdown by this time whenever we detect activity.`, + `Your workspace will shut down 1 hour and 12 minutes after its next start. We delay shutdown 1 hour whenever we detect activity.`, ], [ "24.2 hours --> helper text shows shutdown after 1 day and 12 minutes", 24.2, - `Your workspace will shut down 1 day and 12 minutes after its next start. We delay shutdown by this time whenever we detect activity.`, + `Your workspace will shut down 1 day and 12 minutes after its next start. We delay shutdown 1 hour whenever we detect activity.`, ], [ "0.2 hours --> helper text shows shutdown after 12 minutes", 0.2, - `Your workspace will shut down 12 minutes after its next start. We delay shutdown by this time whenever we detect activity.`, + `Your workspace will shut down 12 minutes after its next start. We delay shutdown by 1 hour whenever we detect activity.`, ], [ "48.258 hours --> helper text shows shutdown after 2 days and 15 minutes and 28 seconds", 48.258, - `Your workspace will shut down 2 days and 15 minutes and 28 seconds after its next start. We delay shutdown by this time whenever we detect activity.`, + `Your workspace will shut down 2 days and 15 minutes and 28 seconds after its next start. We delay shutdown by 1 hour whenever we detect activity.`, ], ])("%p", (_, ttlHours, expected) => { expect(ttlShutdownAt(ttlHours)).toEqual(expected); From ce77384ba69dafd81e305f1b16cdf04af43cb166 Mon Sep 17 00:00:00 2001 From: Colin Adler Date: Wed, 31 Jan 2024 19:29:31 +0000 Subject: [PATCH 3/3] fixup! fix tests --- .../WorkspaceScheduleForm.test.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceScheduleForm.test.tsx b/site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceScheduleForm.test.tsx index 12955658cec2e..889905b2f41b2 100644 --- a/site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceScheduleForm.test.tsx +++ b/site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceScheduleForm.test.tsx @@ -202,32 +202,32 @@ describe("ttlShutdownAt", () => { [ "One hour --> helper text shows shutdown after 1 hour", 1, - `Your workspace will shut down 1 hour after its next start. We delay shutdown 1 hour whenever we detect activity.`, + `Your workspace will shut down 1 hour after its next start. We delay shutdown by 1 hour whenever we detect activity.`, ], [ "Two hours --> helper text shows shutdown after 2 hours", 2, - `Your workspace will shut down 2 hours after its next start. We delay shutdown 1 hour whenever we detect activity.`, + `Your workspace will shut down 2 hours after its next start. We delay shutdown by 1 hour whenever we detect activity.`, ], [ "24 hours --> helper text shows shutdown after 1 day", 24, - `Your workspace will shut down 1 day after its next start. We delay shutdown 1 hour whenever we detect activity.`, + `Your workspace will shut down 1 day after its next start. We delay shutdown by 1 hour whenever we detect activity.`, ], [ "48 hours --> helper text shows shutdown after 2 days", 48, - `Your workspace will shut down 2 days after its next start. We delay shutdown 1 hour whenever we detect activity.`, + `Your workspace will shut down 2 days after its next start. We delay shutdown by 1 hour whenever we detect activity.`, ], [ "1.2 hours --> helper text shows shutdown after 1 hour and 12 minutes", 1.2, - `Your workspace will shut down 1 hour and 12 minutes after its next start. We delay shutdown 1 hour whenever we detect activity.`, + `Your workspace will shut down 1 hour and 12 minutes after its next start. We delay shutdown by 1 hour whenever we detect activity.`, ], [ "24.2 hours --> helper text shows shutdown after 1 day and 12 minutes", 24.2, - `Your workspace will shut down 1 day and 12 minutes after its next start. We delay shutdown 1 hour whenever we detect activity.`, + `Your workspace will shut down 1 day and 12 minutes after its next start. We delay shutdown by 1 hour whenever we detect activity.`, ], [ "0.2 hours --> helper text shows shutdown after 12 minutes",