Skip to content

Commit

Permalink
Added a customizable per page task limitation attribute to QueueTab t…
Browse files Browse the repository at this point in the history
…hat is used by task_pager to allow an adjustable maximum number of tasks per tab. (#21594)

Co-authored-by: = <tyler.broyles@va.gov>
  • Loading branch information
roberttravispierce and TylerBroyles authored May 9, 2024
1 parent e2777cf commit ffbbf28
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/models/queue_tab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ def no_task_limit
false
end

def custom_task_limit
TaskPager::TASKS_PER_PAGE
end

# rubocop:disable Metrics/AbcSize
def self.attorney_column_names
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ def hide_from_queue_table_view
end

def no_task_limit
true
false
end

def custom_task_limit
60
end
end
3 changes: 2 additions & 1 deletion app/models/task_pager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def initialize(args)
def paged_tasks
@paged_tasks ||= begin
tasks = sorted_tasks(filtered_tasks)
pagination_enabled ? tasks.page(page).per(TASKS_PER_PAGE) : tasks
limit = queue_tab.custom_task_limit || TASKS_PER_PAGE
pagination_enabled ? tasks.page(page).per(limit) : tasks
end
end

Expand Down

0 comments on commit ffbbf28

Please sign in to comment.