-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
[dashboard] fix chart showing loading icon when slice's immune fields is changed #7895
[dashboard] fix chart showing loading icon when slice's immune fields is changed #7895
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7895 +/- ##
=========================================
+ Coverage 65.79% 65.8% +0.01%
=========================================
Files 461 461
Lines 22188 22199 +11
Branches 2425 2433 +8
=========================================
+ Hits 14598 14608 +10
- Misses 7469 7470 +1
Partials 121 121
Continue to review full report at Codecov.
|
1530d0e
to
89f7c02
Compare
89f7c02
to
f4b94a8
Compare
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.
one nit
const { filters } = this.props.dashboardState || {}; | ||
const currentFilteredNames = | ||
filterKey && filters[filterKey] ? Object.keys(filters[filterKey]) : []; | ||
const filter_immune_slices = this.props.dashboardInfo.metadata |
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.
camelCase for the const
filterKey && filters[filterKey] ? Object.keys(filters[filterKey]) : []; | ||
const filter_immune_slices = this.props.dashboardInfo.metadata | ||
.filter_immune_slices; | ||
const filter_immune_slice_fields = this.props.dashboardInfo.metadata |
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.
camelCase for the const
@@ -16,6 +16,7 @@ | |||
* specific language governing permissions and limitations | |||
* under the License. | |||
*/ | |||
/* eslint-disable camelcase */ |
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.
then we can probably get rid of this comment
i am kind of hesitate to rename all
I would rather keep this PR simple, just for bug fixing. |
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.
this looks good then; assuming triggerQuery handles all the logic necessary to determine if a chart needs to be refreshed
CATEGORY
Choose one
SUMMARY
When filter is changed, chart shows a loading icon, but not fetching data.
In Dashboard component, the logic to trigger chart refresh has problem. It only checks if whole chart is immune, but not check if chart immune to curtain fields in a applied filter.
After chart is triggered to refresh, its state changed from success to loading, so we show loading icon for the chart. But the effective filter for the chart is not changed (because filter is not applicable). At the result, chart didn't send new query, but since the chart did not change state any more, the chart's loading status will not disappear.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
before:
![Pk8afppq1w](https://user-images.githubusercontent.com/27990562/61488044-1ec7b280-a95c-11e9-9529-bc8d575ba082.gif)
after: should not show loading icon, and no fetching api call
![ZChCuSsdWA](https://user-images.githubusercontent.com/27990562/61488425-0a37ea00-a95d-11e9-989d-4128f84c90d7.gif)
TEST PLAN
Added new unit test for this case.
REVIEWERS
@williaster @michellethomas @mistercrunch @etr2460