Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #13298 "No records Found" when Switching between Single and Multi-Page Licenses #13363

Merged

Conversation

inietov
Copy link
Collaborator

@inietov inietov commented Jul 25, 2023

Description

Example of use case: If we have a license that have 20 license seats and we have the BootstrapTable pagination set to show tables with 10 items per page, when we are in the second page (license seats from 11 to 20) and then we try to see another license, but it only has 10 license seats, as the offset is remembered the system still try to retrieve license seats from range 11 to 20, but that license only have from 1 to 10, and shows a message that no records where found.

In this PR I just adjust the offset value if is the same or bigger than the license seats total of the license we are looking at the moment. This also have the benefit of still remember the page we were when coming back to the license with bigger number of license seats.

Fixes #13298

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Test Configuration:

  • PHP version: 8.1
  • MySQL version: 8.0.31
  • Webserver version: PHP Dev Server
  • OS version: Debian 11

@what-the-diff
Copy link

what-the-diff bot commented Jul 25, 2023

PR Summary

  • Refinement to License Seat Management
    In the part of our application that handles license seats, we've made an improvement. This change includes a new check to ensure that an action doesn't accidentally try to go beyond the total number of available license seats. If it does, it'll now be correctly redirected back to the starting point. This change ensures smoother license seat management and prevents potential errors.

Copy link
Collaborator

@marcusmoore marcusmoore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this and it works 👍🏾

Side-note: I'm not finding it now but I'm pretty sure @snipe had a PR that went in recently solving the same issue on a different screen? If I'm remembering right we'll probably want to make sure the approaches are the same and apply fixes wherever else we need to.

@snipe
Copy link
Owner

snipe commented Jul 26, 2023

@marcusmoore My approach was a little different, but I think it will still play nicely with this solution - thank you @inietov! And thank you for testing @marcusmoore :)

@snipe snipe merged commit f6545be into snipe:develop Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants