12519: Moved multisite search to its own URL
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Sat, 18 Nov 2017 00:13:23 +0000 (21:13 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Sat, 18 Nov 2017 00:13:23 +0000 (21:13 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

apps/workbench/app/assets/javascripts/components/search.js [moved from apps/workbench/app/assets/javascripts/components/collections.js with 98% similarity]
apps/workbench/app/assets/javascripts/components/sessions.js
apps/workbench/app/controllers/collections_controller.rb
apps/workbench/app/controllers/multisite_controller.rb [new file with mode: 0644]
apps/workbench/app/views/layouts/body.html.erb
apps/workbench/app/views/multisite/search.html [moved from apps/workbench/app/views/collections/multisite.html with 66% similarity]
apps/workbench/config/routes.rb

similarity index 98%
rename from apps/workbench/app/assets/javascripts/components/collections.js
rename to apps/workbench/app/assets/javascripts/components/search.js
index b1233d0ce8f0b5fc6b8e365365eb0ec7d4cc6669..0e879413ac7e400fc4830312e79dcdf106c7d459 100644 (file)
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-window.CollectionsTable = {
+window.SearchResultsTable = {
     maybeLoadMore: function(dom) {
         var loader = this.loader
         if (loader.state != loader.READY)
@@ -80,7 +80,7 @@ window.CollectionsTable = {
     },
 }
 
-window.CollectionsSearch = {
+window.Search = {
     oninit: function(vnode) {
         vnode.state.sessionDB = new SessionDB()
         vnode.state.searchEntered = m.stream()
@@ -192,7 +192,7 @@ window.CollectionsSearch = {
                         m('a[href="/sessions"]', 'Add/remove sites'),
                     ]),
                 ]),
-                m(CollectionsTable, {
+                m(SearchResultsTable, {
                     loader: vnode.state.loader,
                 }),
             ],
index 3d127f1714d58a98eac115eeba96d9ebf95d39d4..3cacc0ad8308b66e12dac60f51e5b64cff625ff8 100644 (file)
@@ -21,8 +21,8 @@ window.SessionsTable = {
         return m('.container', [
             m('p', [
                 'You can log in to multiple Arvados sites here, then use the ',
-                m('a[href="/collections/multisite"]', 'multi-site search'),
-                ' page to search collections on all sites at once.',
+                m('a[href="/multisite"]', 'multi-site search'),
+                ' page to search collections and projects on all sites at once.',
             ]),
             m('table.table.table-condensed.table-hover', [
                 m('thead', m('tr', [
index 779d95c45b874d4fec157768e19013a1c68a0022..1a69f91496c5da988a96c90c28f4c0217beb7de5 100644 (file)
@@ -324,6 +324,11 @@ 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
new file mode 100644 (file)
index 0000000..c221c6b
--- /dev/null
@@ -0,0 +1,7 @@
+# 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 15f654596cbb501e8e86ccb24138d986c2f625e3..9c3e3e9832751c8e1832fa7f32df10bc4da8e5e5 100644 (file)
@@ -34,7 +34,7 @@ SPDX-License-Identifier: AGPL-3.0 %>
                     <%=
                        target = Rails.configuration.multi_site_search
                        if target == true
-                         target = {controller: 'collections', action: 'multisite'}
+                         target = {controller: 'multisite', action: 'search'}
                        end
                        link_to("Multi-site search", target, {class: 'btn btn-default'}) %>
                   </form>
similarity index 66%
rename from apps/workbench/app/views/collections/multisite.html
rename to apps/workbench/app/views/multisite/search.html
index 9b03f10f3dcd90f6fd14d4d730367359be620797..6bcad0b1ae2c245ccd9b65afda7d3eac373088a7 100644 (file)
@@ -2,4 +2,4 @@
 
 SPDX-License-Identifier: AGPL-3.0 -->
 
-<div data-mount-mithril="CollectionsSearch"></div>
+<div data-mount-mithril="Search"></div>
index fee49c14ce213aa2cd001252043f4cc7dfc79745..777d9780d6b39f0863f4351ad6c914721315ff80 100644 (file)
@@ -109,7 +109,7 @@ ArvadosWorkbench::Application.routes.draw do
     get 'tab_counts', on: :member
     get 'public', on: :collection
   end
-
+  
   resources :search do
     get 'choose', :on => :collection
   end
@@ -131,9 +131,11 @@ ArvadosWorkbench::Application.routes.draw do
   match '/_health/ping', to: 'healthcheck#ping', via: [:get]
 
   get '/tests/mithril', to: 'tests#mithril'
+  
+  get '/multisite', to: 'multisite#search'
 
   get '/status', to: 'status#status'
-
+  
   # Send unroutable requests to an arbitrary controller
   # (ends up at ApplicationController#render_not_found)
   match '*a', to: 'links#render_not_found', via: [:get, :post]