ankane / blazer

Business intelligence made simple
MIT License
4.56k stars 474 forks source link

Pagination does not currently work #420

Closed gotoAndBliss closed 1 year ago

gotoAndBliss commented 2 years ago

I believe this is easily remedied.

We have a limit set at (1000)

module Blazer
  class QueriesController < BaseController
   ...
    def home
      set_queries(1000)

But in home.html.erb, we only only show 200

    computed: {
      visibleItems: function () {
        // hack to get to update
        this.updateCounter

        var pageSize = 200

Which means if you have more than 200 queries, this line :

307: @more = limit && @queries.size >= limit

Will return false effectively turning off pagination. So the only way to make pagination work after you make more than 200 queries, is to make 1000 queries.

Or we make the Rails SetLimit(n) == the Pagination limit in the JS

gotoAndBliss commented 2 years ago

Setting the pageSize to 1000 to equal the set_queries does the trick for me.

ankane commented 2 years ago

Hey @gotoAndBliss, I'm not sure I follow. There's no pagination (just a limit of 200 in JavaScript).