From effe2a71b39b787fdfb95bcb454efa26e71d2b98 Mon Sep 17 00:00:00 2001 From: mjac0bs Date: Thu, 1 May 2025 13:49:17 -0700 Subject: [PATCH 1/3] Validate onChange to use the updated IP addresses --- .../CreateCluster/ControlPlaneACLPane.tsx | 15 --------------- .../Kubernetes/CreateCluster/CreateCluster.tsx | 14 +++++++++++--- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/packages/manager/src/features/Kubernetes/CreateCluster/ControlPlaneACLPane.tsx b/packages/manager/src/features/Kubernetes/CreateCluster/ControlPlaneACLPane.tsx index 303c67c895d..2c7b35d2111 100644 --- a/packages/manager/src/features/Kubernetes/CreateCluster/ControlPlaneACLPane.tsx +++ b/packages/manager/src/features/Kubernetes/CreateCluster/ControlPlaneACLPane.tsx @@ -12,7 +12,6 @@ import * as React from 'react'; import { ErrorMessage } from 'src/components/ErrorMessage'; import { MultipleIPInput } from 'src/components/MultipleIPInput/MultipleIPInput'; -import { validateIPs } from 'src/utilities/ipUtils'; import { CREATE_CLUSTER_ENTERPRISE_TIER_ACL_COPY, @@ -87,13 +86,6 @@ export const ControlPlaneACLPane = (props: ControlPlaneACLProps) => { disabled={isAcknowledgementChecked} ips={ipV4Addr} isLinkStyled - onBlur={(_ips: ExtendedIP[]) => { - const validatedIPs = validateIPs(_ips, { - allowEmptyAddress: true, - errorMessage: 'Must be a valid IPv4 address.', - }); - handleIPv4Change(validatedIPs); - }} onChange={handleIPv4Change} title="IPv4 Addresses or CIDRs" /> @@ -103,13 +95,6 @@ export const ControlPlaneACLPane = (props: ControlPlaneACLProps) => { disabled={isAcknowledgementChecked} ips={ipV6Addr} isLinkStyled - onBlur={(_ips: ExtendedIP[]) => { - const validatedIPs = validateIPs(_ips, { - allowEmptyAddress: true, - errorMessage: 'Must be a valid IPv6 address.', - }); - handleIPv6Change(validatedIPs); - }} onChange={handleIPv6Change} title="IPv6 Addresses or CIDRs" /> diff --git a/packages/manager/src/features/Kubernetes/CreateCluster/CreateCluster.tsx b/packages/manager/src/features/Kubernetes/CreateCluster/CreateCluster.tsx index 334d41384e8..ef694cac816 100644 --- a/packages/manager/src/features/Kubernetes/CreateCluster/CreateCluster.tsx +++ b/packages/manager/src/features/Kubernetes/CreateCluster/CreateCluster.tsx @@ -48,7 +48,7 @@ import { useAllTypes } from 'src/queries/types'; import { getAPIErrorOrDefault, getErrorMap } from 'src/utilities/errorUtils'; import { extendType } from 'src/utilities/extendType'; import { filterCurrentTypes } from 'src/utilities/filterCurrentLinodeTypes'; -import { stringToExtendedIP } from 'src/utilities/ipUtils'; +import { stringToExtendedIP, validateIPs } from 'src/utilities/ipUtils'; import { DOCS_LINK_LABEL_DC_PRICING, UNKNOWN_PRICE, @@ -537,10 +537,18 @@ export const CreateCluster = () => { enableControlPlaneACL={controlPlaneACL} errorText={errorMap.control_plane} handleIPv4Change={(newIpV4Addr: ExtendedIP[]) => { - setIPv4Addr(newIpV4Addr); + const validatedIPs = validateIPs(newIpV4Addr, { + allowEmptyAddress: true, + errorMessage: 'Must be a valid IPv4 address.', + }); + setIPv4Addr(validatedIPs); }} handleIPv6Change={(newIpV6Addr: ExtendedIP[]) => { - setIPv6Addr(newIpV6Addr); + const validatedIPs = validateIPs(newIpV6Addr, { + allowEmptyAddress: true, + errorMessage: 'Must be a valid IPv6 address.', + }); + setIPv6Addr(validatedIPs); }} handleIsAcknowledgementChecked={(isChecked: boolean) => { setIsACLAcknowledgementChecked(isChecked); From 1e62bf9519d482c72092b38d9b68d4b4a06056df Mon Sep 17 00:00:00 2001 From: mjac0bs Date: Thu, 1 May 2025 14:10:50 -0700 Subject: [PATCH 2/3] Update changelog --- packages/manager/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/manager/CHANGELOG.md b/packages/manager/CHANGELOG.md index 2baedf31f09..2b4f5d35184 100644 --- a/packages/manager/CHANGELOG.md +++ b/packages/manager/CHANGELOG.md @@ -34,6 +34,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - Missing `PublicIPAddressesTooltip` for VPC-only Linodes without an explicitly marked primary VPC interface ([#12122](https://github.com/linode/manager/pull/12122)) - Fix incorrect card sizing at 1920px+ in LKE Tier panel ([#12076](https://github.com/linode/manager/pull/12076)) - Bugs in Linode Create, Landing & Detail Pages ([#12028](https://github.com/linode/manager/pull/12028)) +- Fix persisting ACL IP validation error on clear ([#12144](https://github.com/linode/manager/pull/12144)) ### Tech Stories: @@ -76,7 +77,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - IAM RBAC: Add logic for getting a description for the facade roles ([#12053](https://github.com/linode/manager/pull/12053)) - IAM RBAC: Fix bugs in the Entities component and the loading state for tabs ([#12062](https://github.com/linode/manager/pull/12062)) - CloudPulse: Update metrics API request payload and legend row titles as part of api upgrade from v1beta to v2beta ([#12063](https://github.com/linode/manager/pull/12063)) -- Fix persisting ACL IP validation error and disable fields if user selects to provide IPs later ([#12067](https://github.com/linode/manager/pull/12067)) +- Disable ACL IP address fields if user selects to provide IPs later ([#12067](https://github.com/linode/manager/pull/12067)) - Add label field to CreateFirewallDrawer form when using firewall templates ([#12069](https://github.com/linode/manager/pull/12069)) - CloudPulse: Show regions based on available resources and dependent filters in dashboards `GlobalFilter` section ([#12078](https://github.com/linode/manager/pull/12078)) - Pass widget filters configuration from dashboards in metrics call in cloudpulse dashboards ([#12079](https://github.com/linode/manager/pull/12079)) From 5f29d8d6334aaa5ac39571fd9e216ebc26e46417 Mon Sep 17 00:00:00 2001 From: mjac0bs Date: Fri, 2 May 2025 09:06:16 -0700 Subject: [PATCH 3/3] Address feedback: fix ACL toggle clickable area --- .../CreateCluster/ControlPlaneACLPane.tsx | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/manager/src/features/Kubernetes/CreateCluster/ControlPlaneACLPane.tsx b/packages/manager/src/features/Kubernetes/CreateCluster/ControlPlaneACLPane.tsx index 2c7b35d2111..c39def354d4 100644 --- a/packages/manager/src/features/Kubernetes/CreateCluster/ControlPlaneACLPane.tsx +++ b/packages/manager/src/features/Kubernetes/CreateCluster/ControlPlaneACLPane.tsx @@ -8,6 +8,7 @@ import { Typography, } from '@linode/ui'; import { FormLabel, styled } from '@mui/material'; +import Grid from '@mui/material/Grid2'; import * as React from 'react'; import { ErrorMessage } from 'src/components/ErrorMessage'; @@ -66,17 +67,19 @@ export const ControlPlaneACLPane = (props: ControlPlaneACLProps) => { ? CREATE_CLUSTER_ENTERPRISE_TIER_ACL_COPY : CREATE_CLUSTER_STANDARD_TIER_ACL_COPY} - setControlPlaneACL(!enableControlPlaneACL)} - /> - } - label="Enable Control Plane ACL" - /> + + setControlPlaneACL(!enableControlPlaneACL)} + /> + } + label="Enable Control Plane ACL" + /> + {enableControlPlaneACL && (