-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Compute row percentages in PHP before metrics are formatted to avoid percentage formatting WARNINGS. #15304
Merged
Merged
Compute row percentages in PHP before metrics are formatted to avoid percentage formatting WARNINGS. #15304
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d6143ef
Compute row percentages in PHP before metrics are formatted to avoid …
diosmosis 79c84fe
do not fail if site summary is not available
diosmosis a572d55
Merge branch '3.x-dev' into ratio-percent-unformatted
diosmosis 6b228c8
Make sure siteSummary requests total data without segment.
diosmosis 44d3444
Make sure proper precision is used.
diosmosis 65348be
try to fix tests
diosmosis 74ca149
Merge branch '3.x-dev' into ratio-percent-unformatted
diosmosis d79abec
update expected screenshots
diosmosis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 5 additions & 6 deletions
11
plugins/CoreVisualizations/templates/_dataTableViz_htmlTable_ratio.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@diosmosis do you understand why we calculate the percentage differently
I wonder if we can't always use the same logic? Eg always use reportTotal? Then we wouldn't even need to do the API call in the HTML table maybe. I suppose the reportTotal may be formatted as well though. Actually I think I get it... the siteTotal is without segment while reportTotal may have a segment...
Looks good to merge @diosmosis
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.
Interesting, I had no idea why this was there :)
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.
Actually, I just tested it and it does actually not seem to be the case. I reckon the
siteSummary
might not be needed at all and we can just use the same percentage as we show in the table based on reportTotal?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.
Looks like this is the commit that differentiated between totals & siteSummary: bb0e02d
Maybe
siteSummary
was supposed to get the data w/o segment, but because we weren't usingRequest::processRequest(..., $default = [])
or something similar, it wasn't working as expected? I wonder if this is actually a bug and we can fix it by making siteSummary work the way you thought it worked.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.
Sounds great to add the default 👍