diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 53b687bb25c..b33b5e98cea 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -13,6 +13,7 @@ - [Import/VMWare] Fix `(Failure \"Expected string, got 'I(0)'\")` (PR [#7361](https://github.com/vatesfr/xen-orchestra/issues/7361)) - [Plugin/load-balancer] Fixing `TypeError: Cannot read properties of undefined (reading 'high')` happening when trying to optimize a host with performance plan [#7359](https://github.com/vatesfr/xen-orchestra/issues/7359) (PR [#7362](https://github.com/vatesfr/xen-orchestra/pull/7362)) +- Changing the number of displayed items per page should send back to the first page [#7350](https://github.com/vatesfr/xen-orchestra/issues/7350) ### Packages to release @@ -32,5 +33,6 @@ - xo-server patch - xo-server-load-balancer patch +- xo-web patch diff --git a/packages/xo-web/src/common/sorted-table/index.js b/packages/xo-web/src/common/sorted-table/index.js index 2df1da3964d..f9e4280e1f7 100644 --- a/packages/xo-web/src/common/sorted-table/index.js +++ b/packages/xo-web/src/common/sorted-table/index.js @@ -752,6 +752,11 @@ class SortedTable extends Component { const { location, stateUrlParam } = this.props this.setState({ itemsPerPage }) cookies.set(`${location.pathname}-${stateUrlParam}`, itemsPerPage) + + // changing the number of items per page should send back to the first page + // + // see https://github.com/vatesfr/xen-orchestra/issues/7350 + this._setPage(1) } render() { diff --git a/packages/xo-web/src/xo-app/home/index.js b/packages/xo-web/src/xo-app/home/index.js index c205458ba8e..020f6fc3658 100644 --- a/packages/xo-web/src/xo-app/home/index.js +++ b/packages/xo-web/src/xo-app/home/index.js @@ -555,6 +555,11 @@ export default class Home extends Component { _setNItemsPerPage(nItems) { this.setState({ homeItemsPerPage: nItems }) cookies.set('homeItemsPerPage', nItems) + + // changing the number of items per page should send back to the first page + // + // see https://github.com/vatesfr/xen-orchestra/issues/7350 + this._onPageSelection(1) } _getPage() {