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

feat: [M3-7144] - MNTP Dialog Updates for DC-specific pricing #9692

Merged
merged 8 commits into from
Sep 19, 2023

Conversation

abailly-akamai
Copy link
Contributor

@abailly-akamai abailly-akamai commented Sep 18, 2023

Description 📝

This PR improves the copy and typography in the Network Transfer Display Dialog.

Major Changes 🔄

  • Modifies copy
  • Adds header tooltips
  • Modifies size of typography elements

Preview 📷

Before After
Screenshot 2023-09-18 at 12 12 26 (2) Screenshot 2023-09-18 at 12 06 32
Screenshot 2023-09-18 at 12 10 08 (2)

How to test 🧪

Setup

  1. Enable the DC-Specific Pricing flag
  2. Enable MSW

Testing Steps

  1. Navigate to /linodes
  2. Click on the "Monthly Network Transfer Pool" under the linodes table list
  3. Confirm copy, tooltip behaviour and style changes
  4. Modify the mock data and re-run the steps above (with 0, 1 and 2 or more transfer regions)

@abailly-akamai abailly-akamai self-assigned this Sep 18, 2023
@@ -38,7 +38,7 @@ interface Props
* Enables a leaveDelay of 3000ms
* @default false
*/
leaveDelay?: boolean;
leaveDelay?: number;
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 fixes an existing type issue on the component (unrelated to main PR purpose)

@@ -142,6 +142,7 @@ export const TooltipIcon = (props: Props) => {
return (
<Tooltip
classes={classes}
componentsProps={props.componentsProps}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those were not picked up otherwise. Decided against passing {...props} to avoid regressions related to spreading everything (unknown HTML props etc)

/>
</Typography>
);
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's enough coverage of the feature to leave this new micro component without a unit test

@abailly-akamai abailly-akamai marked this pull request as ready for review September 18, 2023 16:20
@abailly-akamai abailly-akamai requested a review from a team as a code owner September 18, 2023 16:20
@abailly-akamai abailly-akamai requested review from coliu-akamai and tyler-akamai and removed request for a team September 18, 2023 16:20
@mjac0bs mjac0bs changed the title Feat: [M3-7144] Network Transfer Dialog Updates feat: [M3-7144] - MNTP Dialog Updates for DC-specific pricing Sep 18, 2023
Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Copy and styling changes are mostly looking good. Tested different screen sizes (all looked good) and different combinations of pools (found a tooltip bug).

The couple things we'll want to fix

  • Did extending the divider to the edge of the dialog result in the horizontal scroll bar that is now appearing at the bottom of the dialog?
Screen.Recording.2023-09-18.at.9.45.33.AM.mov
  • When region_transfers is an empty array, the tooltip copy is incomplete. We'll need some logic there to end that sentence coherently. "except for those with data-center specific transfer", maybe?

Screenshot 2023-09-18 at 9 58 24 AM

@abailly-akamai
Copy link
Contributor Author

@mjac0bs feedback addressed!

updated empty region_transfers tooltip to read: "The Global Pool includes transfer associated with active services in all regions." which to me is more relevant than adding copy that does not apply to the user.

All in all I am not liking this. I don't think Helper text should have conditional copy since it is an interactive element hidden by default. Perhaps this is something we can revisit at some point.

@mjac0bs
Copy link
Contributor

mjac0bs commented Sep 18, 2023

which to me is more relevant than adding copy that does not apply to the user.

I think this is worth another opinion on too, probably Matthew's, because I worry we're contradicting ourselves here. The dialog already mentions the existence of regions calculating transfer differently, hinting at dc-specific pools.

Screenshot 2023-09-18 at 1 23 12 PM

I don't think Helper text should have conditional copy since it is an interactive element hidden by default.

Generally, I agree with this, but in this case, I think that the user is looking for content that is most relevant to them, so I don't have an issue with the conditional cases here. But we can revisit with UX, of course.

@abailly-akamai
Copy link
Contributor Author

@mjac0bs how about replacing "in all regions" with "in your devices regions" - would work for both cases

@mjac0bs
Copy link
Contributor

mjac0bs commented Sep 18, 2023

@mjac0bs how about replacing "in all regions" with "in your devices regions" - would work for both cases

This sounds good to me. 👍🏼 With the caveat that it would need to be "in your devices' regions", possessive, since regions belong to the devices.

Copy link
Contributor

@coliu-akamai coliu-akamai left a comment

Choose a reason for hiding this comment

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

So I think this is just the MSW being strange (the logic looks good to me and all the cases I've mentioned below have worked as expected at least once, so I'm unsure what's going on), but sometimes I get the following, and it's not really consistent when I get it:

image

Other than that, tested the following:

  • 0 regions
  • 1 region
  • 2 regions
  • 3 regions
    and different widths + dark-mode and things looked good (except for the occasional flakiness like in the above screenshot but that's probably just the MSW?) 🎉 + left some very small comments


return (
<Dialog
fullWidth
maxWidth="sm"
onClose={onClose}
open={isOpen}
sx={{}}
Copy link
Contributor

Choose a reason for hiding this comment

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

do we still need the sx here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I also think we can remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed!

* @example formatRegionList(['Region 1', 'Region 2', 'Region 3']) // 'Region 1, Region 2 and Region 3'
* @example formatRegionList(['Region 1, Region 2']) // 'Region 1 and Region 2'
* @example formatRegionList(['Region 1']) // 'Region 1'
* @example formatRegionList([]) // ''
Copy link
Contributor

@coliu-akamai coliu-akamai Sep 19, 2023

Choose a reason for hiding this comment

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

super small, but worth writing a test case for this as well (the empty [] case) just to hit all the cases 😆

Copy link
Contributor

Choose a reason for hiding this comment

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

Seconding this. 👍🏼

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure thing, done

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

This looks good. The horizontal scroll is gone and the tooltip copy updates dynamically with different regions (0, 1, 2, 3, 4). Also confirmed that regions will display as long as they're in region_transfers, even if the quota is 0, as we'd expect.

I can't replicate the issue that @coliu-akamai was seeing, but with a test case for that util's empty case, this should be good to go. (Ha, this was done as I was writing this. 🚢 )


return (
<Dialog
fullWidth
maxWidth="sm"
onClose={onClose}
open={isOpen}
sx={{}}
Copy link
Contributor

Choose a reason for hiding this comment

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

I also think we can remove it.

* @example formatRegionList(['Region 1', 'Region 2', 'Region 3']) // 'Region 1, Region 2 and Region 3'
* @example formatRegionList(['Region 1, Region 2']) // 'Region 1 and Region 2'
* @example formatRegionList(['Region 1']) // 'Region 1'
* @example formatRegionList([]) // ''
Copy link
Contributor

Choose a reason for hiding this comment

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

Seconding this. 👍🏼

@abailly-akamai
Copy link
Contributor Author

@coliu-akamai yeah have not been able to repro this either. Other fixes addressed!

Copy link
Contributor

@coliu-akamai coliu-akamai left a comment

Choose a reason for hiding this comment

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

Yeah not too sure what was causing that issue, but since all the tests are working as expected, I don't think it should be a problem! approving 🎉

@mjac0bs mjac0bs added the Approved Multiple approvals and ready to merge! label Sep 19, 2023
@abailly-akamai abailly-akamai merged commit bc25cd6 into linode:develop Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! DC-Specific Pricing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants