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

Add pagination to submission lists #2882

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nickygerritsen
Copy link
Member

Fixes #2511

Some notes:

  • I used a well-known bundle that takes care of most of the things we want, so the changes are minimal.
  • We paginate all submissions pages by default, but exclude the team interface and the prometheus metrics. The former should not have that many submissions and the latter needs all.
  • The query parameter for pages is always page. We can't currently override this, see pageParameterName not supported KnpLabs/KnpPaginatorBundle#815.
  • I changed the jury submissions filter form to a PHP/backend filter form. This requires you to press a new "Apply" button, but makes it such that filtering happens server side and thus pagination is honored. This also allowed us to get rid of quite a bit of javascript and code in the Twig (but some logic in the controller action came in return).
  • I removed the "new" view type in two spots, since we don't need it anymore.
  • A page contains 50 submissions, just like the "new" filter did before.
  • We always show testcases for the main submissions page now, since we only show 50 submissions.
  • I needed to add filters for restrictions with arrays of ID's. Those were trivial.
  • I also added a filter for an array of results. That one is less trivial. I tested the "normal" results, judging and queued. import-error should also work, so I think we have all cases.

Screenshots:
image
image

@vmcj
Copy link
Member

vmcj commented Dec 15, 2024

* I changed the jury submissions filter form to a PHP/backend filter form. This requires you to press a new "Apply" button, but makes it such that filtering happens server side and thus pagination is honored. This also allowed us to get rid of quite a bit of javascript and code in the Twig (but some logic in the controller action came in return).

Why can't we POST on mouseclick/buttonup?

@nickygerritsen
Copy link
Member Author

nickygerritsen commented Dec 15, 2024

* I changed the jury submissions filter form to a PHP/backend filter form. This requires you to press a new "Apply" button, but makes it such that filtering happens server side and thus pagination is honored. This also allowed us to get rid of quite a bit of javascript and code in the Twig (but some logic in the controller action came in return).

Why can't we POST on mouseclick/buttonup?

We can but that will reload the page every time, which looks very ugly and makes it that focus of the field is lost, so filtering on 2 teams is super annoying.

What we could do is somehow do some AJAX submit and update in the background. However, I didn't want to go there since that makes it even more complex and I don't think hitting one button is that big of an issue.

'results' => $results,
'showExternalResult' => $this->dj->shadowMode(),
'showTestcases' => count($submissions) <= $latestCount,
'showTestcases' => true,
Copy link
Member

Choose a reason for hiding this comment

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

Is this used anywhere else?

Copy link
Member Author

Choose a reason for hiding this comment

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

We only show it on the general submission page and not others (like team page, judgehost page, etc.). So yes.

webapp/src/Form/Type/SubmissionsFilterType.php Outdated Show resolved Hide resolved
Copy link
Member

@vmcj vmcj left a comment

Choose a reason for hiding this comment

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

Nothing more to ask about it.

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.

Add pagination to pages with long lists
2 participants