Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Jun 28, 2024
2 parents 07c9a44 + 2def44e commit 0266f82
Show file tree
Hide file tree
Showing 25 changed files with 173 additions and 190 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.6.0
- label: I upgraded to pagy version 8.6.1
required: true
- label: I searched through the [Documentation](https://ddnexus.github.io/pagy/)
required: true
Expand Down
6 changes: 3 additions & 3 deletions .github/latest_release_body.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
- Deprecate the legacy nav bar, add features to the default faster nav bar series
- See the [CHANGELOG](https://ddnexus.github.io/pagy/changelog) for possible breaking changes

### Changes in 8.6.0
### Changes in 8.6.1

<!-- changes start -->
- Add translated pluralized aria_label.nav for "ar" locale (close #577)
- Deprecate the legacy bar. Insert first and last pages and gaps when needed into the simple bar
- Update playground apps and e2e tests
- Update pagy.rb initializer
<!-- changes end -->

[CHANGELOG](https://ddnexus.github.io/pagy/changelog)
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ If you upgrade from version `< 8.0.0` see the following:
with the `gaps: true` variable (which are the default since 8.4.6). If a legacy bar it will remain REALLY a requirement, add `require 'pagy/extras/size` to your `pagy.rb` initalizer for smooth upgrades. (see [size extra](https://ddnexus.github.io/pagy/docs/extras/size))
<hr>

## Version 8.6.1

- Update playground apps and e2e tests
- Update pagy.rb initializer

## Version 8.6.0

- Add translated pluralized aria_label.nav for "ar" locale (close #577)
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: gem
specs:
pagy (8.6.0)
pagy (8.6.1)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -226,7 +226,7 @@ GEM
rematch (2.1.0)
rerun (0.14.0)
listen (~> 3.0)
rexml (3.3.0)
rexml (3.3.1)
strscan
rouge (4.3.0)
rubocop (1.64.1)
Expand Down Expand Up @@ -276,7 +276,7 @@ GEM
stringio (3.1.1)
strscan (3.1.0)
thor (1.3.1)
tilt (2.3.0)
tilt (2.4.0)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion e2e/cypress/support/test-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface TestNavOpts {
export function testNav(app:string, id:string, {path = "/", pages = ["3", "50"], rjs = false}:TestNavOpts) {
it(`[${app}] Test ${id}`, () => {
if (rjs) {
const widths = [450, 700, 950, 1050];
const widths = [700, 950, 1050];
for (const width of widths) {
cy.viewport(width, 1000);
cy.visit(path);
Expand Down
220 changes: 90 additions & 130 deletions e2e/snapshots.js

Large diffs are not rendered by default.

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 = '8.6.0'
VERSION = '8.6.1'

# Gemfile
require 'bundler/inline'
Expand Down
9 changes: 4 additions & 5 deletions 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.6.0'
VERSION = '8.6.1'

require 'bundler/inline'
require 'bundler'
Expand All @@ -44,7 +44,6 @@ end
require 'pagy/extras/items'
require 'pagy/extras/trim'
Pagy::DEFAULT[:trim_extra] = false # opt-in trim
Pagy::DEFAULT[:size] = [1, 4, 4, 1] # old size default

# sinatra setup
require 'sinatra/base'
Expand Down Expand Up @@ -381,18 +380,18 @@ for details</p>
<%= html = send(:"pagy#{prefix}_nav", @pagy, id: 'simple-nav', aria_label: 'Pages simple-nav', size: 5) %>
<%= highlight(html) %>

<h2>pagy<%= prefix %>_nav <span class="notes">Classic nav <code>size: [1,4,4,1]</code></span></h2>
<h2>pagy<%= prefix %>_nav <span class="notes">Classic nav <code>size: 7</code></span></h2>
<%= html = send(:"pagy#{prefix}_nav", @pagy, id: 'nav', aria_label: 'Pages nav') %>
<%= highlight(html) %>

<h2>pagy<%= prefix %>_nav_js <span class="notes">Classic nav <code>size: [1,4,4,1]</code></span></h2>
<h2>pagy<%= prefix %>_nav_js <span class="notes">Classic nav <code>size: 7</code></span></h2>
<%= html = send(:"pagy#{prefix}_nav_js", @pagy, id: 'nav-js', aria_label: 'Pages nav_js') %>
<%= highlight(html) %>

<h2>pagy<%= prefix %>_nav_js <span class="notes">Responsive <code>steps: {...}</code> (Resize the window to see)</span></h2>
<%= html = send(:"pagy#{prefix}_nav_js", @pagy, id: 'nav-js-responsive',
aria_label: 'Pages nav_js_responsive',
steps: { 0 => [1,1,1,1], 500 => [1,3,3,1], 750 => [1,5,5,1], 1000 => [2,6,6,2] }) %>
steps: { 0 => 5, 500 => 7, 750 => 9, 1000 => 11 }) %>
<%= highlight(html) %>

<h2>pagy<%= prefix %>_combo_nav_js</h2>
Expand Down
3 changes: 1 addition & 2 deletions 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.6.0'
VERSION = '8.6.1'

# Gemfile
require 'bundler/inline'
Expand Down Expand Up @@ -63,7 +63,6 @@ end
require 'pagy/extras/pagy'
require 'pagy/extras/items'
require 'pagy/extras/overflow'
Pagy::DEFAULT[:size] = [1, 4, 4, 1]
Pagy::DEFAULT[:items] = 10
Pagy::DEFAULT[:overflow] = :empty_page
Pagy::DEFAULT.freeze
Expand Down
3 changes: 1 addition & 2 deletions 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.6.0'
VERSION = '8.6.1'

require 'bundler/inline'
require 'bundler'
Expand All @@ -34,7 +34,6 @@ require 'pagy/extras/pagy'
require 'pagy/extras/items'
require 'pagy/extras/overflow'
Pagy::DEFAULT[:overflow] = :empty_page
Pagy::DEFAULT[:size] = [1, 4, 4, 1]
Pagy::DEFAULT.freeze

require 'sinatra/base'
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.6.0'
VERSION = '8.6.1'
APPS = %w[repro rails demo calendar].freeze
LINUX = RbConfig::CONFIG['host_os'].include?('linux')
HOST = '0.0.0.0'
Expand Down
36 changes: 17 additions & 19 deletions 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.6.0)
# Pagy initializer file (8.6.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 All @@ -11,7 +11,8 @@
# Pagy.new|Pagy::Countless.new|Pagy::Calendar::*.new or any of the #pagy* controller methods
# Here are the few that make more sense as DEFAULTs:
# Pagy::DEFAULT[:items] = 20 # default
# Pagy::DEFAULT[:size] = [1,4,4,1] # default in pagy < 7.0
# Pagy::DEFAULT[:size] = 7 # default
# Pagy::DEFAULT[:ends] = true # default
# Pagy::DEFAULT[:page_param] = :page # default
# Pagy::DEFAULT[:count_args] = [] # example for non AR ORMs

Expand All @@ -20,6 +21,13 @@
# See https://ddnexus.github.io/pagy/categories/extra


# Legacy Compatibility Extras

# Size extra: Enable the Array type for the `:size` variable (e.g. `size: [1,4,4,1]`)
# See https://ddnexus.github.io/pagy/docs/extras/size
# require 'pagy/extras/size' # must be required before the other extras


# Backend Extras

# Arel extra: For better performance utilizing grouped ActiveRecord collections:
Expand All @@ -33,21 +41,12 @@
# Calendar extra: Add pagination filtering by calendar time unit (year, quarter, month, week, day)
# See https://ddnexus.github.io/pagy/docs/extras/calendar
# require 'pagy/extras/calendar'
# Default for each unit
# Pagy::Calendar::Year::DEFAULT[:order] = :asc # Time direction of pagination
# Pagy::Calendar::Year::DEFAULT[:format] = '%Y' # strftime format
#
# Pagy::Calendar::Quarter::DEFAULT[:order] = :asc # Time direction of pagination
# Pagy::Calendar::Quarter::DEFAULT[:format] = '%Y-Q%q' # strftime format
#
# Pagy::Calendar::Month::DEFAULT[:order] = :asc # Time direction of pagination
# Pagy::Calendar::Month::DEFAULT[:format] = '%Y-%m' # strftime format
#
# Pagy::Calendar::Week::DEFAULT[:order] = :asc # Time direction of pagination
# Pagy::Calendar::Week::DEFAULT[:format] = '%Y-%W' # strftime format
#
# Pagy::Calendar::Day::DEFAULT[:order] = :asc # Time direction of pagination
# Pagy::Calendar::Day::DEFAULT[:format] = '%Y-%m-%d' # strftime format
# Default for each calendar unit class in IRB:
# >> Pagy::Calendar::Year::DEFAULT
# >> Pagy::Calendar::Quarter::DEFAULT
# >> Pagy::Calendar::Month::DEFAULT
# >> Pagy::Calendar::Week::DEFAULT
# >> Pagy::Calendar::Day::DEFAULT
#
# Uncomment the following lines, if you need calendar localization without using the I18n extra
# module LocalizePagyCalendar
Expand Down Expand Up @@ -125,7 +124,7 @@

# Multi size var used by the *_nav_js helpers
# See https://ddnexus.github.io/pagy/docs/extras/pagy#steps
# Pagy::DEFAULT[:steps] = { 0 => [2,3,3,2], 540 => [3,5,5,3], 720 => [5,7,7,5] } # example
# Pagy::DEFAULT[:steps] = { 0 => 5, 540 => 7, 720 => 9 } # example


# Feature Extras
Expand Down Expand Up @@ -167,7 +166,6 @@
# set to false only if you want to make :jsonapi an opt-in variable
# Pagy::DEFAULT[:jsonapi] = false # default true


# Rails
# Enable the .js file required by the helpers that use javascript
# (pagy*_nav_js, pagy*_combo_nav_js, and pagy_items_selector_js)
Expand Down
2 changes: 1 addition & 1 deletion gem/javascripts/pagy-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const Pagy = (() => {
};
const trim = (a, param) => a.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "");
return {
version: "8.6.0",
version: "8.6.1",
init(arg) {
const target = arg instanceof Element ? arg : document;
const elements = target.querySelectorAll("[data-pagy]");
Expand Down
4 changes: 2 additions & 2 deletions gem/javascripts/pagy.js

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

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 0266f82

Please sign in to comment.