-
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
Stats: Enable tab switching for unsupported fields of hourly views #97163
Stats: Enable tab switching for unsupported fields of hourly views #97163
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~52 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. Async-loaded Components (~11 bytes removed 📉 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. 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. |
@@ -31,7 +31,8 @@ class StatsTabs extends Component { | |||
} else { | |||
data?.map( ( day ) => | |||
tabs.map( ( tab ) => { | |||
if ( isFinite( day[ tab.attr ] ) ) { | |||
// Exclude non-numeric values, e.g., NULL from unsupported stats fields. | |||
if ( Number.isFinite( day[ tab.attr ] ) ) { |
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.
isFinite( null ) === true
Number.isFinite( null ) === false
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.
Hmmmm that's why we love JavaScript right? 🥲
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.
LGTM 🚀
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/17054550 Some locales (Hebrew) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday. Thank you @dognose24 for including a screenshot in the description! This is really helpful for our translators. |
Related to https://github.com/Automattic/red-team/issues/301.
Proposed Changes
Visitors
,Likes
, andComments
.NULL
to recognize unsupported Stats visits fields for hourly views to apply alternative data.Why are these changes being made?
Testing Instructions
D167991-code
and sandboxpublic-api.wordpress.com
.?flags=stats/new-date-filtering
.Views
tab works as previously.Visitors
,Likes
, andComments
tabs are clickable.Visitors
tab.Pre-merge Checklist