feat: Add Pagy pagination with Turbo frames to invoices page#1496
Open
OlegPhenomenon wants to merge 2 commits intomasterfrom
Open
feat: Add Pagy pagination with Turbo frames to invoices page#1496OlegPhenomenon wants to merge 2 commits intomasterfrom
OlegPhenomenon wants to merge 2 commits intomasterfrom
Conversation
Implement independent pagination for all 5 invoice types using Pagy gem
with Turbo frame integration for seamless navigation without page reloads.
Changes:
- Add ITEMS_PER_PAGE constant (10 items per page) to InvoicesController
- Implement Pagy pagination for all 5 invoice collections:
* Issued invoices (issued_page param)
* Cancelled payable invoices (cancelled_payable_page param)
* Cancelled expired invoices (cancelled_expired_page param)
* Paid invoices (paid_page param)
* Deposit paid records (deposit_page param)
- Wrap each tab content with unique Turbo frames for independent updates
- Update Outstanding Invoices component:
* Add pagy_issued, pagy_cancelled_payable, pagy_cancelled_expired attributes
* Wrap 3 tabs with turbo_frame_tag: outstanding_issued_invoices,
outstanding_cancelled_payable, outstanding_cancelled_expired
* Add Pagy component at bottom of each frame
* Update counters to use pagy.count instead of collection.count
- Update Paid Invoices component:
* Add pagy_paid, pagy_deposit attributes
* Wrap 2 tabs with turbo_frame_tag: paid_invoices, paid_deposits
* Add Pagy component at bottom of each frame
* Update counters to use pagy.count
- Uncomment Pagy::DEFAULT.freeze in initializer to allow runtime items customization
- Add debug logging for pagination troubleshooting
- Code formatting improvements in InvoicesController
Technical details:
- Each invoice type uses unique page_param to prevent pagination conflicts
- Turbo frames ensure only clicked tab updates (no full page reload)
- Tab state persists after pagination via URL parameters
- data-turbo-action="advance" enables browser history navigation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement independent pagination for all 5 invoice types using Pagy gem with Turbo frame integration for seamless navigation without page reloads.
Changes:
Technical details: