opensearch-project / ml-commons-dashboards

User interface for the ml-commons plugin which can be integrated with OpenSearch Dashboards and a health dashboard for machine learning models.
Apache License 2.0
6 stars 20 forks source link

Reset to max page when current page overflow #323

Closed wanglam closed 2 months ago

wanglam commented 2 months ago

Description

The PR is for fixing page always stay empty page when jump to no models page. This error always happens in below flow:

  1. User visit deployed models list and total pages are 2.
  2. User jump to 2 page, but the deployed models changed and total pages become 1.
  3. Then the page will always stay empty page like below image image

    After this PR, the current page will reset to max page and resend the request. It will jump to page 1 in above cases.

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.