[ARVADOS] updated: 1.3.0-387-g689cd1585

Git user git at public.curoverse.com
Mon Feb 25 14:46:10 EST 2019


Summary of changes:
 apps/workbench/app/views/layouts/body.html.erb           | 11 +++++++----
 apps/workbench/config/application.default.yml            |  5 +++++
 .../test/integration/application_layout_test.rb          | 16 ++++++++++++++++
 3 files changed, 28 insertions(+), 4 deletions(-)

       via  689cd158566b0370153e521aceff2758e77f2e8a (commit)
       via  5462e33891e660cfe16b40332db739f7aa9fc405 (commit)
      from  408e81ed610fa238229150e4a47f457139fcf867 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 689cd158566b0370153e521aceff2758e77f2e8a
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Mon Feb 25 16:45:54 2019 -0300

    14794: Adds test
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb
index 74a42877b..75f2e836b 100644
--- a/apps/workbench/test/integration/application_layout_test.rb
+++ b/apps/workbench/test/integration/application_layout_test.rb
@@ -141,6 +141,22 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
   end
 
   [
+    [false, false],
+    ['http://wb2.example.org', true],
+  ].each do |wb2_url_config, wb2_menu_appear|
+    test "workbench2_url=#{wb2_url_config} should#{wb2_menu_appear ? '' : ' not'} show WB2 menu" do
+      Rails.configuration.workbench2_url = wb2_url_config
+      visit page_with_token('active')
+      within('.navbar-fixed-top') do
+        page.find("#notifications-menu").click
+        within('.dropdown-menu') do
+          assert_equal wb2_menu_appear, page.has_text?('Go to Workbench 2')
+        end
+      end
+    end
+  end
+
+  [
     ['active', true],
     ['active_with_prefs_profile_no_getting_started_shown', false],
   ].each do |token, getting_started_shown|

commit 5462e33891e660cfe16b40332db739f7aa9fc405
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Mon Feb 25 14:17:19 2019 -0300

    14794: Adds configuration to point to workbench2 URL explicitly
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/apps/workbench/app/views/layouts/body.html.erb b/apps/workbench/app/views/layouts/body.html.erb
index c1dc15fa9..c2ddda8c7 100644
--- a/apps/workbench/app/views/layouts/body.html.erb
+++ b/apps/workbench/app/views/layouts/body.html.erb
@@ -82,18 +82,21 @@ SPDX-License-Identifier: AGPL-3.0 %>
 		      </form>
                     </li>
                   <% end %>
+                <% if Rails.configuration.workbench2_url %>
                 <li role="menuitem">
                   <%
-                  protocol, hostname = arvados_api_client.discovery[:workbenchUrl].split("://")
-                  workbench2_url = "#{protocol}://workbench2.#{hostname.split(".")[1..-1].join(".")}"
+                    # Remove any trailing '/'
+                    r = /^(.*?)[\/]*$/
+                    wb2_url = r.match(Rails.configuration.workbench2_url)[1]
                   %>
-                  <form action="<%= workbench2_url %>/token" method="GET">
+                  <form action="<%= wb2_url %>/token" method="GET">
                     <input type="hidden" name="api_token" value="<%= Thread.current[:arvados_api_token] %>">
                     <button role="menuitem" type="submit">
-                      <i class="fa fa-lg fa-share-square fa-fw"></i> Go to new Workbench
+                      <i class="fa fa-lg fa-share-square fa-fw"></i> Go to Workbench 2
                     </button>
                   </form>
                 </li>
+                <% end %>
                 <li role="menuitem">
                   <%= link_to virtual_machines_user_path(current_user), role: 'menu-item' do %>
                     <i class="fa fa-lg fa-terminal fa-fw"></i> Virtual machines
diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index 4e0a35a55..161e74540 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -326,3 +326,8 @@ common:
   # the jobs api is disabled and there are no local git repositories.
   #
   repositories: true
+
+  #
+  # Add an item to the user menu pointing to workbench2_url, if not false.
+  #
+  workbench2_url: false

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list