-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
fix(native-filters): Don't send unnecessary PUT request on dashboard render #15146
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15146 +/- ##
==========================================
- Coverage 77.49% 77.41% -0.08%
==========================================
Files 969 969
Lines 49905 49918 +13
Branches 6386 6393 +7
==========================================
- Hits 38672 38645 -27
- Misses 11030 11070 +40
Partials 203 203
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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 for the quick fix! Works like expected, but one minor non-blocking comment regarding naming.
…render (apache#15146) * fix(native-filters): Don't send unnecessary PUT request on dashboard render * Run native filters scopes only if feature flag is enabled * Change action name * Run native filters scopes only if at least 1 filter added * Fix lint (cherry picked from commit 3866044)
…render (apache#15146) * fix(native-filters): Don't send unnecessary PUT request on dashboard render * Run native filters scopes only if feature flag is enabled * Change action name * Run native filters scopes only if at least 1 filter added * Fix lint
…render (apache#15146) * fix(native-filters): Don't send unnecessary PUT request on dashboard render * Run native filters scopes only if feature flag is enabled * Change action name * Run native filters scopes only if at least 1 filter added * Fix lint
…render (apache#15146) * fix(native-filters): Don't send unnecessary PUT request on dashboard render * Run native filters scopes only if feature flag is enabled * Change action name * Run native filters scopes only if at least 1 filter added * Fix lint
SUMMARY
When dashboard first renders, we calculate tabs and charts in scope of each native filter. Before, we used to send a PUT request with the results, which also modified dashboard's metadata. This PR fixes that behaviour by saving the results only in redux, without sending them to the backend. Also, now we run the calculations only if the native filters feature flag is enabled
This PR is related to an issue raised by @graceguo-supercat in comments #14933 (comment) and #14933 (comment). The problem with setting properties
show_native_filters
andnative_filter_configuration
was not caused directly by PR #14933, but the problem was elevated by that PR because of sending unnecessary PUT request. The root of the issue will be handled in a separate PR by @villebro.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Notice that in "AFTER" screenshot there's no request to
/dashboard
endpoint which modifies metadata.Before:
After:
TESTING INSTRUCTIONS
DASHBOARD_NATIVE_FILTERS
feature flag to TrueSET_FILTER_SCOPES
action was dispatched and no request to/dashboard
endpoint was madeDASHBOARD_NATIVE_FILTERS
feature flagSET_FILTER_SCOPES
action was NOT dispatchedADDITIONAL INFORMATION
CC: @villebro @graceguo-supercat