1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class WorkUnitTemplatesController < ApplicationController
6 def find_objects_for_index
7 return if !params[:partial]
10 @filters = @filters || []
12 # get next page of pipeline_templates
13 if PipelineTemplate.api_exists?(:index)
14 filters = @filters + [["uuid", "is_a", ["arvados#pipelineTemplate"]]]
15 pipelines = PipelineTemplate.limit(@limit).with_count("none").order(["created_at desc"]).filter(filters)
18 # get next page of workflows
19 filters = @filters + [["uuid", "is_a", ["arvados#workflow"]]]
20 workflows = Workflow.limit(@limit).order(["created_at desc"]).with_count("none").filter(filters)
22 @objects = (pipelines.to_a + workflows.to_a).sort_by(&:created_at).reverse.first(@limit)
25 @next_page_filters = next_page_filters('<=')
26 @next_page_href = url_for(partial: :choose_rows,
27 filters: @next_page_filters.to_json)
33 def next_page_href with_params={}