-
Notifications
You must be signed in to change notification settings - Fork 366
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
feat: [M3-6971] Add dynamic pricing model to Volume creation flows #9569
Conversation
const price = getClampedPrice(value, currentSize); | ||
|
||
return ( | ||
<Box marginTop={4}> | ||
<DisplayPrice interval="mo" price={price} /> | ||
<DisplayPrice interval="mo" price={Number(price)} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's inconsistencies in the way price is passed to children resulting in some expecting a string and others a number, such as DisplayPrice
& Currency
. Just something to be aware when we'll get the values from the API, which is when we can perhaps try to consolidate
left: `calc(${SIZE_FIELD_WIDTH}px + ${theme.spacing(2)})`, | ||
position: 'absolute', | ||
top: 50, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export default compose(connected, withProfile)(VolumeDrawer); | ||
const VolumeDrawerWithHOCs = withProfile(connected(VolumeDrawer)); | ||
|
||
export default VolumeDrawerWithHOCs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored this to be a functional component in order to use hooks. There is much more refactor needed for volumes, a lot of those files have not been touched in a long time. However I wanted to keep the diff related to this effort and not introduce other errors not pertaining to the scope of the ticket's requirements
* @param size The size of a Volume in GBs | ||
* @returns the base price of a volume based on its size | ||
*/ | ||
export const getDynamicVolumePrice = ({ flags, regionId, size }: Props) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on Options
instead of Props
? Props make me think React Component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure why not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple minor things with the helper text on top of the create form, but otherwise this looks good. Thanks!
@@ -0,0 +1,5 @@ | |||
--- | |||
"@linode/manager": Changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"@linode/manager": Changed | |
"@linode/manager": Upcoming Features |
<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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nitpick, but with the addition of another sentence, the way that we're displaying our copy is a little strange now, with that line break separating "Linode" onto the next line instead of at the end of the sentence. Can we potentially adjust max-width
to something like 700
here to make our helper text more scannable?
bcfd7a3
to
c7057fb
Compare
Description 📝
This PR adds dynamic (DC based) pricing to the Volume creation flows.
Preview 📷
How to test 🧪
DC-Specific Pricing
feature flag in the dev settingsFlows: