Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Apr 18, 2024
2 parents 2358b3d + 6beee0d commit 60ae894
Show file tree
Hide file tree
Showing 21 changed files with 25 additions and 29 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 8.2.0
- label: I upgraded to pagy version 8.2.1
required: true
- label: I searched through the [Documentation](https://ddnexus.github.io/pagy/)
required: true
Expand Down
6 changes: 2 additions & 4 deletions .github/latest_release_body.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ If you wish to keep your favorites alive, please, [vote here](https://github.com
- Better frontend helpers
- See the [CHANGELOG](https://ddnexus.github.io/pagy/changelog) for possible breaking changes

### Changes in 8.2.0
### Changes in 8.2.1

<!-- changes start -->
- Fix the '#pagy_url_for' method for calendar pagination (#688)
- Extend the use of pagy_get_page to the arel, array and countless extras
- Add the pagy_get_count method to the backend
- Fix empty page param raising error (closes #689)
<!-- changes end -->

[CHANGELOG](https://ddnexus.github.io/pagy/changelog)
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ If you upgrade from version `< 8.0.0` see the following:

<hr>

## Version 8.2.1

- Fix empty page param raising error (closes #689)

## Version 8.2.0

- Fix the '#pagy_url_for' method for calendar pagination (#688)
Expand Down
6 changes: 0 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
PATH
remote: gem
specs:
pagy (8.2.0)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -151,7 +146,6 @@ DEPENDENCIES
minitest
minitest-reporters
oj
pagy!
puma
rack
rackup
Expand Down
2 changes: 1 addition & 1 deletion README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/api/pagy.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ number `1`. For performance reasons, only the instance variables get validated.
| `:jsonapi` | Enable `jsonapi` compliance of the pagy query params | `false` |
| `:max_pages` | Paginate only `:max_pages`. _(see [Paginate only max_pages](/docs/how-to.md#paginate-only-max_pages-regardless-the-count))_ | `nil` |
| `:outset` | The initial offset of the collection to paginate: pass it only if the collection had an offset | `0` |
| `:page` | The requested page number: extracted from the `request.params`, or forced by passeing a variable | `1` |
| `:page` | The requested page number: extracted from the `request.params`, or forced by passing a variable | `1` |
| `:page_param` | The name of the page param name used in the url. _(see [Customize the page param](/docs/how-to.md#customize-the-page-param))_ | `:page` |
| `:params` | It can be a `Hash` of params to add to the URL, or a `Proc` that can edit/add/delete the request params _(see [Customize the params](/docs/how-to.md#customize-the-params))_ | `nil` |
| `:request_path` | Allows overriding the `request.path` for pagination links. Pass the path only (not the absolute url). _(see [Pass the request path](/docs/how-to.md#pass-the-request-path))_ | `nil` |
Expand Down
2 changes: 1 addition & 1 deletion gem/apps/calendar.ru
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# DOC
# https://ddnexus.github.io/pagy/playground/#4-calendar-app

VERSION = '8.2.0'
VERSION = '8.2.1'

require 'bundler/inline'
gemfile(true) do
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 = '8.2.0'
VERSION = '8.2.1'

require 'bundler/inline'
gemfile(true) do
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 = '8.2.0'
VERSION = '8.2.1'

# 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 = '8.2.0'
VERSION = '8.2.1'

require 'bundler/inline'
gemfile(true) do
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 = '8.2.0'
VERSION = '8.2.1'
APPS = %w[repro rails demo calendar].freeze

require_relative '../lib/optimist'
Expand Down
2 changes: 1 addition & 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 (8.2.0)
# Pagy initializer file (8.2.1)
# 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
4 changes: 2 additions & 2 deletions gem/javascripts/pagy-dev.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gem/javascripts/pagy-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const Pagy = (() => {
const trim = (a, param) => a.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "");
// Public interface
return {
version: "8.2.0",
version: "8.2.1",
// Scan for elements with a "data-pagy" attribute and call their init functions with the decoded args
init(arg) {
const target = arg instanceof Element ? arg : document;
Expand Down
2 changes: 1 addition & 1 deletion gem/javascripts/pagy.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/lib/pagy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Core class
class Pagy
VERSION = '8.2.0'
VERSION = '8.2.1'

# Gem root pathname to get the path of Pagy files stylesheets, javascripts, apps, locales, etc.
def self.root
Expand Down
2 changes: 1 addition & 1 deletion gem/lib/pagy/backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def pagy_get_count(collection, vars)
# Get the page integer from the params
# Overridable by the jsonapi extra
def pagy_get_page(vars)
(params[vars[:page_param] || DEFAULT[:page_param]] || 1).to_i
[params[vars[:page_param] || DEFAULT[:page_param]].to_i, 1].max
end

# Sub-method called only by #pagy: here for easy customization of record-extraction by overriding
Expand Down
2 changes: 1 addition & 1 deletion gem/lib/pagy/extras/jsonapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def pagy_get_page(vars)
return super if pagy_skip_jsonapi?(vars)
return 1 if params[:page].nil?

params[:page][vars[:page_param] || DEFAULT[:page_param]].to_i
[params[:page][vars[:page_param] || DEFAULT[:page_param]].to_i, 1].max
end
end
Backend.prepend BackendOverride
Expand Down
2 changes: 1 addition & 1 deletion retype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ url: https://ddnexus.github.io/pagy

branding:
title: Pagy
label: 8.2.0
label: 8.2.1
colors:
label:
text: "#FFFFFF"
Expand Down
2 changes: 1 addition & 1 deletion scripts/version-bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ TMPLOG=$(mktemp)
# Iterate through the new commits
for commit in $(git rev-list "$old_vers"..HEAD)
do
if [[ -n $(git show --pretty="format:" --name-only --relative=gem) ]]
if [[ -n $(git show --pretty="format:" --name-only --relative=gem $commit) ]]
then
git show --no-patch --format="- %s" $commit >> "$TMPLOG"
body=$(git show --no-patch --format="%b" $commit)
Expand Down
2 changes: 1 addition & 1 deletion src/pagy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const Pagy = (() => {

// Public interface
return {
version: "8.2.0",
version: "8.2.1",

// Scan for elements with a "data-pagy" attribute and call their init functions with the decoded args
init(arg?:Element | never) {
Expand Down

0 comments on commit 60ae894

Please sign in to comment.