Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation in My Scenarios is broken #4307

Open
mabijkerk opened this issue Jul 24, 2024 · 2 comments · May be fixed by #4317
Open

Navigation in My Scenarios is broken #4307

mabijkerk opened this issue Jul 24, 2024 · 2 comments · May be fixed by #4317
Assignees
Labels
Pinned Will never be marked as stale or auto-closed.

Comments

@mabijkerk
Copy link
Member

In the navigation pane of My Scenarios, I can switch to the second page. However, once I'm there, the navigation buttons do not give any response. I'm working in Google Chrome.

Screenshot 2024-07-24 at 15 31 01

@louispt1
Copy link
Contributor

Keeping track of progress

TLDR: I can't identify the issue exactly so far. By all accounts and the kaminari docs it should be working as is...

From the first page the pagination links populate correctly.
Url: http://localhost:3001/saved_scenarios/all

Generated Links: <nav class="pagination" role="navigation" aria-label="pager"> 
<span class="page current"> 1 </span>
 <span class="page"> 
 <a rel="next" href="/saved_scenarios/all?page=2">2</a> 
 </span> <span class="page"> 
 <a href="/saved_scenarios/all?page=3">3</a> </span> 
<span class="page"> <a href="/saved_scenarios/all?page=4">4</a> </span> 
<span class="page"> <a href="/saved_scenarios/all?page=5">5</a> </span> 
<span class="page gap">&hellip;</span> <span class="next"> <a rel="next" href="/saved_scenarios/all?page=2">Next &rsaquo;</a> </span> <span class="last"> <a href="/saved_scenarios/all?page=514">Last &raquo;</a> </span> </nav>

But then from any other page where there is a 'current page' parameter, the links all just link to the current page:
Url: http://localhost:3001/saved_scenarios/all?page=3

Generated Links: <nav class="pagination" role="navigation" aria-label="pager"> 
<span class="first"> 
<a href="/saved_scenarios/all">&laquo; First</a>
 </span> <span class="prev"> <a rel="prev" href="/saved_scenarios/all?page=3">&lsaquo; Prev</a> </span>
 <span class="page"> <a href="/saved_scenarios/all">1</a> 
</span> <span class="page"> <a rel="prev" href="/saved_scenarios/all?page=3">2</a> 
</span> <span class="page current"> 3 </span> <span class="page">
 <a rel="next" href="/saved_scenarios/all?page=3">4</a> </span>
 <span class="page"> <a href="/saved_scenarios/all?page=3">5</a> </span>
 <span class="page"> <a href="/saved_scenarios/all?page=3">6</a> </span> 
<span class="page"> <a href="/saved_scenarios/all?page=3">7</a> </span> 
<span class="page gap">&hellip;</span> <span class="next"> <a rel="next" href="/saved_scenarios/all?page=3">Next &rsaquo;</a> </span> <span class="last"> <a href="/saved_scenarios/all?page=3">Last &raquo;</a> </span> </nav>

The 'current page' is updating correctly as the :page param, so I don't really know what kaminari's problem is.

I also tried updating the kaminari gem to 1.2.2 - this didn't break any spec but also didn't make any difference.

I also tried adding a route: get 'all(/page/:page)', action: :all, as: :all_saved_scenarios which didn't make any difference unfortunately.

  resources :saved_scenarios, except: %i[new] do
    resource :feature, only: %i[show create update destroy], controller: 'featured_scenarios'

    resources :users, controller: 'saved_scenario_users' do
      member do
        get :confirm_destroy
      end
    end

    member do
      get :load
      put :discard
      put :undiscard
      put :publish
      put :unpublish
      put :restore
      get :confirm_restore
    end

    collection do
      get :discarded
      get :all
    end

    get 'all(/page/:page)', action: :all, as: :all_saved_scenarios
    get '/history' => 'saved_scenario_history#index'
    put '/history/:scenario_id' => 'saved_scenario_history#update',  as: :update_saved_scenario_history

    get '/report/:report_name' => 'saved_scenario_reports#show'
  end

@louispt1 louispt1 changed the title Navigation in My Scenarios seems broken Navigation in My Scenarios is broken Aug 15, 2024
@louispt1 louispt1 linked a pull request Aug 21, 2024 that will close this issue
Copy link

This issue has had no activity for 60 days and will be closed in 7 days. Removing the "Stale" label or posting a comment will prevent it from being closed automatically. You can also add the "Pinned" label to ensure it isn't marked as stale in the future.

@github-actions github-actions bot added the Stale Issue had no activity for 60 days and will be, or has been, closed. label Oct 15, 2024
@mabijkerk mabijkerk added Pinned Will never be marked as stale or auto-closed. and removed Stale Issue had no activity for 60 days and will be, or has been, closed. labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pinned Will never be marked as stale or auto-closed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants