20850: Add deprecation notice & wb2 redirect to every page
[arvados.git] / apps / workbench / app / views / layouts / body.html.erb
index 5df02c7ee30eb780d8a65e1556affab69f8c711a..46af0f2d8860341bb5a6d78be526f55e4e9a2590 100644 (file)
@@ -72,9 +72,9 @@ SPDX-License-Identifier: AGPL-3.0 %>
                 </li>
                 <% if current_user.is_active %>
                 <li role="menuitem"><a href="/projects/<%=current_user.uuid%>" role="menuitem"><i class="fa fa-lg fa-home fa-fw"></i> Home project </a></li>
-                  <% if Rails.configuration.Services.Composer.ExternalURL %>
+                  <% if Rails.configuration.Services.Composer.ExternalURL != URI("") %>
                     <li role="menuitem">
-                     <form action="<%= Rails.configuration.Services.Composer.ExternalURL %>" method="GET">
+                     <form action="<%= Rails.configuration.Services.Composer.ExternalURL.to_s %>" 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-alt fa-fw"></i> Workflow Composer
@@ -82,15 +82,16 @@ SPDX-License-Identifier: AGPL-3.0 %>
                      </form>
                     </li>
                   <% end %>
-                <% if Rails.configuration.Services.Workbench2.ExternalURL %>
+                <% if Rails.configuration.Services.Workbench2.ExternalURL != URI("") %>
                 <li role="menuitem">
                   <%
-                    wb2_url = Rails.configuration.Workbench2.ExternalURL
-                    wb2_url += '/' if wb2_url[-1] != '/'
-                    wb2_url += 'token'
+                  wb2_url = Rails.configuration.Services.Workbench2.ExternalURL.to_s
+                    if wb2_url[-1] == '/'
+                  wb2_url  = wb2_url.chop
+                  end
+                  wb2_url += request.fullpath
                   %>
                   <form action="<%= wb2_url %>" 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 Workbench 2
                     </button>
@@ -161,15 +162,9 @@ SPDX-License-Identifier: AGPL-3.0 %>
                   <li role="menuitem"><a href="/groups">
                       <i class="fa fa-lg fa-users fa-fw"></i> Groups
                   </a></li>
-                  <li role="menuitem"><a href="/nodes">
-                      <i class="fa fa-lg fa-cloud fa-fw"></i> Compute nodes
-                  </a></li>
                   <li role="menuitem"><a href="/keep_services">
                       <i class="fa fa-lg fa-exchange fa-fw"></i> Keep services
                   </a></li>
-                  <li role="menuitem"><a href="/keep_disks">
-                      <i class="fa fa-lg fa-hdd-o fa-fw"></i> Keep disks
-                  </a></li>
                 </ul>
               </li>
             <% end %>
@@ -199,7 +194,7 @@ SPDX-License-Identifier: AGPL-3.0 %>
               <li role="presentation" class="dropdown-header">
                 Help
               </li>
-              <% if Rails.configuration.EnableGettingStartedPopup %>
+              <% if Rails.configuration.Workbench.EnableGettingStartedPopup %>
                 <li>
                 <%= link_to raw('<i class="fa fa-fw fa-info"></i> Getting Started ...'), "#",
                      {'data-toggle' => "modal", 'data-target' => '#getting-started-modal-window'}  %>
@@ -250,6 +245,22 @@ SPDX-License-Identifier: AGPL-3.0 %>
       <% end %>
     <% end %>
 
+    <div id="deprecation-notice" class="row">
+      <div class="col-md-12">
+       <div class="alert alert-block alert-warning">
+           <button type="button" class="close" data-dismiss="alert">&times;</button>
+         <span>You are using the <a href="https://doc.arvados.org/user/topics/workbench-migration.html">deprecated workbench application</a>
+           to access Arvados. A newer workbench application is available.
+          <form action="<%= wb2_url %>" method="GET">
+                    <button type="submit">
+                      <i class="fa fa-lg fa-share-square fa-fw"></i> Go to Workbench 2
+                    </button>
+          </form>
+         </span>
+    </div>
+  </div>
+    </div>
+
     <%= render partial: 'browser_unsupported' %><%# requires JS support below %>
     <%= render partial: 'getting_started/getting_started_popup' %>
 
@@ -264,7 +275,7 @@ SPDX-License-Identifier: AGPL-3.0 %>
 <div id="report-issue-modal-window"></div>
 <script src="/browser_unsupported.js"></script>
 
-<%  if Rails.configuration.EnableGettingStartedPopup and current_user and !current_user.prefs[:getting_started_shown] and
+<%  if Rails.configuration.Workbench.EnableGettingStartedPopup and current_user and !current_user.prefs[:getting_started_shown] and
        !request.url.include?("/profile") and
        !request.url.include?("/user_agreements") and
        !request.url.include?("/inactive")%>