Skip to content

Commit

Permalink
[8.8] [Synthetics] - Fix broken sort behavior on overview page. (elas…
Browse files Browse the repository at this point in the history
…tic#158411) (elastic#158550)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[Synthetics] - Fix broken sort behavior on overview page.
(elastic#158411)](elastic#158411)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Abdul Wahab
Zahid","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-05-26T10:38:35Z","message":"[Synthetics]
- Fix broken sort behavior on overview page. (elastic#158411)\n\nWhen sorting
on Synthetics -> Overview page, cards keep loading until\r\nthe next
periodic update. This PR fixes this
behavior.","sha":"bb495c2d5088456208ca26980d7c4c122f2743d9","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:uptime","release_note:skip","v8.8.0","v8.9.0"],"number":158411,"url":"https://github.com/elastic/kibana/pull/158411","mergeCommit":{"message":"[Synthetics]
- Fix broken sort behavior on overview page. (elastic#158411)\n\nWhen sorting
on Synthetics -> Overview page, cards keep loading until\r\nthe next
periodic update. This PR fixes this
behavior.","sha":"bb495c2d5088456208ca26980d7c4c122f2743d9"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/158411","number":158411,"mergeCommit":{"message":"[Synthetics]
- Fix broken sort behavior on overview page. (elastic#158411)\n\nWhen sorting
on Synthetics -> Overview page, cards keep loading until\r\nthe next
periodic update. This PR fixes this
behavior.","sha":"bb495c2d5088456208ca26980d7c4c122f2743d9"}}]}]
BACKPORT-->

Co-authored-by: Abdul Wahab Zahid <[email protected]>
  • Loading branch information
kibanamachine and awahab07 authored May 26, 2023
1 parent dc74b99 commit 82c4eac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ journey('OverviewSorting', async ({ page, params }) => {
await syntheticsApp.navigateToOverview(true, 15);
});

step('sort should reload monitor cards', async () => {
await page.waitForSelector(`[data-test-subj="syntheticsOverviewGridItem"]`);
await page.click('[data-test-subj="syntheticsOverviewSortButton"]');
await page.click('button:has-text("Alphabetical")');
await page.waitForSelector(`[data-test-subj="syntheticsOverviewMonitorsLoading"]`);
await page.waitForSelector(`text=${testMonitor1}`);
await page.waitForSelector(`text=${testMonitor2}`);
await page.waitForSelector(`text=${testMonitor3}`);
});

step('sort alphabetical asc', async () => {
await page.waitForSelector(`[data-test-subj="syntheticsOverviewGridItem"]`);
await page.click('[data-test-subj="syntheticsOverviewSortButton"]');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const OverviewPaginationInfo = ({
)}
</EuiText>
) : (
<EuiText size="xs">
<EuiText size="xs" data-test-subj="syntheticsOverviewMonitorsLoading">
<EuiFlexGroup alignItems="center" gutterSize="s">
<EuiFlexItem grow={false}>
<EuiLoadingSpinner size="m" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ export const OverviewPage: React.FC = () => {

// fetch overview for all other page state changes
useEffect(() => {
if (!monitorsLoaded) {
if (!overviewLoaded) {
dispatch(fetchMonitorOverviewAction.get(pageState));
}
// change only needs to be triggered on pageState change
}, [dispatch, pageState, monitorsLoaded]);
}, [dispatch, pageState, overviewLoaded]);

// fetch overview for refresh
useEffect(() => {
Expand Down

0 comments on commit 82c4eac

Please sign in to comment.