From f260dc08c12599cd5748a823a002d034a370c9fc Mon Sep 17 00:00:00 2001 From: Dajahi Wiley Date: Wed, 12 Jun 2024 17:01:02 -0400 Subject: [PATCH 1/4] Update copy used in Linode Create and Linode Create v2 flows --- .../components/AccessPanel/AccessPanel.tsx | 23 ++++++++++++++++--- .../components/DiskEncryption/constants.tsx | 13 +++++++++-- .../Linodes/LinodeCreatev2/Access.tsx | 20 ++++++++++++++-- 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/packages/manager/src/components/AccessPanel/AccessPanel.tsx b/packages/manager/src/components/AccessPanel/AccessPanel.tsx index f0b8d393b00..cb674d5bf70 100644 --- a/packages/manager/src/components/AccessPanel/AccessPanel.tsx +++ b/packages/manager/src/components/AccessPanel/AccessPanel.tsx @@ -1,14 +1,16 @@ -import { Theme } from '@mui/material/styles'; import * as React from 'react'; import { makeStyles } from 'tss-react/mui'; import { + DISK_ENCRYPTION_DEFAULT_DISTRIBUTED_INSTANCES, + DISK_ENCRYPTION_DISTRIBUTED_DESCRIPTION, DISK_ENCRYPTION_GENERAL_DESCRIPTION, DISK_ENCRYPTION_UNAVAILABLE_IN_REGION_COPY, } from 'src/components/DiskEncryption/constants'; import { DiskEncryption } from 'src/components/DiskEncryption/DiskEncryption'; import { useIsDiskEncryptionFeatureEnabled } from 'src/components/DiskEncryption/utils'; import { Paper } from 'src/components/Paper'; +import { getIsDistributedRegion } from 'src/components/RegionSelect/RegionSelect.utils'; import { SuspenseLoader } from 'src/components/SuspenseLoader'; import { Typography } from 'src/components/Typography'; import { useRegionsQuery } from 'src/queries/regions/regions'; @@ -17,6 +19,8 @@ import { doesRegionSupportFeature } from 'src/utilities/doesRegionSupportFeature import { Divider } from '../Divider'; import UserSSHKeyPanel from './UserSSHKeyPanel'; +import type { Theme } from '@mui/material/styles'; + const PasswordInput = React.lazy( () => import('src/components/PasswordInput/PasswordInput') ); @@ -94,6 +98,11 @@ export const AccessPanel = (props: Props) => { 'Disk Encryption' ); + const isDistributedRegion = getIsDistributedRegion( + regions ?? [], + selectedRegion ?? '' + ); + const handleChange = (e: React.ChangeEvent) => _handleChange(e.target.value); @@ -111,9 +120,17 @@ export const AccessPanel = (props: Props) => { <> toggleDiskEncryptionEnabled()} /> diff --git a/packages/manager/src/components/DiskEncryption/constants.tsx b/packages/manager/src/components/DiskEncryption/constants.tsx index a49b31115c5..01fc15f4567 100644 --- a/packages/manager/src/components/DiskEncryption/constants.tsx +++ b/packages/manager/src/components/DiskEncryption/constants.tsx @@ -2,15 +2,21 @@ import React from 'react'; import { Link } from 'src/components/Link'; -// @TODO LDE: Update "Learn more" link +const DISK_ENCRYPTION_GUIDE_LINK = + 'https://www.linode.com/docs/products/compute/compute-instances/guides/local-disk-encryption'; + export const DISK_ENCRYPTION_GENERAL_DESCRIPTION = ( <> Secure this Linode using data at rest encryption. Data center systems take care of encrypting and decrypting for you. After the Linode is created, use - Rebuild to enable or disable this feature. Learn more. + Rebuild to enable or disable this feature.{' '} + Learn more. ); +export const DISK_ENCRYPTION_DISTRIBUTED_DESCRIPTION = + 'Distributed Compute Instances are secured using disk encryption. Encryption and decryption are automatically managed for you.'; + const DISK_ENCRYPTION_UPDATE_PROTECT_CLUSTERS_DOCS_LINK = 'https://www.linode.com/docs/products/compute/compute-instances/guides/local-disk-encryption/'; @@ -30,6 +36,9 @@ export const DISK_ENCRYPTION_UPDATE_PROTECT_CLUSTERS_BANNER_KEY = export const DISK_ENCRYPTION_UNAVAILABLE_IN_REGION_COPY = 'Disk encryption is not available in the selected region.'; +export const DISK_ENCRYPTION_DEFAULT_DISTRIBUTED_INSTANCES = + 'Distributed instances are encrypted by default and the setting cannot be changed.'; + // Guidance export const DISK_ENCRYPTION_NODE_POOL_GUIDANCE_COPY = 'To enable disk encryption, delete the node pool and create a new node pool. New node pools are always encrypted.'; diff --git a/packages/manager/src/features/Linodes/LinodeCreatev2/Access.tsx b/packages/manager/src/features/Linodes/LinodeCreatev2/Access.tsx index 14862cb2573..76e00921304 100644 --- a/packages/manager/src/features/Linodes/LinodeCreatev2/Access.tsx +++ b/packages/manager/src/features/Linodes/LinodeCreatev2/Access.tsx @@ -3,6 +3,8 @@ import { Controller, useFormContext, useWatch } from 'react-hook-form'; import UserSSHKeyPanel from 'src/components/AccessPanel/UserSSHKeyPanel'; import { + DISK_ENCRYPTION_DEFAULT_DISTRIBUTED_INSTANCES, + DISK_ENCRYPTION_DISTRIBUTED_DESCRIPTION, DISK_ENCRYPTION_GENERAL_DESCRIPTION, DISK_ENCRYPTION_UNAVAILABLE_IN_REGION_COPY, } from 'src/components/DiskEncryption/constants'; @@ -10,6 +12,7 @@ import { DiskEncryption } from 'src/components/DiskEncryption/DiskEncryption'; import { useIsDiskEncryptionFeatureEnabled } from 'src/components/DiskEncryption/utils'; import { Divider } from 'src/components/Divider'; import { Paper } from 'src/components/Paper'; +import { getIsDistributedRegion } from 'src/components/RegionSelect/RegionSelect.utils'; import { Skeleton } from 'src/components/Skeleton'; import { inputMaxWidth } from 'src/foundations/themes/light'; import { useRestrictedGlobalGrantCheck } from 'src/hooks/useRestrictedGlobalGrantCheck'; @@ -37,6 +40,11 @@ export const Access = () => { 'Disk Encryption' ); + const isDistributedRegion = getIsDistributedRegion( + regions ?? [], + selectedRegion?.id ?? '' + ); + const isLinodeCreateRestricted = useRestrictedGlobalGrantCheck({ globalGrantType: 'add_linodes', }); @@ -83,12 +91,20 @@ export const Access = () => { ( field.onChange(checked ? 'enabled' : 'disabled') } - descriptionCopy={DISK_ENCRYPTION_GENERAL_DESCRIPTION} disabled={!regionSupportsDiskEncryption} - disabledReason={DISK_ENCRYPTION_UNAVAILABLE_IN_REGION_COPY} error={fieldState.error?.message} isEncryptDiskChecked={field.value === 'enabled'} /> From dbff12c18d6ed4dfba19c4fb31cad91dc3a0e1ab Mon Sep 17 00:00:00 2001 From: Dajahi Wiley Date: Wed, 12 Jun 2024 17:20:20 -0400 Subject: [PATCH 2/4] Added changeset: Revise LDE copy in Linode Create flow when Distributed region is selected --- .../.changeset/pr-10576-upcoming-features-1718227220058.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 packages/manager/.changeset/pr-10576-upcoming-features-1718227220058.md diff --git a/packages/manager/.changeset/pr-10576-upcoming-features-1718227220058.md b/packages/manager/.changeset/pr-10576-upcoming-features-1718227220058.md new file mode 100644 index 00000000000..b5d9b29f95d --- /dev/null +++ b/packages/manager/.changeset/pr-10576-upcoming-features-1718227220058.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Upcoming Features +--- + +Revise LDE copy in Linode Create flow when Distributed region is selected ([#10576](https://github.com/linode/manager/pull/10576)) From 69083fc5649a39a63dcd9cbafae0b29878a8a84d Mon Sep 17 00:00:00 2001 From: Dajahi Wiley Date: Wed, 12 Jun 2024 17:23:18 -0400 Subject: [PATCH 3/4] Tweak copy for DISK_ENCRYPTION_DEFAULT_DISTRIBUTED_INSTANCES --- packages/manager/src/components/DiskEncryption/constants.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/manager/src/components/DiskEncryption/constants.tsx b/packages/manager/src/components/DiskEncryption/constants.tsx index 01fc15f4567..fcfb2b4e789 100644 --- a/packages/manager/src/components/DiskEncryption/constants.tsx +++ b/packages/manager/src/components/DiskEncryption/constants.tsx @@ -37,7 +37,7 @@ export const DISK_ENCRYPTION_UNAVAILABLE_IN_REGION_COPY = 'Disk encryption is not available in the selected region.'; export const DISK_ENCRYPTION_DEFAULT_DISTRIBUTED_INSTANCES = - 'Distributed instances are encrypted by default and the setting cannot be changed.'; + 'Distributed Compute Instances are encrypted. This setting can not be changed.'; // Guidance export const DISK_ENCRYPTION_NODE_POOL_GUIDANCE_COPY = From 2a93697db7811e98cacf733cbb30086204a3b6f2 Mon Sep 17 00:00:00 2001 From: Dajahi Wiley Date: Fri, 14 Jun 2024 13:35:27 -0400 Subject: [PATCH 4/4] Update Security.test.tsx --- .../src/features/Linodes/LinodeCreatev2/Security.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/manager/src/features/Linodes/LinodeCreatev2/Security.test.tsx b/packages/manager/src/features/Linodes/LinodeCreatev2/Security.test.tsx index 001869bcf75..acd014cd307 100644 --- a/packages/manager/src/features/Linodes/LinodeCreatev2/Security.test.tsx +++ b/packages/manager/src/features/Linodes/LinodeCreatev2/Security.test.tsx @@ -156,7 +156,7 @@ describe('Security', () => { }); await findByLabelText( - 'Disk encryption is not available in the selected region.' + 'Disk encryption is not available in the selected region. Select another region to use Disk Encryption.' ); }); });