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

WEG-11 TrainerTab Pagination #1962

Merged
merged 12 commits into from
Jun 28, 2024
Merged

WEG-11 TrainerTab Pagination #1962

merged 12 commits into from
Jun 28, 2024

Conversation

TehAwol
Copy link
Contributor

@TehAwol TehAwol commented Jun 9, 2024

  • Add Pagination query for Game
  • Simplify TrainerTab filters

public Page<Game> paginatedGames(@PathParam("status") final Game.Status status,
@QueryParam("page") int page,
@QueryParam("size") int size,
@QueryParam("query") String query) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Allowed chars should be restricted, like:

Suggested change
@QueryParam("query") String query) {
@QueryParam("query")@Pattern(regexp = "^[\\p{L} .'-[0-9]]*$") String query) {

Could you please add this to Usercontroller.paginatedUsers as well?
(regex to be tested)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added issue in Jira as we need to check against GameModels and Games name regex

@@ -303,7 +300,7 @@ public void remove(final Game entity) {

// This is for retrocompatibility w/ game models that do not habe DebugGame
if (entity.getGameModel().getGames().size() <= 1
&& !(entity.getGameModel().getGames().get(0) instanceof DebugGame)) {// This is for retrocompatibility w/ game models that do not habe DebugGame
&& !(entity.getGameModel().getGames().get(0) instanceof DebugGame)) {// This is for retrocompatibility w/ game models that do not habe DebugGame
Copy link
Contributor

Choose a reason for hiding this comment

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

Might throw out of bounds exception, do we care ?

* Get all games with given status paginated
*
*/
@GET
Copy link
Contributor

Choose a reason for hiding this comment

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

Best would be to use a POST

List<Game.Status> gStatuses = new ArrayList<>();
gStatuses.add(status);

Map<Long, List<String>> gMatrix = this.getPermissionMatrix(gStatuses);
Copy link
Contributor

@fsantaniello-heigvd fsantaniello-heigvd Jun 19, 2024

Choose a reason for hiding this comment

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

Should paginate this as well to be future proof, if no time then create a story for improvement (3500 games in db), but make sur it will work for a while with prod db

@xgo-work xgo-work merged commit 2a7f290 into dev Jun 28, 2024
1 check passed
@TehAwol TehAwol deleted the WEG-11 branch August 5, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants