6588: Added new pages in notifications menu for repositories, virtual machines,
authorManoj <jonam33@gmail.com>
Tue, 28 Jul 2015 15:16:21 +0000 (11:16 -0400)
committerManoj <jonam33@gmail.com>
Tue, 28 Jul 2015 15:16:21 +0000 (11:16 -0400)
current token and ssh keys. Added a test for these new pages.

apps/workbench/app/views/layouts/body.html.erb
apps/workbench/app/views/users/_manage_current_token.html.erb
apps/workbench/app/views/users/_manage_repositories.html.erb
apps/workbench/app/views/users/_manage_ssh_keys.html.erb
apps/workbench/app/views/users/_manage_virtual_machines.html.erb
apps/workbench/test/integration/application_layout_test.rb

index a32b41c84dca0fa8184ab21aec576f2bd47975fe..510adedb4c8198389e03c4dcd40270fd647fe4b8 100644 (file)
                   <%= current_user.email %>
                 </li>
                 <% if current_user.is_active %>
-                <li role="menuitem"><a href="/projects/<%=current_user.uuid%>" role="menuitem"><i class="fa fa-home fa-fw"></i> Home project </a></li>
+                <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>
 
-                <li role="menuitem"><%= link_to raw('<i class="fa fa-key fa-fw"></i> Virtual Machines'), manage_account_path(page: "manage_virtual_machines") %></li>
-                <li role="menuitem"><%= link_to raw('<i class="fa fa-key fa-fw"></i> Repositories'), manage_account_path(page: "manage_repositories") %></li>
-                <li role="menuitem"><%= link_to raw('<i class="fa fa-key fa-fw"></i> SSH Keys'), manage_account_path(page: "manage_ssh_keys") %></li>
-                <li role="menuitem"><%= link_to raw('<i class="fa fa-key fa-fw"></i> Current Token'), manage_account_path(page: "manage_current_token") %></li>
+                <li role="menuitem"><%= link_to raw('<i class="fa fa-lg fa-terminal fa-fw"></i> My Virtual Machines'), manage_account_path(page: "manage_virtual_machines") %></li>
+                <li role="menuitem"><%= link_to raw('<i class="fa fa-lg fa-code-fork fa-fw"></i> My Repositories'), manage_account_path(page: "manage_repositories") %></li>
+                <li role="menuitem"><%= link_to raw('<i class="fa fa-lg fa-ticket fa-fw"></i> My Current Token'), manage_account_path(page: "manage_current_token") %></li>
+                <li role="menuitem"><%= link_to raw('<i class="fa fa-lg fa-key fa-fw"></i> My SSH Keys'), manage_account_path(page: "manage_ssh_keys") %></li>
 
-                <li role="menuitem"><a href="/manage_account" role="menuitem"><i class="fa fa-key fa-fw"></i> Manage account</a></li>
+                <li role="menuitem"><a href="/manage_account" role="menuitem"><i class="fa fa-lg fa-key fa-fw"></i> Manage account</a></li>
 
                 <% if Rails.configuration.user_profile_form_fields %>
-                  <li role="menuitem"><a href="/users/<%=current_user.uuid%>/profile" role="menuitem"><i class="fa fa-key fa-fw"></i> Manage profile</a></li>
+                  <li role="menuitem"><a href="/users/<%=current_user.uuid%>/profile" role="menuitem"><i class="fa fa-lg fa-user fa-fw"></i> Manage profile</a></li>
                 <% end %>
                 <% end %>
-                <li role="menuitem"><a href="<%= logout_path %>" role="menuitem"><i class="fa fa-sign-out fa-fw"></i> Log out</a></li>
+                <li role="presentation" class="divider"></li>
+                <li role="menuitem"><a href="<%= logout_path %>" role="menuitem"><i class="fa fa-lg fa-sign-out fa-fw"></i> Log out</a></li>
                 <% if user_notifications.any? %>
                   <li role="presentation" class="divider"></li>
                   <% user_notifications.each_with_index do |n, i| %>
@@ -87,7 +88,7 @@
                 </a>
                 <ul class="dropdown-menu" role="menu">
                   <li role="presentation" class="dropdown-header">
-                    Settings
+                    Admin Settings
                   </li>
                   <li role="menuitem"><a href="/repositories">
                       <i class="fa fa-lg fa-code-fork fa-fw"></i> Repositories
