From 625919e1cf757836801577823e671582b5fcb654 Mon Sep 17 00:00:00 2001 From: Dajahi Wiley Date: Tue, 24 Oct 2023 13:16:37 -0400 Subject: [PATCH 1/6] Remove temp logic for surfacing ipv4.vpc and ipv4.nat_1_1 errors --- .../LinodeConfigs/LinodeConfigDialog.tsx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/packages/manager/src/features/Linodes/LinodesDetail/LinodeConfigs/LinodeConfigDialog.tsx b/packages/manager/src/features/Linodes/LinodesDetail/LinodeConfigs/LinodeConfigDialog.tsx index c45b7275fa9..3b55047488a 100644 --- a/packages/manager/src/features/Linodes/LinodesDetail/LinodeConfigs/LinodeConfigDialog.tsx +++ b/packages/manager/src/features/Linodes/LinodesDetail/LinodeConfigs/LinodeConfigDialog.tsx @@ -425,20 +425,9 @@ export const LinodeConfigDialog = (props: Props) => { }); }; - // @TODO VPC: Remove this override and surface the field errors appropriately - // once API fixes interface index bug for ipv4.vpc & ipv4.nat_1_1 errors - const overrideFieldForIPv4 = (error: APIError[]) => { - error.forEach((err) => { - if (err.field && ['ipv4.nat_1_1', 'ipv4.vpc'].includes(err.field)) { - err.field = 'interfaces'; - } - }); - }; - formik.setSubmitting(false); overrideFieldForDevices(error); - overrideFieldForIPv4(error); handleFieldErrors(formik.setErrors, error); From d8b484d5c60f83ce13b210463cf4a0fbb88c9ccb Mon Sep 17 00:00:00 2001 From: Dajahi Wiley Date: Tue, 24 Oct 2023 16:23:55 -0400 Subject: [PATCH 2/6] Move error outside of to prevent crunched formatting --- .../Linodes/LinodesCreate/VPCPanel.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/manager/src/features/Linodes/LinodesCreate/VPCPanel.tsx b/packages/manager/src/features/Linodes/LinodesCreate/VPCPanel.tsx index f841d73cabd..bf6198e03b4 100644 --- a/packages/manager/src/features/Linodes/LinodesCreate/VPCPanel.tsx +++ b/packages/manager/src/features/Linodes/LinodesCreate/VPCPanel.tsx @@ -304,16 +304,16 @@ export const VPCPanel = (props: VPCPanelProps) => { } /> - {assignPublicIPv4Address && publicIPv4Error && ( - ({ - color: theme.color.red, - })} - > - {publicIPv4Error} - - )} + {assignPublicIPv4Address && publicIPv4Error && ( + ({ + color: theme.color.red, + })} + > + {publicIPv4Error} + + )} )} From 7451d78d53a3983baf431453cc878cfa9d1fd42c Mon Sep 17 00:00:00 2001 From: Dajahi Wiley Date: Tue, 24 Oct 2023 16:43:06 -0400 Subject: [PATCH 3/6] Added changeset: Removed temporary code for surfacing VPC interface errors and fixed formatting of error in Linode Config dialog --- .../.changeset/pr-9839-upcoming-features-1698180186838.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 packages/manager/.changeset/pr-9839-upcoming-features-1698180186838.md diff --git a/packages/manager/.changeset/pr-9839-upcoming-features-1698180186838.md b/packages/manager/.changeset/pr-9839-upcoming-features-1698180186838.md new file mode 100644 index 00000000000..e28a6a64eb1 --- /dev/null +++ b/packages/manager/.changeset/pr-9839-upcoming-features-1698180186838.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Upcoming Features +--- + +Removed temporary code for surfacing VPC interface errors and fixed formatting of error in Linode Config dialog ([#9839](https://github.com/linode/manager/pull/9839)) From 277d6aaf94078e6adefc848dd93332ad0dde4393 Mon Sep 17 00:00:00 2001 From: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:48:24 -0400 Subject: [PATCH 4/6] Update packages/manager/.changeset/pr-9839-upcoming-features-1698180186838.md Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com> --- .../.changeset/pr-9839-upcoming-features-1698180186838.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/manager/.changeset/pr-9839-upcoming-features-1698180186838.md b/packages/manager/.changeset/pr-9839-upcoming-features-1698180186838.md index e28a6a64eb1..464cd8a5880 100644 --- a/packages/manager/.changeset/pr-9839-upcoming-features-1698180186838.md +++ b/packages/manager/.changeset/pr-9839-upcoming-features-1698180186838.md @@ -2,4 +2,4 @@ "@linode/manager": Upcoming Features --- -Removed temporary code for surfacing VPC interface errors and fixed formatting of error in Linode Config dialog ([#9839](https://github.com/linode/manager/pull/9839)) +Remove temporary code for surfacing VPC interface errors and fix formatting of error in Linode Config dialog ([#9839](https://github.com/linode/manager/pull/9839)) From bd8898a2a0f3caf7561d43884781c889e418c808 Mon Sep 17 00:00:00 2001 From: Dajahi Wiley Date: Wed, 25 Oct 2023 15:49:58 -0400 Subject: [PATCH 5/6] Fix bug where the auto-assign a public IPv4 address checkbox was being discarded upon a VPC or subnet selection change --- .../Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx b/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx index 1e7bb13c0db..ba266c38a09 100644 --- a/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx +++ b/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx @@ -124,10 +124,11 @@ export const InterfaceSelect = (props: CombinedProps) => { purpose, }); - const handleVPCLabelChange = (selectedVPCId: number) => + const handleVPCLabelChange = (selectedVPCId: number) => { handleChange({ ipam_address: null, ipv4: { + nat_1_1: autoAssignLinodeIPv4 ? 'any' : undefined, vpc: autoAssignVPCIPv4 ? undefined : vpcIPv4, }, label: null, @@ -135,11 +136,13 @@ export const InterfaceSelect = (props: CombinedProps) => { subnet_id: undefined, vpc_id: selectedVPCId, }); + }; const handleSubnetChange = (selectedSubnetId: number) => handleChange({ ipam_address: null, ipv4: { + nat_1_1: autoAssignLinodeIPv4 ? 'any' : undefined, vpc: autoAssignVPCIPv4 ? undefined : vpcIPv4, }, label: null, From 51f01e8ac25882dc9bd5f816d11328e053c46890 Mon Sep 17 00:00:00 2001 From: Dajahi Wiley Date: Wed, 25 Oct 2023 15:50:58 -0400 Subject: [PATCH 6/6] Undo unnecessary curly braces --- .../Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx b/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx index ba266c38a09..5ac50fb93b1 100644 --- a/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx +++ b/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx @@ -124,7 +124,7 @@ export const InterfaceSelect = (props: CombinedProps) => { purpose, }); - const handleVPCLabelChange = (selectedVPCId: number) => { + const handleVPCLabelChange = (selectedVPCId: number) => handleChange({ ipam_address: null, ipv4: { @@ -136,7 +136,6 @@ export const InterfaceSelect = (props: CombinedProps) => { subnet_id: undefined, vpc_id: selectedVPCId, }); - }; const handleSubnetChange = (selectedSubnetId: number) => handleChange({