-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fixes whole campaign not being fetched #97115
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~6 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
@@ -875,7 +879,7 @@ export default function CampaignItemDetails( props: Props ) { | |||
label={ chartSource } | |||
/> | |||
{ getCampaignStatsChart( | |||
campaignStats?.series[ chartSource ] ?? [], | |||
campaignStats?.series[ chartSource ] ?? null, |
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.
empty array can be a valid response for no data, so I intend to handle these cases differently and so intentionally passing null here
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.
i couldnt test everything as i dont have a lot of active campaigns (in prod or in local)
I tested the refetching of the data when I switch date ranges and did a thorough code review
everything LGTM
Hey @therocket-gr, just letting you know that I manage having prod data locally with the trick James provided in his earlier PR. Basically, you change the ID of your test campaign to Druid has data for that campaign, so you can operate with The intention of this message is not to ask you to test again (I'm testing it right now) since you've already do CR, but to let you know about an approach how to test similar code changes in the future. |
thanks for the extra info :) |
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.
Thanks @j6ll!
The code looks great and works as advertised.
Although I left a comment about a suggestion from VS Code, it's definitely not a blocker to go ahead.
@@ -63,7 +63,7 @@ const CampaignStatsLineChart = ( { data, source, resolution }: GraphProps ) => { | |||
|
|||
const formatDate = ( date: Date, hourly: boolean ) => { | |||
const options: Intl.DateTimeFormatOptions = hourly | |||
? { hour: 'numeric', minute: 'numeric' } | |||
? { month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' } | |||
: { month: 'short', day: 'numeric' }; | |||
return new Intl.DateTimeFormat( locale, options ).format( date ); | |||
}; |
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.
VS Code suggests to move formatDate
function to useMemo
hook callback entirely.
Also, I noticed that useMemo
's dependencies can start including locale
value.
Here's the patch.txt.
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.
Thank you timur, I've got another PR ready for review very soon. I will move it in that PR and ship this one.
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.
Proposed Changes
Testing Instructions
Screen.Recording.2024-12-05.at.13.01.11.mov
Pre-merge Checklist