Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Jul 20, 2024
2 parents b7bac8d + d3c5a9a commit f818189
Show file tree
Hide file tree
Showing 33 changed files with 136 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ body:
attributes:
label: 👀 Before submitting...
options:
- label: I upgraded to pagy version 9.0.1
- label: I upgraded to pagy version 9.0.2
required: true
- label: I searched through the [Documentation](https://ddnexus.github.io/pagy/)
required: true
Expand Down
8 changes: 5 additions & 3 deletions .github/latest_release_body.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
- See the [Changelog](https://ddnexus.github.io/pagy/changelog) for possible breaking changes
<!-- whats_new_end -->

### Changes in 9.0.1
### Changes in 9.0.2

<!-- changes_start -->
- Fix countless executing the count query
- Rename row_comparison > tuple_comparison; ignore mixed orders
- Rename and document the link header to pagy_link_header
- Add first and next url helpers to the keyset extra; add the keyset section to config/pagy.rb
- Fix nil page in keyset URL not overriding the params page
- Extracted shared method
<!-- changes_end -->

[CHANGELOG](https://ddnexus.github.io/pagy/changelog)
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ If you upgrade from version `< 9.0.0` see the following:
- None
<hr>

## Version 9.0.2

- Rename and document the link header to pagy_link_header
- Add first and next url helpers to the keyset extra; add the keyset section to config/pagy.rb
- Fix nil page in keyset URL not overriding the params page
- Extracted shared method

## Version 9.0.1

- Fix countless executing the count query
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: gem
specs:
pagy (9.0.1)
pagy (9.0.2)

GEM
remote: https://rubygems.org/
Expand Down
2 changes: 1 addition & 1 deletion README.md

Large diffs are not rendered by default.

Binary file modified bun.lockb
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/extras/countless.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ categories:

Paginate without the need of any count, saving one query per rendering.

!!!success
If you don't need any frontend you should consider the [Pagy::Keyset pagination](/docs/api/keyset.md) that is even faster than countless, especially with big data
!!!

## Setup

```ruby pagy.rb (initializer)
Expand Down
19 changes: 9 additions & 10 deletions docs/extras/headers.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,11 @@ If you are replacing any of the existing API-pagination gems in some already wor
names so you will not have to change the client app that consumes them. You can do so by using the `:headers` variable _(
see [variables](#variables) below)_

### Countless Pagination
!!!warning Countless and Keyset Pagination

If your requirements allow to save one count-query per rendering by using the `pagy_countless` constructor, the headers will
not have the `rel="last"` link, the `total-count` and the `total-pages` that are unknown with countless pagination.
If you use the `headers` extra with the [contless](countless.md) or [keyset](keyset.md) extras, a few heder will not be available (e.g. the last link)
!!!

Example of HTTP headers produced from a `Pagy::Countless` object:

```text
Link <https://example.com:8080/foo?page=1>; rel="first", <https://example.com:8080/foo?page=2>; rel="prev", <https://example.com:8080/foo?page=4>; rel="next"
current-page 3
page-items 20
```

## Variables

Expand Down Expand Up @@ -133,3 +126,9 @@ This method generates a hash of [RFC-8288](https://tools.ietf.org/html/rfc8288)
response. It is internally used by the `pagy_headers_merge` method, so you usually don't need to use it directly. However, if you
need to edit the headers that pagy generates (for example adding extra `link` headers), you can override it in your own
controller.

==- `pagy_link_header(pagy)`

Return only the `link` header as a single key Hash.

===
10 changes: 9 additions & 1 deletion docs/extras/keyset.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,15 @@ of `records` pulled from the DB.
==- `pagy_keyset_get_vars(vars)`

This sub-method is internally called only by the `pagy_keyset` method. It automatically sets the `:page` variable and - if you
use the [limit extra](/docs/extras/limit.md) also the `:limit` variables from the request `params`. Documented only for
use the [limit extra](limit.md) also the `:limit` variables from the request `params`. Documented only for
overriding.

==- `pagy_keyset_first_url(pagy, absolute: false)`

Return the first page URL string. (See also the [headers](headers.md) and [jsonapi](jsonapi.md) extras for more complete solutions)

==- `pagy_keyset_next_url(pagy, absolute: false)`

Return the next page URL string or nil. (See also the [headers](headers.md) and [jsonapi](jsonapi.md) extras for more complete solutions)

===
2 changes: 1 addition & 1 deletion docs/extras/pagy.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ bar links (e.g. `countless` extra).

==- `pagy_next_url(pagy, absolute: false)`

Return the previous page URL string or nil. Useful to build minimalistic UIs that don't use nav bar
Return the next page URL string or nil. Useful to build minimalistic UIs that don't use nav bar
links (e.g. `countless` extra).

==- `pagy_prev_a(pagy, **vars)`
Expand Down
2 changes: 1 addition & 1 deletion e2e/snapshots.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gem/apps/calendar.ru
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# DOC
# https://ddnexus.github.io/pagy/playground/#5-calendar-app

VERSION = '9.0.1'
VERSION = '9.0.2'

# Gemfile
require 'bundler/inline'
Expand Down
2 changes: 1 addition & 1 deletion gem/apps/demo.ru
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# DOC
# https://ddnexus.github.io/pagy/playground/#3-demo-app

VERSION = '9.0.1'
VERSION = '9.0.2'

require 'bundler/inline'
require 'bundler'
Expand Down
2 changes: 1 addition & 1 deletion gem/apps/rails.ru
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# DOC
# https://ddnexus.github.io/pagy/playground/#2-rails-app

VERSION = '9.0.1'
VERSION = '9.0.2'

# Gemfile
require 'bundler/inline'
Expand Down
2 changes: 1 addition & 1 deletion gem/apps/repro.ru
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# DOC
# https://ddnexus.github.io/pagy/playground/#1-repro-app

VERSION = '9.0.1'
VERSION = '9.0.2'

require 'bundler/inline'
require 'bundler'
Expand Down
2 changes: 1 addition & 1 deletion gem/bin/pagy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

VERSION = '9.0.1'
VERSION = '9.0.2'
APPS = %w[repro rails demo calendar keyset_ar keyset_s].freeze
LINUX = RbConfig::CONFIG['host_os'].include?('linux')
HOST = '0.0.0.0'
Expand Down
6 changes: 5 additions & 1 deletion gem/config/pagy.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# Pagy initializer file (9.0.1)
# Pagy initializer file (9.0.2)
# Customize only what you really need and notice that the core Pagy works also without any of the following lines.
# Should you just cherry pick part of this file, please maintain the require-order of the extras

Expand Down Expand Up @@ -79,6 +79,10 @@
# count: 'Total-Count',
# pages: 'Total-Pages' } # default

# Keyset extra: Paginate with the Pagy keyset pagination technique
# See http://ddnexus.github.io/pagy/extras/keyset
# require 'pagy/extras/keyset'

# Meilisearch extra: Paginate `Meilisearch` result objects
# See https://ddnexus.github.io/pagy/docs/extras/meilisearch
# Default :pagy_search method: change only if you use also
Expand Down
4 changes: 2 additions & 2 deletions gem/javascripts/pagy.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f818189

Please sign in to comment.