Skip to content

Commit

Permalink
Fix renamed Frontend Helpers to JS Tools and typo next_a "aria-labe…
Browse files Browse the repository at this point in the history
…l" (#700)
  • Loading branch information
djpremier authored Jun 2, 2024
1 parent d8957d7 commit 9ebb2ef
Show file tree
Hide file tree
Showing 12 changed files with 155 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Here are a few useul information for you:
with the [Pagy::Console](https://ddnexus.github.io/pagy/docs/api/console/) directly from the repo
- **Docs**
- `cd` in the pagy root directory
- Run `npm -i` or (`pnpm -i` if pnpm is installed).
- Run `npm install` or (`pnpm install` if pnpm is installed).
- Run `retype start`
- Point your browser at `http://localhost:5000/pagy` for real-time feedback
5. **Testing**
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ If you upgrade from version `< 8.0.0` see the following:
- The `navs` and `support` extras has been merged into the new [pagy extra](https://ddnexus.github.io/pagy/docs/extras/pagy).
Search for `"extras/navs"` and
`"extras/support"` and replace with `"extras/pagy"` (remove the duplicate if you used both)
- The `"extras/frontend_helpers"` has been renamed to `"extras/js_tools"`
- The build path for javascript builders has been updated to the canonical paths for gems, and has moved from the `lib` to
the gem root. Notice that the correct setup in `package json` was still wrongly wrapped in the `gem` dir for 8.0.0-8.0.1, and it
has finally been fixed in 8.0.2 (sorry for that):
Expand Down
6 changes: 3 additions & 3 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ enabled ASAP.

## 2. Run E2E Tests On Your System

Run `npm -i` or (`pnpm -i` if `pnpm` is installed).
Run `npm install` or (`pnpm install` if `pnpm` is installed).

### Run the test for all the apps

Expand All @@ -25,7 +25,7 @@ You can run all the cypress tests in parallel with:
<local-pagy-dir>/e2e $ ./cy-test
```

Notice:
Notice:

- The output of the parallel processes get mixed in the same log stream, however the test summaries are prefixed with the app name.
- The script will return a non-zero status if any of the test fail, and will print a brief feedback.
Expand All @@ -46,7 +46,7 @@ You can also run the cypress test interactively (only one APP/file at the time)
<local-pagy-dir>/e2e $ ./cy-open demo
```

Notice: You can only run the spec file for the app that is running (e.g. `demo.cy.ts` in the example above)
Notice: You can only run the spec file for the app that is running (e.g. `demo.cy.ts` in the example above)

---

Expand Down
22 changes: 11 additions & 11 deletions e2e/snapshots.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions gem/config/pagy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@

# Metadata extra: Provides the pagination metadata to Javascript frameworks like Vue.js, react.js, etc.
# See https://ddnexus.github.io/pagy/docs/extras/metadata
# you must require the frontend helpers internal extra (BEFORE the metadata extra) ONLY if you need also the :sequels
# require 'pagy/extras/frontend_helpers'
# you must require the JS Tools internal extra (BEFORE the metadata extra) ONLY if you need also the :sequels
# require 'pagy/extras/js_tools'
# require 'pagy/extras/metadata'
# For performance reasons, you should explicitly set ONLY the metadata you use in the frontend
# Pagy::DEFAULT[:metadata] = %i[scaffold_url page prev next last] # example
Expand Down
2 changes: 1 addition & 1 deletion gem/lib/pagy/extras/pagy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def pagy_prev_a(pagy, text: pagy_t('pagy.prev'), aria_label: pagy_t('pagy.aria_l
end

# Return the enabled/disabled next page anchor tag
def pagy_next_a(pagy, text: pagy_t('pagy.next'), aria_label: pagy_t('pagy.aria_label.prev'))
def pagy_next_a(pagy, text: pagy_t('pagy.next'), aria_label: pagy_t('pagy.aria_label.next'))
a = pagy_anchor(pagy)
next_a(pagy, a, text:, aria_label:)
end
Expand Down
2 changes: 1 addition & 1 deletion gem/lib/pagy/frontend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def next_a(pagy, a, text: pagy_t('pagy.next'), aria_label: pagy_t('pagy.aria_lab
if (p_next = pagy.next)
a.(p_next, text, aria_label:)
else
%(<a role="link" aria-disabled="true" aria-label=#{aria_label}>#{text}</a>)
%(<a role="link" aria-disabled="true" aria-label="#{aria_label}">#{text}</a>)
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Time.zone = 'EST'
Date.beginning_of_week = :sunday

describe 'pagy/extras/frontend_helpers_json' do
describe 'pagy/extras/js_tools_json' do
let(:app) { MockApp.new(params: {}) }

describe '#pagy_data' do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
pagy/extras/frontend_helpers_json::#pagy_data#test_0001_uses json:
pagy/extras/js_tools_json::#pagy_data#test_0001_uses json:
:data: data-pagy="WyJ0ZXN0X2Z1bmN0aW9uIiwic29tZS1zdHJpbmciLDEyMyx0cnVlXQ=="
pagy/extras/frontend_helpers_json::Calendar sequels and label_sequels#test_0001_generate the labels for the sequels:
pagy/extras/js_tools_json::Calendar sequels and label_sequels#test_0001_generate the labels for the sequels:
:sequels:
'0':
- 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Time.zone = 'EST'
Date.beginning_of_week = :sunday

describe 'pagy/extras/frontend_helpers_oj' do
describe 'pagy/extras/js_tools_oj' do
let(:app) { MockApp.new(params: {}) }

describe '#pagy_data' do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
pagy/extras/frontend_helpers_oj::Calendar sequels and label_sequels#test_0001_generate the labels for the sequels:
pagy/extras/js_tools_oj::Calendar sequels and label_sequels#test_0001_generate the labels for the sequels:
:sequels:
'0':
- 1
Expand Down Expand Up @@ -36,6 +36,6 @@ pagy/extras/frontend_helpers_oj::Calendar sequels and label_sequels#test_0001_ge
- Mar
- :gap
- Nov
pagy/extras/frontend_helpers_oj::#pagy_data#test_0001_uses oj:
pagy/extras/js_tools_oj::#pagy_data#test_0001_uses oj:
:data_1: data-pagy="WyJ0ZXN0X2Z1bmN0aW9uIiwic29tZS1zdHJpbmciLDEyMyx0cnVlXQ=="
:data_2: data-pagy="WyJ0ZXN0X2Z1bmN0aW9uIiwic29tZS1zdHJpbmciLDEyMyx0cnVlLCJwYWdlIl0="
Loading

0 comments on commit 9ebb2ef

Please sign in to comment.