Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change: [M3-7250] – Properly surface VPC interface errors #9839

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

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))
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,16 @@ export const VPCPanel = (props: VPCPanelProps) => {
</Box>
}
/>
{assignPublicIPv4Address && publicIPv4Error && (
<Typography
sx={(theme) => ({
color: theme.color.red,
})}
>
{publicIPv4Error}
</Typography>
)}
</Box>
{assignPublicIPv4Address && publicIPv4Error && (
<Typography
sx={(theme) => ({
color: theme.color.red,
})}
>
{publicIPv4Error}
</Typography>
)}
</Stack>
)}
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export const InterfaceSelect = (props: CombinedProps) => {
handleChange({
ipam_address: null,
ipv4: {
nat_1_1: autoAssignLinodeIPv4 ? 'any' : undefined,
vpc: autoAssignVPCIPv4 ? undefined : vpcIPv4,
},
label: null,
Expand All @@ -140,6 +141,7 @@ export const InterfaceSelect = (props: CombinedProps) => {
handleChange({
ipam_address: null,
ipv4: {
nat_1_1: autoAssignLinodeIPv4 ? 'any' : undefined,
vpc: autoAssignVPCIPv4 ? undefined : vpcIPv4,
},
label: null,
Expand Down