From 685a0b9866db6ea1041c07199937ffbbc833f3ff Mon Sep 17 00:00:00 2001 From: Jaayden Halko Date: Wed, 26 Jun 2024 02:24:51 +0000 Subject: [PATCH 1/4] fix: improve checkbox text in template schedule settings dialog --- .../ScheduleDialog.stories.tsx | 33 +++++++++++++ .../TemplateSchedulePage/ScheduleDialog.tsx | 49 +++++++++---------- 2 files changed, 56 insertions(+), 26 deletions(-) create mode 100644 site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.stories.tsx diff --git a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.stories.tsx b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.stories.tsx new file mode 100644 index 0000000000000..daed5181d979a --- /dev/null +++ b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.stories.tsx @@ -0,0 +1,33 @@ +import { action } from "@storybook/addon-actions"; +import type { Meta, StoryObj } from "@storybook/react"; +import { ScheduleDialog } from "./ScheduleDialog"; + +const meta: Meta = { + title: "pages/TemplateSettingsPage/ScheduleDialog", + component: ScheduleDialog, + args: { + onConfirm: action("onConfirm"), + onClose: action("onClose"), + open: true, + title: "Workspace Scheduling", + } +}; + +export default meta; +type Story = StoryObj; + +export const DormancyThreshold: Story = { + args: { + dormantValueChanged: true, + inactiveWorkspacesToGoDormant: 2, + inactiveWorkspacesToGoDormantInWeek: 5, + }, +}; + +export const DormancyDeletion: Story = { + args: { + deletionValueChanged: true, + dormantWorkspacesToBeDeleted: 2, + dormantWorkspacesToBeDeletedInWeek: 5, + }, +}; diff --git a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx index 357c5c7c53d8b..26eb20bb57edd 100644 --- a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx +++ b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx @@ -2,7 +2,6 @@ import type { Interpolation, Theme } from "@emotion/react"; import Checkbox from "@mui/material/Checkbox"; import DialogActions from "@mui/material/DialogActions"; import FormControlLabel from "@mui/material/FormControlLabel"; -import { Stack } from "@mui/system"; import type { FC } from "react"; import type { ConfirmDialogProps } from "components/Dialogs/ConfirmDialog/ConfirmDialog"; import { Dialog, DialogActionButtons } from "components/Dialogs/Dialog"; @@ -68,9 +67,9 @@ export const ScheduleDialog: FC = ({ <>

Dormancy Threshold

- This change will result in {inactiveWorkspacesToGoDormant}{" "} - workspaces being immediately transitioned to the dormant state - and {inactiveWorkspacesToGoDormantInWeek} over the next seven + This change will result in {inactiveWorkspacesToGoDormant} {" "} + workspace(s) being immediately transitioned to the dormant state + and {inactiveWorkspacesToGoDormantInWeek} over the next 7 days. To prevent this, do you want to reset the inactivity period for all template workspaces?

@@ -84,7 +83,7 @@ export const ScheduleDialog: FC = ({ }} /> } - label="Reset" + label="Prevent Dormancy - Reset all workspace inactivity periods" /> )} @@ -92,27 +91,25 @@ export const ScheduleDialog: FC = ({ {showDeletionWarning && ( <>

Dormancy Auto-Deletion

- -

- This change will result in {dormantWorkspacesToBeDeleted}{" "} - workspaces being immediately deleted and{" "} - {dormantWorkspacesToBeDeletedInWeek} over the next 7 days. To - prevent this, do you want to reset the dormancy period for all - template workspaces? -

- { - updateDormantWorkspaces(e.target.checked); - }} - /> - } - label="Reset" - /> -
+

+ This change will result in {dormantWorkspacesToBeDeleted}{" "} + workspace(s) being immediately deleted and{" "} + {dormantWorkspacesToBeDeletedInWeek} over the next 7 days. To + prevent this, do you want to reset the dormancy period for all + template workspaces? +

+ { + updateDormantWorkspaces(e.target.checked); + }} + /> + } + label="Prevent Deletion - Reset all workspace dormancy periods" + /> )} From 0d1acdaf651640fe884482a97d60211eb5dae0ed Mon Sep 17 00:00:00 2001 From: Jaayden Halko Date: Wed, 26 Jun 2024 03:25:54 +0000 Subject: [PATCH 2/4] fix: format --- .../ScheduleDialog.stories.tsx | 2 +- .../TemplateSchedulePage/ScheduleDialog.tsx | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.stories.tsx b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.stories.tsx index daed5181d979a..403c735d4c6ac 100644 --- a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.stories.tsx +++ b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.stories.tsx @@ -10,7 +10,7 @@ const meta: Meta = { onClose: action("onClose"), open: true, title: "Workspace Scheduling", - } + }, }; export default meta; diff --git a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx index 26eb20bb57edd..87aa023ce7cb9 100644 --- a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx +++ b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx @@ -67,11 +67,12 @@ export const ScheduleDialog: FC = ({ <>

Dormancy Threshold

- This change will result in {inactiveWorkspacesToGoDormant} {" "} - workspace(s) being immediately transitioned to the dormant state - and {inactiveWorkspacesToGoDormantInWeek} over the next 7 - days. To prevent this, do you want to reset the inactivity - period for all template workspaces? + This change will result in{" "} + {inactiveWorkspacesToGoDormant} workspace(s) + being immediately transitioned to the dormant state and{" "} + {inactiveWorkspacesToGoDormantInWeek} over the + next 7 days. To prevent this, do you want to reset the + inactivity period for all template workspaces?

= ({ <>

Dormancy Auto-Deletion

- This change will result in {dormantWorkspacesToBeDeleted}{" "} - workspace(s) being immediately deleted and{" "} - {dormantWorkspacesToBeDeletedInWeek} over the next 7 days. To - prevent this, do you want to reset the dormancy period for all - template workspaces? + This change will result in{" "} + {dormantWorkspacesToBeDeleted} workspace(s) + being immediately deleted and{" "} + {dormantWorkspacesToBeDeletedInWeek} over the + next 7 days. To prevent this, do you want to reset the dormancy + period for all template workspaces?

Date: Wed, 26 Jun 2024 23:08:25 +0000 Subject: [PATCH 3/4] fix: remove (s) plural language --- .../TemplateSchedulePage/ScheduleDialog.stories.tsx | 4 ++-- .../TemplateSchedulePage/ScheduleDialog.tsx | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.stories.tsx b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.stories.tsx index 403c735d4c6ac..ee29803377494 100644 --- a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.stories.tsx +++ b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.stories.tsx @@ -19,7 +19,7 @@ type Story = StoryObj; export const DormancyThreshold: Story = { args: { dormantValueChanged: true, - inactiveWorkspacesToGoDormant: 2, + inactiveWorkspacesToGoDormant: 1, inactiveWorkspacesToGoDormantInWeek: 5, }, }; @@ -27,7 +27,7 @@ export const DormancyThreshold: Story = { export const DormancyDeletion: Story = { args: { deletionValueChanged: true, - dormantWorkspacesToBeDeleted: 2, + dormantWorkspacesToBeDeleted: 1, dormantWorkspacesToBeDeletedInWeek: 5, }, }; diff --git a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx index 87aa023ce7cb9..affbc4df5f9c9 100644 --- a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx +++ b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx @@ -68,9 +68,11 @@ export const ScheduleDialog: FC = ({

Dormancy Threshold

This change will result in{" "} - {inactiveWorkspacesToGoDormant} workspace(s) + {inactiveWorkspacesToGoDormant}{" "} + {inactiveWorkspacesToGoDormant === 1 ? "workspace" : "workspaces"}{" "} being immediately transitioned to the dormant state and{" "} - {inactiveWorkspacesToGoDormantInWeek} over the + {inactiveWorkspacesToGoDormantInWeek}{" "} + {inactiveWorkspacesToGoDormantInWeek === 1 ? "workspace" : "workspaces"} over the next 7 days. To prevent this, do you want to reset the inactivity period for all template workspaces?

@@ -94,9 +96,11 @@ export const ScheduleDialog: FC = ({

Dormancy Auto-Deletion

This change will result in{" "} - {dormantWorkspacesToBeDeleted} workspace(s) + {dormantWorkspacesToBeDeleted}{" "} + {dormantWorkspacesToBeDeleted === 1 ? "workspace" : "workspaces"}{" "} being immediately deleted and{" "} - {dormantWorkspacesToBeDeletedInWeek} over the + {dormantWorkspacesToBeDeletedInWeek}{" "} + {dormantWorkspacesToBeDeletedInWeek === 1 ? "workspace" : "workspaces"} over the next 7 days. To prevent this, do you want to reset the dormancy period for all template workspaces?

From 4df993cc701f8ebdde7a592b587341d2e59fd44c Mon Sep 17 00:00:00 2001 From: Jaayden Halko Date: Thu, 27 Jun 2024 14:25:01 +0000 Subject: [PATCH 4/4] fix: fix format --- .../TemplateSchedulePage/ScheduleDialog.tsx | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx index affbc4df5f9c9..f5463bef1a123 100644 --- a/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx +++ b/site/src/pages/TemplateSettingsPage/TemplateSchedulePage/ScheduleDialog.tsx @@ -69,11 +69,15 @@ export const ScheduleDialog: FC = ({

This change will result in{" "} {inactiveWorkspacesToGoDormant}{" "} - {inactiveWorkspacesToGoDormant === 1 ? "workspace" : "workspaces"}{" "} + {inactiveWorkspacesToGoDormant === 1 + ? "workspace" + : "workspaces"}{" "} being immediately transitioned to the dormant state and{" "} {inactiveWorkspacesToGoDormantInWeek}{" "} - {inactiveWorkspacesToGoDormantInWeek === 1 ? "workspace" : "workspaces"} over the - next 7 days. To prevent this, do you want to reset the + {inactiveWorkspacesToGoDormantInWeek === 1 + ? "workspace" + : "workspaces"}{" "} + over the next 7 days. To prevent this, do you want to reset the inactivity period for all template workspaces?

= ({

This change will result in{" "} {dormantWorkspacesToBeDeleted}{" "} - {dormantWorkspacesToBeDeleted === 1 ? "workspace" : "workspaces"}{" "} + {dormantWorkspacesToBeDeleted === 1 + ? "workspace" + : "workspaces"}{" "} being immediately deleted and{" "} {dormantWorkspacesToBeDeletedInWeek}{" "} - {dormantWorkspacesToBeDeletedInWeek === 1 ? "workspace" : "workspaces"} over the - next 7 days. To prevent this, do you want to reset the dormancy - period for all template workspaces? + {dormantWorkspacesToBeDeletedInWeek === 1 + ? "workspace" + : "workspaces"}{" "} + over the next 7 days. To prevent this, do you want to reset the + dormancy period for all template workspaces?

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy