-
Notifications
You must be signed in to change notification settings - Fork 11
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
Implement tracking of filter values #1566
Conversation
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.
code review
did not find anything besides a typo
functional review
It seems to me that the timerange filter tracking is spamming and calling the track function to often:
- If you change the value of the to or from filter, in total for heap calls are sent even though there should be just one. When the from filter is changed also the to filter sends a request. --> There seems to be an issue with the if clauses.
- If any other filter is applied, this filter is tracked correctly, but then also changes to the timeRange filter are tracked. --> I assume there is a re-render issue here.
I did a recording of my console
https://www.loom.com/share/056149be95df4dc3a829903f13661b3d?sid=4320e3ed-d241-48aa-ac73-8b32647950d5
@@ -62,12 +63,21 @@ export default function TimeRangeSelect() { | |||
|
|||
if (toFormValue && new Date(toFormValue) !== to) { | |||
searchParams.delete("to"); | |||
searchParams.append("to", date2String(new Date(toFormValue))); | |||
const newToDate = date2String(new Date(toFormValue)); | |||
const stringifiedForm = date2String(from); |
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 think here is a typo. Should probably be called stringifiedFrom
.
Hey @HaGuesto - I pushed a change again - again it's from Maik's implementation. I hope this works this time! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1566 +/- ##
=======================================
Coverage 85.86% 85.86%
=======================================
Files 229 229
Lines 21728 21728
Branches 1932 1932
=======================================
Hits 18656 18656
Misses 3036 3036
Partials 36 36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
functional review passed |
Implemented filter tracking courtesy of Maik's draft implementation in https://github.com/boxwise/boxtribute/pull/1364/files#diff-ef01c5e03077013a4f49a11bf62dba2f8d1a35268b3f6438aa8bb1b1b5346461.
As I couldn't test it locally due to errors in running the frontend, could @fhenrich33 take a peek at running this branch locally and see if the console logs log the correct filter values?
Note: There is a slight deviation between Maik's changes in
shared-components/statviz/components/filter/TimeRangeSelect.tsx
and mine, see original version here- https://github.com/boxwise/boxtribute/pull/1364/files#diff-ef01c5e03077013a4f49a11bf62dba2f8d1a35268b3f6438aa8bb1b1b5346461L7.