From 9913df47b09b4cdbd1644fbb6cd7eb12dc2dd521 Mon Sep 17 00:00:00 2001 From: Sophie Stadler Date: Thu, 9 May 2024 11:10:15 -0400 Subject: [PATCH] DEVPROD-6239: Edit host uptime schedule (#105) --- .../__snapshots__/DayPicker.stories.storyshot | 1 + .../spruce/src/components/DayPicker/index.tsx | 2 +- .../FieldTemplates/UserTagRow.tsx | 22 - .../Spawn/editHostModal/getFormSchema.tsx | 381 ++++++------------ .../Spawn/editHostModal/transformer.test.ts | 20 + .../Spawn/editHostModal/transformer.ts | 9 +- .../components/Spawn/editHostModal/types.ts | 5 +- .../components/Spawn/editHostModal/utils.ts | 5 + .../src/components/Spawn/getFormSchema.tsx | 278 ++++++++++++- apps/spruce/src/components/Spawn/index.tsx | 7 +- .../Spawn/spawnHostModal/getFormSchema.tsx | 214 +--------- .../Spawn/spawnHostModal/transformer.ts | 54 +-- .../components/Spawn/spawnHostModal/types.ts | 14 +- apps/spruce/src/components/Spawn/utils.ts | 129 ------ .../src/components/Spawn/utils/expiration.ts | 24 ++ .../components/Spawn/utils/hostUptime.test.ts | 339 ++++++++++++++++ .../src/components/Spawn/utils/hostUptime.ts | 252 ++++++++++++ .../src/components/Spawn/utils/index.ts | 14 + .../ArrayFieldTemplates/index.tsx | 1 + .../ObjectFieldTemplates/index.tsx | 2 +- .../SpruceForm/Widgets/DateTimePicker.tsx | 1 + .../SpruceForm.stories.storyshot | 1 + apps/spruce/src/constants/fieldMaps.ts | 4 +- apps/spruce/src/gql/generated/types.ts | 11 + apps/spruce/src/gql/mocks/getSpruceConfig.ts | 8 +- apps/spruce/src/gql/mocks/myVolumesQuery.ts | 60 +++ .../src/gql/mutations/edit-spawn-host.graphql | 2 + apps/spruce/src/gql/queries/my-hosts.graphql | 9 + .../spawnHost/EditSpawnHostModal.test.tsx | 333 +++++++++++++++ .../spawn/spawnHost/EditSpawnHostModal.tsx | 55 ++- .../spawnHostButton/SpawnHostModal.tsx | 27 +- .../spawnVolume/SpawnVolumeModal.test.tsx | 60 +-- 32 files changed, 1560 insertions(+), 784 deletions(-) delete mode 100644 apps/spruce/src/components/Spawn/editHostModal/FieldTemplates/UserTagRow.tsx delete mode 100644 apps/spruce/src/components/Spawn/utils.ts create mode 100644 apps/spruce/src/components/Spawn/utils/expiration.ts create mode 100644 apps/spruce/src/components/Spawn/utils/hostUptime.test.ts create mode 100644 apps/spruce/src/components/Spawn/utils/hostUptime.ts create mode 100644 apps/spruce/src/components/Spawn/utils/index.ts create mode 100644 apps/spruce/src/gql/mocks/myVolumesQuery.ts create mode 100644 apps/spruce/src/pages/spawn/spawnHost/EditSpawnHostModal.test.tsx diff --git a/apps/spruce/src/components/DayPicker/__snapshots__/DayPicker.stories.storyshot b/apps/spruce/src/components/DayPicker/__snapshots__/DayPicker.stories.storyshot index 7f64d4afd..3f3ef6222 100644 --- a/apps/spruce/src/components/DayPicker/__snapshots__/DayPicker.stories.storyshot +++ b/apps/spruce/src/components/DayPicker/__snapshots__/DayPicker.stories.storyshot @@ -4,6 +4,7 @@ exports[`Snapshot Tests DayPicker.stories Default 1`] = `