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

fix: [M3-7739] - Fix error when enabling backups for Linodes in regions with $0 price #10153

Merged
Changes from 1 commit
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
Expand Up @@ -47,6 +47,9 @@ export const EnableBackupsDialog = (props: Props) => {
type,
});

const hasBackupsMonthlyPriceError =
!backupsMonthlyPrice && backupsMonthlyPrice !== 0;
Comment on lines +50 to +51
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't 100% sure what the clearest way to express this is

Opted for this since it telegraphs that 0 is a valid value, but if something else would be clearer to the team, like checking explicitly for null or undefined, I'm happy to tweak this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objections from me.


const { enqueueSnackbar } = useSnackbar();

const { checkForNewEvents } = useEventsPollingActions();
Expand All @@ -70,7 +73,7 @@ export const EnableBackupsDialog = (props: Props) => {
<ActionsPanel
primaryButtonProps={{
'data-testid': 'confirm-enable-backups',
disabled: !backupsMonthlyPrice,
disabled: hasBackupsMonthlyPriceError,
label: 'Enable Backups',
loading: isLoading,
onClick: handleEnableBackups,
Expand All @@ -92,7 +95,7 @@ export const EnableBackupsDialog = (props: Props) => {
open={open}
title="Enable backups?"
>
{backupsMonthlyPrice ? (
{!hasBackupsMonthlyPriceError ? (
<Typography>
Are you sure you want to enable backups on this Linode?{` `}
This will add <Currency quantity={backupsMonthlyPrice} />
Expand Down
Loading