fixes blank storage explorer summary when filter string is active (#189760)

## Summary

I've opted to ignore the filters, because the tooltip describes this
behavior.
### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
This commit is contained in:
Bryce Buchanan 2024-08-07 10:49:28 -07:00 committed by GitHub
parent e2fdced90e
commit 5a86b0523e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 37 additions and 3 deletions

View file

@ -4,6 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
describe('Storage explorer page', () => {
const rangeFrom = '2023-04-18T00:00:00.000Z';
const rangeTo = '2023-04-18T00:05:00.000Z';
@ -59,6 +60,40 @@ describe('Storage explorer page', () => {
});
});
describe('summary stats', () => {
it('will still load with kuery', () => {
cy.intercept('GET', '/internal/profiling/storage_explorer/summary?*', {
fixture: 'storage_explorer_summary.json',
}).as('summaryStats');
cy.visitKibana('/app/profiling/storage-explorer', {
rangeFrom,
rangeTo,
kuery: 'host.id : "1234"',
});
cy.wait('@summaryStats').then(({ request, response }) => {
const {
dailyDataGenerationBytes,
diskSpaceUsedPct,
totalNumberOfDistinctProbabilisticValues,
totalNumberOfHosts,
totalProfilingSizeBytes,
totalSymbolsSizeBytes,
} = response?.body;
const { kuery } = request.query;
expect(parseFloat(dailyDataGenerationBytes)).to.be.gt(0);
expect(parseFloat(diskSpaceUsedPct)).to.be.gt(0);
expect(parseFloat(totalNumberOfDistinctProbabilisticValues)).to.be.gt(0);
expect(parseFloat(totalNumberOfHosts)).to.be.gt(0);
expect(parseFloat(totalProfilingSizeBytes)).to.be.gt(0);
expect(parseFloat(totalSymbolsSizeBytes)).to.be.gt(0);
/* eslint-disable @typescript-eslint/no-unused-expressions */
expect(kuery).to.be.empty;
});
});
});
describe('Data breakdown', () => {
it('displays correct values per index', () => {
cy.intercept('GET', '/internal/profiling/storage_explorer/indices_storage_details?*').as(

View file

@ -30,7 +30,7 @@ import { Summary } from './summary';
export function StorageExplorerView() {
const { query } = useProfilingParams('/storage-explorer');
const { rangeFrom, rangeTo, kuery, indexLifecyclePhase } = query;
const { rangeFrom, rangeTo, indexLifecyclePhase } = query;
const timeRange = useTimeRange({ rangeFrom, rangeTo });
const [selectedTab, setSelectedTab] = useState<'host_breakdown' | 'data_breakdown'>(
@ -47,7 +47,7 @@ export function StorageExplorerView() {
http,
timeFrom: timeRange.inSeconds.start,
timeTo: timeRange.inSeconds.end,
kuery,
kuery: '',
indexLifecyclePhase,
});
},
@ -55,7 +55,6 @@ export function StorageExplorerView() {
fetchStorageExplorerSummary,
timeRange.inSeconds.start,
timeRange.inSeconds.end,
kuery,
indexLifecyclePhase,
]
);