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-7138] - Fix Create Volume Drawer static pricing copy and misplaced helper text #9683

Merged
merged 3 commits into from
Sep 15, 2023
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
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-9683-fixed-1694731625764.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Misplaced helper text and static copy in Linode Create Volume drawer ([#9683](https://github.com/linode/manager/pull/9683))
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ const CreateVolumeForm: React.FC<CombinedProps> = (props) => {
>
{dcSpecificPricing ? (
<span>
A single Volume can range from 10 to 10240 GB in size. Up
to eight Volumes can be attached to a single Linode.
Select a region to see cost per GB.
A single Volume can range from 10 to {MAX_VOLUME_SIZE} GB
in size. Up to to eight Volumes can be attached to a
single Linode. Select a region to see cost per GB.
</span>
) : (
<span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,18 @@ const CreateVolumeForm: React.FC<CombinedProps> = (props) => {
data-qa-volume-size-help
variant="body1"
>
A single Volume can range from 10 to {MAX_VOLUME_SIZE} gigabytes
in size and costs $0.10/GB per month. Up to eight volumes can be
attached to a single Linode.
{flags.dcSpecificPricing ? (
<span>
A single Volume can range from 10 to {MAX_VOLUME_SIZE} GB in
size. Up to eight Volumes can be attached to a single Linode.
</span>
) : (
<span>
A single Volume can range from 10 to {MAX_VOLUME_SIZE} GB in
size and costs $0.10/GB per month. <br />
Up to eight volumes can be attached to a single Linode.
</span>
)}
</Typography>

<LabelField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,15 @@ const SizeField: React.FC<CombinedProps> = (props) => {
size: value,
});

const legacyHelperText = (
const priceDisplayText = (
<FormHelperText>
{resize || isFromLinode ? (
'The size of the new volume in GB.'
) : (
{resize || isFromLinode ? null : (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change was also made in the big Volumes refactor PR.

I don't see reason why we'd want to keep this text; it was not displaying in the correct place in the drawers.

I also updated the name to priceDisplayText because legacyHelperText felt misleading. We still want the price to display, even after DC pricing changes, as long as a region is selected.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed. I must have missed this one when working on volumes.

<span className={classes.createVolumeText}>${price}/month</span>
)}
</FormHelperText>
);

const dynamicPricingHelperText = !resize && (
const dynamicPricingHelperText = !resize && !isFromLinode && (
<Box marginLeft={'10px'} marginTop={'4px'}>
<Typography>Select a region to see cost per month.</Typography>
</Box>
Expand Down Expand Up @@ -115,9 +113,9 @@ const SizeField: React.FC<CombinedProps> = (props) => {
<div className={classes.priceDisplay}>
{dcSpecificPricing
? hasSelectedRegion
? legacyHelperText
? priceDisplayText
: dynamicPricingHelperText
: legacyHelperText}
: priceDisplayText}
</div>
</>
);
Expand Down