Skip to content

[Search] Fix Pagination when number of documents is changed#220139

Merged
saarikabhasi merged 1 commit intoelastic:mainfrom
saarikabhasi:fix-pagination
May 5, 2025
Merged

[Search] Fix Pagination when number of documents is changed#220139
saarikabhasi merged 1 commit intoelastic:mainfrom
saarikabhasi:fix-pagination

Conversation

@saarikabhasi
Copy link
Member

@saarikabhasi saarikabhasi commented May 5, 2025

Summary

Problem
When number of documents is changed, the total number of pages are recalculated but current page is not changed. This works fine, but when on last page and changing to larger number of documents makes the page to show zero documents

Fix
Changed to reset pagination to first page when number of documents is changed.

pagination.demo.mov
@saarikabhasi saarikabhasi requested a review from a team as a code owner May 5, 2025 18:54
@saarikabhasi saarikabhasi added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 v8.17.0 v8.18.0 v8.19.0 backport:version Backport to applied version labels labels May 5, 2025
@saarikabhasi saarikabhasi enabled auto-merge (squash) May 5, 2025 20:02
@saarikabhasi saarikabhasi merged commit f1187b4 into elastic:main May 5, 2025
23 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.18, 8.19, 9.0

https://github.com/elastic/kibana/actions/runs/14845951648

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
contentConnectors 470.4KB 470.4KB +1.0B
enterpriseSearch 1.2MB 1.2MB +1.0B
total +2.0B
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.17 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.17:
- [Maps] Remove icon from map tooltip (#220134)
- Update misc security solution deps (#219746)
8.18 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.18:
- [Maps] Remove icon from map tooltip (#220134)
- Update misc security solution deps (#219746)
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [Maps] Remove icon from map tooltip (#220134)
- Update publish_oas_docs.sh for 9.0, 8.19, and 8.18 (#219864)
- Update misc security solution deps (#219746)
- [Discover] Add 'Copy value' button to field value cells (#217457) (#218817)
- [Security Solution][Explore][Overview Dashboard] Move from viz responses to viz tables (#214888)
- Make interval in rrule config required (#220003)
- Reorganize footer items for Solutions (#218050)
- [ES|QL] Renames the ESQLRealField type to ESQLFieldWithMetadata (#219894)
- [Incident Management] Investigation Guide backend (#216377)
9.0 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.0:
- [Maps] Remove icon from map tooltip (#220134)
- Update Kibana URLs in doc link service (#219657)
- Update misc security solution deps (#219746)

Manual backport

To create the backport manually run:

node scripts/backport --pr 220139

Questions ?

Please refer to the Backport tool documentation

saarikabhasi added a commit to saarikabhasi/kibana that referenced this pull request May 6, 2025
…220139)

## Summary
**Problem**
When number of documents is changed, the total number of pages are
recalculated but current page is not changed. This works fine, but when
on last page and changing to larger number of documents makes the page
to show zero documents

**Fix**
Changed to reset pagination to first page when number of documents is
changed.

https://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e
(cherry picked from commit f1187b4)

# Conflicts:
#	x-pack/platform/plugins/shared/content_connectors/public/components/search_index/documents.tsx
@saarikabhasi
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.17

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

saarikabhasi added a commit to saarikabhasi/kibana that referenced this pull request May 6, 2025
…220139)

## Summary
**Problem**
When number of documents is changed, the total number of pages are
recalculated but current page is not changed. This works fine, but when
on last page and changing to larger number of documents makes the page
to show zero documents

**Fix**
Changed to reset pagination to first page when number of documents is
changed.

https://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e
(cherry picked from commit f1187b4)

# Conflicts:
#	x-pack/platform/plugins/shared/content_connectors/public/components/search_index/documents.tsx
@saarikabhasi
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.18

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@saarikabhasi
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

saarikabhasi added a commit to saarikabhasi/kibana that referenced this pull request May 6, 2025
…220139)

**Problem**
When number of documents is changed, the total number of pages are
recalculated but current page is not changed. This works fine, but when
on last page and changing to larger number of documents makes the page
to show zero documents

**Fix**
Changed to reset pagination to first page when number of documents is
changed.

https://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e
(cherry picked from commit f1187b4)
@saarikabhasi
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
9.0

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

saarikabhasi added a commit to saarikabhasi/kibana that referenced this pull request May 6, 2025
…220139)

**Problem**
When number of documents is changed, the total number of pages are
recalculated but current page is not changed. This works fine, but when
on last page and changing to larger number of documents makes the page
to show zero documents

**Fix**
Changed to reset pagination to first page when number of documents is
changed.

https://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e
(cherry picked from commit f1187b4)
saarikabhasi added a commit that referenced this pull request May 6, 2025
…220139) (#220271)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[Search] Fix Pagination when number of documents is changed
(#220139)](#220139)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Saarika
Bhasi","email":"55930906+saarikabhasi@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-05T20:48:37Z","message":"[Search]
Fix Pagination when number of documents is changed (#220139)\n\n##
Summary\n**Problem** \nWhen number of documents is changed, the total
number of pages are\nrecalculated but current page is not changed. This
works fine, but when\non last page and changing to larger number of
documents makes the page\nto show zero documents\n\n**Fix**\nChanged to
reset pagination to first page when number of documents
is\nchanged.\n\n\nhttps://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e","sha":"f1187b4e9129215e7373b3ba772e306e0af4bdd2","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:version","v8.17.0","v8.18.0","v9.1.0","v8.19.0"],"title":"[Search]
Fix Pagination when number of documents is
changed","number":220139,"url":"https://github.com/elastic/kibana/pull/220139","mergeCommit":{"message":"[Search]
Fix Pagination when number of documents is changed (#220139)\n\n##
Summary\n**Problem** \nWhen number of documents is changed, the total
number of pages are\nrecalculated but current page is not changed. This
works fine, but when\non last page and changing to larger number of
documents makes the page\nto show zero documents\n\n**Fix**\nChanged to
reset pagination to first page when number of documents
is\nchanged.\n\n\nhttps://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e","sha":"f1187b4e9129215e7373b3ba772e306e0af4bdd2"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.17","8.18","8.19"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/220139","number":220139,"mergeCommit":{"message":"[Search]
Fix Pagination when number of documents is changed (#220139)\n\n##
Summary\n**Problem** \nWhen number of documents is changed, the total
number of pages are\nrecalculated but current page is not changed. This
works fine, but when\non last page and changing to larger number of
documents makes the page\nto show zero documents\n\n**Fix**\nChanged to
reset pagination to first page when number of documents
is\nchanged.\n\n\nhttps://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e","sha":"f1187b4e9129215e7373b3ba772e306e0af4bdd2"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
saarikabhasi added a commit that referenced this pull request May 6, 2025
…220139) (#220274)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Search] Fix Pagination when number of documents is changed
(#220139)](#220139)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Saarika
Bhasi","email":"55930906+saarikabhasi@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-05T20:48:37Z","message":"[Search]
Fix Pagination when number of documents is changed (#220139)\n\n##
Summary\n**Problem** \nWhen number of documents is changed, the total
number of pages are\nrecalculated but current page is not changed. This
works fine, but when\non last page and changing to larger number of
documents makes the page\nto show zero documents\n\n**Fix**\nChanged to
reset pagination to first page when number of documents
is\nchanged.\n\n\nhttps://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e","sha":"f1187b4e9129215e7373b3ba772e306e0af4bdd2","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:version","v8.17.0","v8.18.0","v9.1.0","v8.19.0"],"title":"[Search]
Fix Pagination when number of documents is
changed","number":220139,"url":"https://github.com/elastic/kibana/pull/220139","mergeCommit":{"message":"[Search]
Fix Pagination when number of documents is changed (#220139)\n\n##
Summary\n**Problem** \nWhen number of documents is changed, the total
number of pages are\nrecalculated but current page is not changed. This
works fine, but when\non last page and changing to larger number of
documents makes the page\nto show zero documents\n\n**Fix**\nChanged to
reset pagination to first page when number of documents
is\nchanged.\n\n\nhttps://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e","sha":"f1187b4e9129215e7373b3ba772e306e0af4bdd2"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.19"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/220271","number":220271,"state":"OPEN"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/220139","number":220139,"mergeCommit":{"message":"[Search]
Fix Pagination when number of documents is changed (#220139)\n\n##
Summary\n**Problem** \nWhen number of documents is changed, the total
number of pages are\nrecalculated but current page is not changed. This
works fine, but when\non last page and changing to larger number of
documents makes the page\nto show zero documents\n\n**Fix**\nChanged to
reset pagination to first page when number of documents
is\nchanged.\n\n\nhttps://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e","sha":"f1187b4e9129215e7373b3ba772e306e0af4bdd2"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
saarikabhasi added a commit that referenced this pull request May 6, 2025
…220139) (#220282)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Search] Fix Pagination when number of documents is changed
(#220139)](#220139)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Saarika
Bhasi","email":"55930906+saarikabhasi@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-05T20:48:37Z","message":"[Search]
Fix Pagination when number of documents is changed (#220139)\n\n##
Summary\n**Problem** \nWhen number of documents is changed, the total
number of pages are\nrecalculated but current page is not changed. This
works fine, but when\non last page and changing to larger number of
documents makes the page\nto show zero documents\n\n**Fix**\nChanged to
reset pagination to first page when number of documents
is\nchanged.\n\n\nhttps://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e","sha":"f1187b4e9129215e7373b3ba772e306e0af4bdd2","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:version","v8.17.0","v8.18.0","v9.1.0","v8.19.0"],"title":"[Search]
Fix Pagination when number of documents is
changed","number":220139,"url":"https://github.com/elastic/kibana/pull/220139","mergeCommit":{"message":"[Search]
Fix Pagination when number of documents is changed (#220139)\n\n##
Summary\n**Problem** \nWhen number of documents is changed, the total
number of pages are\nrecalculated but current page is not changed. This
works fine, but when\non last page and changing to larger number of
documents makes the page\nto show zero documents\n\n**Fix**\nChanged to
reset pagination to first page when number of documents
is\nchanged.\n\n\nhttps://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e","sha":"f1187b4e9129215e7373b3ba772e306e0af4bdd2"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.19"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/220271","number":220271,"state":"OPEN"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/220274","number":220274,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/220139","number":220139,"mergeCommit":{"message":"[Search]
Fix Pagination when number of documents is changed (#220139)\n\n##
Summary\n**Problem** \nWhen number of documents is changed, the total
number of pages are\nrecalculated but current page is not changed. This
works fine, but when\non last page and changing to larger number of
documents makes the page\nto show zero documents\n\n**Fix**\nChanged to
reset pagination to first page when number of documents
is\nchanged.\n\n\nhttps://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e","sha":"f1187b4e9129215e7373b3ba772e306e0af4bdd2"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
saarikabhasi added a commit that referenced this pull request May 6, 2025
…20139) (#220284)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Search] Fix Pagination when number of documents is changed
(#220139)](#220139)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Saarika
Bhasi","email":"55930906+saarikabhasi@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-05T20:48:37Z","message":"[Search]
Fix Pagination when number of documents is changed (#220139)\n\n##
Summary\n**Problem** \nWhen number of documents is changed, the total
number of pages are\nrecalculated but current page is not changed. This
works fine, but when\non last page and changing to larger number of
documents makes the page\nto show zero documents\n\n**Fix**\nChanged to
reset pagination to first page when number of documents
is\nchanged.\n\n\nhttps://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e","sha":"f1187b4e9129215e7373b3ba772e306e0af4bdd2","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:version","v8.17.0","v8.18.0","v9.1.0","v8.19.0"],"title":"[Search]
Fix Pagination when number of documents is
changed","number":220139,"url":"https://github.com/elastic/kibana/pull/220139","mergeCommit":{"message":"[Search]
Fix Pagination when number of documents is changed (#220139)\n\n##
Summary\n**Problem** \nWhen number of documents is changed, the total
number of pages are\nrecalculated but current page is not changed. This
works fine, but when\non last page and changing to larger number of
documents makes the page\nto show zero documents\n\n**Fix**\nChanged to
reset pagination to first page when number of documents
is\nchanged.\n\n\nhttps://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e","sha":"f1187b4e9129215e7373b3ba772e306e0af4bdd2"}},"sourceBranch":"main","suggestedTargetBranches":["9.0"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/220271","number":220271,"state":"OPEN"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/220274","number":220274,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/220139","number":220139,"mergeCommit":{"message":"[Search]
Fix Pagination when number of documents is changed (#220139)\n\n##
Summary\n**Problem** \nWhen number of documents is changed, the total
number of pages are\nrecalculated but current page is not changed. This
works fine, but when\non last page and changing to larger number of
documents makes the page\nto show zero documents\n\n**Fix**\nChanged to
reset pagination to first page when number of documents
is\nchanged.\n\n\nhttps://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e","sha":"f1187b4e9129215e7373b3ba772e306e0af4bdd2"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/220282","number":220282,"state":"OPEN"}]}]
BACKPORT-->
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
…220139)

## Summary
**Problem** 
When number of documents is changed, the total number of pages are
recalculated but current page is not changed. This works fine, but when
on last page and changing to larger number of documents makes the page
to show zero documents

**Fix**
Changed to reset pagination to first page when number of documents is
changed.


https://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e
qn895 pushed a commit to qn895/kibana that referenced this pull request Jun 3, 2025
…220139)

## Summary
**Problem** 
When number of documents is changed, the total number of pages are
recalculated but current page is not changed. This works fine, but when
on last page and changing to larger number of documents makes the page
to show zero documents

**Fix**
Changed to reset pagination to first page when number of documents is
changed.


https://github.com/user-attachments/assets/02eab354-b4bd-40cf-af47-1a692951f08e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes v8.17.0 v8.17.6 v8.18.0 v8.18.1 v8.19.0 v9.0.0 v9.0.1 v9.1.0

4 participants