X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/82b46502f25b6992c93bfe7689acc095aa447e5b..94e8dd9891a2c163f9d668f251c38e9a0979ef49:/apps/workbench/app/controllers/collections_controller.rb diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb index f1fd092c22..24b9b1f755 100644 --- a/apps/workbench/app/controllers/collections_controller.rb +++ b/apps/workbench/app/controllers/collections_controller.rb @@ -7,7 +7,7 @@ class CollectionsController < ApplicationController RELATION_LIMIT = 5 def show_pane_list - %w(Files Attributes Metadata Provenance_graph Used_by JSON API) + %w(Files Provenance_graph Used_by Advanced) end def set_persistent @@ -40,6 +40,20 @@ class CollectionsController < ApplicationController end end + def choose + params[:limit] ||= 20 + @objects = Link. + filter([['link_class','=','name'], + ['head_uuid','is_a','arvados#collection']]) + find_objects_for_index + @next_page_href = (next_page_offset and + url_for(offset: next_page_offset, partial: true)) + @name_links = @objects + @objects = Collection. + filter([['uuid','in',@name_links.collect(&:head_uuid)]]) + super + end + def index if params[:search].andand.length.andand > 0 tags = Link.where(any: ['contains', params[:search]]) @@ -121,11 +135,15 @@ class CollectionsController < ApplicationController end def sharing_scopes - ["GET /arvados/v1/collections/#{@object.uuid}", "GET /arvados/v1/keep_services"] + ["GET /arvados/v1/collections/#{@object.uuid}", "GET /arvados/v1/collections/#{@object.uuid}/", "GET /arvados/v1/keep_services/accessible"] end def search_scopes - ApiClientAuthorization.filter([['scopes', '=', sharing_scopes]]).results + begin + ApiClientAuthorization.filter([['scopes', '=', sharing_scopes]]).results + rescue ArvadosApiClient::AccessForbiddenException + nil + end end def show