12519: Move multisite search page to /search
authorTom Clegg <tclegg@veritasgenetics.com>
Tue, 21 Nov 2017 14:15:56 +0000 (09:15 -0500)
committerTom Clegg <tclegg@veritasgenetics.com>
Tue, 21 Nov 2017 14:15:56 +0000 (09:15 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

apps/workbench/app/assets/javascripts/components/sessions.js
apps/workbench/app/controllers/collections_controller.rb
apps/workbench/app/controllers/multisite_controller.rb [deleted file]
apps/workbench/app/controllers/search_controller.rb
apps/workbench/app/views/layouts/body.html.erb
apps/workbench/app/views/search/index.html [moved from apps/workbench/app/views/multisite/search.html with 100% similarity]
apps/workbench/config/routes.rb

index 3cacc0ad8308b66e12dac60f51e5b64cff625ff8..e7cc5055734d4edaa2144d7eb4d704ec7e737736 100644 (file)
@@ -21,7 +21,7 @@ window.SessionsTable = {
         return m('.container', [
             m('p', [
                 'You can log in to multiple Arvados sites here, then use the ',
-                m('a[href="/multisite"]', 'multi-site search'),
+                m('a[href="/search"]', 'multi-site search'),
                 ' page to search collections and projects on all sites at once.',
             ]),
             m('table.table.table-condensed.table-hover', [
index 1a69f91496c5da988a96c90c28f4c0217beb7de5..5fcb2dc569ff6b2446c602dc26de61a069155ba2 100644 (file)
@@ -16,7 +16,7 @@ class CollectionsController < ApplicationController
   skip_around_filter(:require_thread_api_token,
                      only: [:show_file, :show_file_links])
   skip_before_filter(:find_object_by_uuid,
-                     only: [:provenance, :show_file, :show_file_links, :multisite])
+                     only: [:provenance, :show_file, :show_file_links])
   # We depend on show_file to display the user agreement:
   skip_before_filter :check_user_agreements, only: :show_file
   skip_before_filter :check_user_profile, only: :show_file
@@ -324,11 +324,6 @@ class CollectionsController < ApplicationController
     end
   end
 
-  def multisite
-    # Legacy URL, redirect to new one.
-    redirect_to multisite_path
-  end
-
   protected
 
   def find_usable_token(token_list)
diff --git a/apps/workbench/app/controllers/multisite_controller.rb b/apps/workbench/app/controllers/multisite_controller.rb
deleted file mode 100644 (file)
index c221c6b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (C) The Arvados Authors. All rights reserved.
-#
-# SPDX-License-Identifier: AGPL-3.0
-
-class MultisiteController < ApplicationController
-  skip_before_filter :find_object_by_uuid
-end
index 40e484ea062b449068923fdc8d9951f1f7adddbe..3775abd1ae9f1117926d7bde8c847fc32ad0cd60 100644 (file)
@@ -3,6 +3,8 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 class SearchController < ApplicationController
+  skip_before_filter :ensure_arvados_api_exists
+
   def find_objects_for_index
     search_what = Group
     if params[:project_uuid]
index 9c3e3e9832751c8e1832fa7f32df10bc4da8e5e5..c1399f2602dc151907253d080af08504a53c0875 100644 (file)
@@ -34,7 +34,7 @@ SPDX-License-Identifier: AGPL-3.0 %>
                     <%=
                        target = Rails.configuration.multi_site_search
                        if target == true
-                         target = {controller: 'multisite', action: 'search'}
+                         target = {controller: 'search', action: 'index'}
                        end
                        link_to("Multi-site search", target, {class: 'btn btn-default'}) %>
                   </form>
index 777d9780d6b39f0863f4351ad6c914721315ff80..d969abd78c2b69d8de936e2a00df0c0d1f1ef0f1 100644 (file)
@@ -95,7 +95,7 @@ ArvadosWorkbench::Application.routes.draw do
     post 'remove_selected_files', on: :member
     get 'tags', on: :member
     post 'save_tags', on: :member
-    get 'multisite', on: :collection
+    get 'multisite', on: :collection, to: redirect('/search')
   end
   get('/collections/download/:uuid/:reader_token/*file' => 'collections#show_file',
       format: false)
@@ -132,8 +132,6 @@ ArvadosWorkbench::Application.routes.draw do
 
   get '/tests/mithril', to: 'tests#mithril'
   
-  get '/multisite', to: 'multisite#search'
-
   get '/status', to: 'status#status'
   
   # Send unroutable requests to an arbitrary controller