index f4436ba8b96fbd10686a9ed5e3f81bbddb031801..b4ed2e322ebf07b14cec97bec29b05f26f4c746f 100644 (file)
@@ -9,7 +9,7 @@
 
 <div id="#manage_current_token" class="panel-body">
 <p>The Arvados API token is a secret key that enables the Arvados SDKs to access Arvados with the proper permissions. For more information see <%= link_to raw('Getting an API token'), "#{Rails.configuration.arvados_docsite}/user/reference/api-tokens.html", target: "_blank"%>.</p>
-<p>Paste the following lines at a shell prompt to set up the necessary environment for Arvados SDKs to authenticate to your account, <b><%= current_user.email %></b></p>
+<p>Paste the following lines at a shell prompt to set up the necessary environment for Arvados SDKs to authenticate to your <b><%= current_user.username %></b> account.</p>
 
 <pre>
 HISTIGNORE=$HISTIGNORE:'export ARVADOS_API_TOKEN=*'
@@ -21,5 +21,6 @@ export ARVADOS_API_HOST_INSECURE=true
 unset ARVADOS_API_HOST_INSECURE
 <% end %>
 </pre>
+<p>Arvados <%= link_to raw('virtual machines'), manage_account_path(page: "manage_virtual_machines") %> do this for you automatically. This setup is needed only when you use the API remotely (e.g., from your own workstation).</p>
 </div>
 </div>
index b616b6d6347fe2056d1f2666bbb060cac44ffb50..d1cfef5079b584cbdb42937a1996cb4ecb1f1085 100644 (file)
@@ -61,3 +61,5 @@
   <% end %>
 </div>
 </div>
+  <p>In order to clone git repositories using SSH, <%= link_to raw('add an SSH key to your account'), manage_account_path(page: "manage_ssh_keys") %> and clone the git@ URLs.</p>
+  <p>When you are using an Arvados virtual machine, you should clone the https:// URLs. This will authenticate automatically using your API token.</p>
index 951b79c6dea19551f58cb47ac4a84a6a33c74933..8a11d37f0e1f3b1834b53dd74d5b87eec95965ff 100644 (file)
 
 <div id="manage_ssh_keys" class="panel-body">
   <% if !@my_ssh_keys.any? %>
-     <p> You have not yet set up an SSH public key for use with Arvados. </p>
-     <p>  <%= link_to "Click here",
+     <p> You have not yet set up an SSH public key for use with Arvados. <%= link_to "Learn more.",
                   "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access-unix.html",
                   style: "font-weight: bold",
-                  target: "_blank" %>  to learn about SSH keys in Arvados.
+                  target: "_blank" %>
      </p>
      <p> When you have an SSH key you would like to use, add it using the <b>Add</b> button. </p>
   <% else %>
index 295311d33d62b848e7e47baab25a8662a7f6043c..daa0fc95b67f9c90f60cfffb164ff83f98b71cb0 100644 (file)
         <% end %>
       </tbody>
     </table>
-
-    <p>Sample SSH Conig  <i>~/.ssh/config:</i></p>
+  <% end %>
+</div>
+</div>
+  <p>In order to access virtual machines using SSH, <%= link_to raw('add an SSH key to your account'), manage_account_path(page: "manage_ssh_keys") %> and add a section like this to your SSH configuration file ( <i>~/.ssh/config</i>):</p>
     <pre>Host *.arvados
       TCPKeepAlive yes
       ServerAliveInterval 60
       ProxyCommand ssh -p2222 turnout@switchyard.<%= current_api_host || 'xyzzy.arvadosapi.com' %> -x -a $SSH_PROXY_FLAGS %h
     </pre>
-  <% end %>
-</div>
-</div>
index 31a297f0c14c3dd4215499e8d202d294ca980ff5..d9472d8058ec57248ce37db45a0a9dccd76442c7 100644 (file)
@@ -240,4 +240,29 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
       assert page.has_text? look_for
     end
   end
+
+  [
+    ['My Virtual Machines', nil, 'Host name'],
+    ['My Repositories', 'Add new repository', 'It may take a minute or two before you can clone your new repository.'],
+    ['My SSH Keys', 'Add new SSH key', 'Click here to learn about SSH keys in Arvados.'],
+    ['My Current Token', nil, 'HISTIGNORE=$HISTIGNORE'],
+  ].each do |page_name, button_name, look_for|
+    test "test notification menu for page #{page_name}" do
+      visit page_with_token('admin')
+      within('.navbar-fixed-top') do
+          page.find("#notifications-menu").click
+          within('.dropdown-menu') do
+            assert_selector 'a', text: page_name
+            find('a', text: page_name).click
+          end
+      end
+
+      if button_name
+        assert_selector 'a', text: button_name
+        find('a', text: button_name).click
+      end
+
+      assert page.has_text? look_for
+    end
+  end
 end