avo-hq / avo

Build Ruby on Rails apps 10x faster
https://avohq.io
Other
1.47k stars 230 forks source link

Clicking "go back" from a resource always goes to the first page of the collection #1555

Open davidcelis opened 1 year ago

davidcelis commented 1 year ago

Describe the bug

When using Avo's various "go back" or "cancel" buttons/links when viewing or editing a resource, the default behavior is that you get directed back to the first page of the resource's collection, regardless of how far you had to page through the collection to get to the resource you'd been viewing or editing.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Have or create an Avo resource that has many records, at least more than one page
  2. View a resource on page 2 or later
  3. Click the "⬅ Go back" link
  4. You are now back on page 1 and must manually page through the collection again

Expected behavior & Actual behavior

You should be taken back to the page you had been viewing when you clicked through to the resource

System configuration

Avo version: 2.24.0

Rails version: 7.0.4.1

Ruby version: 3.2.0

License type:

Are you using Avo monkey patches or overriding views or view components?

Screenshots or screen recordings

https://user-images.githubusercontent.com/36873/215209486-a7b9c47c-6022-4654-a420-30fec7925695.mov

Impact

Urgency

github-actions[bot] commented 1 year ago

This issue has been marked as stale because there was no activity for the past 15 days.

adrianthedev commented 1 year ago

Hmm, yes. We might be able to get off easy by adding a via_page param which we pick up from the params object. I'll add it to the roadmap.