Support links for compact gl-pagination
The gl-pagination
component does not support links on Prev
or Next
buttons.
Enabling this would make the component much easier to use when migrating from a ruby page with paginate_without_count
such as in gitlab#213094 (closed).
Issue
The attribute :link-gen
can be used to create links for each numbered buttons and for Prev
& Next
. However the latter does not function as links. This is likely due to the click events being intercepted with .prevent
inside the component.
Proposal
Two proposed methods for solving this issue:
-
Allow the click event to pass through on
Prev
orNext
anchor tags. -
Accept string values for
prev-page
&next-page
so that a direct link to each page can be provided. This more closely mirrors the behaviour ofpaginate_without_count
and is useful for when a links are already available in the page's controller.
I'd suggest we continue with option 1 because it should be a straightforward patch.