[ARVADOS] updated: 00f6df4acd32c661d2b4a16f20c2ccf34351d00c

git at public.curoverse.com git at public.curoverse.com
Wed Jul 29 17:10:43 EDT 2015


Summary of changes:
 apps/workbench/app/controllers/users_controller.rb | 47 ----------------------
 apps/workbench/app/views/layouts/body.html.erb     |  2 -
 .../notifications/_ssh_key_notification.html.erb   |  2 +-
 .../app/views/users/manage_current_token.html.erb  |  1 +
 .../app/views/users/manage_repositories.html.erb   |  2 +
 .../app/views/users/manage_ssh_keys.html.erb       |  2 +
 .../views/users/manage_virtual_machines.html.erb   |  1 +
 apps/workbench/config/routes.rb                    |  1 -
 .../test/controllers/users_controller_test.rb      |  4 +-
 .../test/integration/application_layout_test.rb    | 10 ++++-
 .../test/integration/user_manage_account_test.rb   |  6 +--
 11 files changed, 20 insertions(+), 58 deletions(-)
 create mode 100644 apps/workbench/app/views/users/manage_current_token.html.erb
 create mode 100644 apps/workbench/app/views/users/manage_repositories.html.erb
 create mode 100644 apps/workbench/app/views/users/manage_ssh_keys.html.erb
 create mode 100644 apps/workbench/app/views/users/manage_virtual_machines.html.erb

       via  00f6df4acd32c661d2b4a16f20c2ccf34351d00c (commit)
       via  cda68ba838b2595c631231a08a8e3b3ea03d2c7f (commit)
      from  017d19d31606b8b313c04fffc33d44592ad9644b (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 00f6df4acd32c661d2b4a16f20c2ccf34351d00c
Author: Manoj <jonam33 at gmail.com>
Date:   Wed Jul 29 17:10:07 2015 -0400

    6588: Removed manage account button and updated tests and links.

diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index 6cf15a8..b63e8ba 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -312,53 +312,6 @@ class UsersController < ApplicationController
     end
   end
 
-  def manage_account
-    # repositories current user can read / write
-    repo_links = Link.
-      filter([['head_uuid', 'is_a', 'arvados#repository'],
-              ['tail_uuid', '=', current_user.uuid],
-              ['link_class', '=', 'permission'],
-             ])
-
-    owned_repositories = Repository.where(owner_uuid: current_user.uuid)
-
-    @my_repositories = (Repository.where(uuid: repo_links.collect(&:head_uuid)) |
-                        owned_repositories).
-                       uniq { |repo| repo.uuid }
-
-
-    @repo_writable = {}
-    repo_links.each do |link|
-      if link.name.in? ['can_write', 'can_manage']
-        @repo_writable[link.head_uuid] = link.name
-      end
-    end
-
-    owned_repositories.each do |repo|
-      @repo_writable[repo.uuid] = 'can_manage'
-    end
-
-    # virtual machines the current user can login into
-    @my_vm_logins = {}
-    Link.where(tail_uuid: current_user.uuid,
-               link_class: 'permission',
-               name: 'can_login').
-          each do |perm_link|
-            if perm_link.properties.andand[:username]
-              @my_vm_logins[perm_link.head_uuid] ||= []
-              @my_vm_logins[perm_link.head_uuid] << perm_link.properties[:username]
-            end
-          end
-    @my_virtual_machines = VirtualMachine.where(uuid: @my_vm_logins.keys)
-
-    # current user's ssh keys
-    @my_ssh_keys = AuthorizedKey.where(key_type: 'SSH', owner_uuid: current_user.uuid)
-
-    respond_to do |f|
-      f.html { render template: 'users/manage_account' }
-    end
-  end
-
   def add_ssh_key_popup
     respond_to do |format|
       format.html
diff --git a/apps/workbench/app/views/layouts/body.html.erb b/apps/workbench/app/views/layouts/body.html.erb
index 4a17abb..2820f83 100644
--- a/apps/workbench/app/views/layouts/body.html.erb
+++ b/apps/workbench/app/views/layouts/body.html.erb
@@ -62,8 +62,6 @@
                 <li role="menuitem"><a href="/manage_current_token" role="menuitem"><i class="fa fa-lg fa-ticket fa-fw"></i> My current token</a></li>
                 <li role="menuitem"><a href="/manage_ssh_keys" role="menuitem"><i class="fa fa-lg fa-key fa-fw"></i> My SSH keys</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-lg fa-user fa-fw"></i> Manage profile</a></li>
                 <% end %>
diff --git a/apps/workbench/app/views/notifications/_ssh_key_notification.html.erb b/apps/workbench/app/views/notifications/_ssh_key_notification.html.erb
index 989db3d..84c168a 100644
--- a/apps/workbench/app/views/notifications/_ssh_key_notification.html.erb
+++ b/apps/workbench/app/views/notifications/_ssh_key_notification.html.erb
@@ -2,5 +2,5 @@
     <div>
       Hi, I noticed that you have not yet set up an SSH public key for use with Arvados.
       <%= link_to "Click here to set up an SSH public key for use with Arvados.",
-      "/manage_account", style: "font-weight: bold" %>
+      "/manage_ssh_keys", style: "font-weight: bold" %>
     </div>
diff --git a/apps/workbench/config/routes.rb b/apps/workbench/config/routes.rb
index 86140cf..603bb47 100644
--- a/apps/workbench/config/routes.rb
+++ b/apps/workbench/config/routes.rb
@@ -51,7 +51,6 @@ ArvadosWorkbench::Application.routes.draw do
   get '/manage_repositories' => 'users#manage_repositories'
   get '/manage_current_token' => 'users#manage_current_token'
   get '/manage_ssh_keys' => 'users#manage_ssh_keys'
-  get '/manage_account' => 'users#manage_account'
   get "/add_ssh_key_popup" => 'users#add_ssh_key_popup', :as => :add_ssh_key_popup
   get "/add_ssh_key" => 'users#add_ssh_key', :as => :add_ssh_key
   resources :logs
diff --git a/apps/workbench/test/controllers/users_controller_test.rb b/apps/workbench/test/controllers/users_controller_test.rb
index 6b9cd6e..29d1d9d 100644
--- a/apps/workbench/test/controllers/users_controller_test.rb
+++ b/apps/workbench/test/controllers/users_controller_test.rb
@@ -32,7 +32,7 @@ class UsersControllerTest < ActionController::TestCase
   end
 
   test "show repositories with read, write, or manage permission" do
-    get :manage_account, {}, session_for(:active)
+    get :manage_repositories, {}, session_for(:active)
     assert_response :success
     repos = assigns(:my_repositories)
     assert repos
@@ -43,7 +43,7 @@ class UsersControllerTest < ActionController::TestCase
   end
 
   test "show repositories lists linked as well as owned repositories" do
-    get :manage_account, {}, session_for(:active)
+    get :manage_repositories, {}, session_for(:active)
     assert_response :success
     repos = assigns(:my_repositories)
     assert repos
diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb
index b145635..6eb5492 100644
--- a/apps/workbench/test/integration/application_layout_test.rb
+++ b/apps/workbench/test/integration/application_layout_test.rb
@@ -50,7 +50,10 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
             assert page.has_no_link?('Sign agreements'), 'Found link - Sign agreements'
 
             assert_selector "a[href=\"/projects/#{user['uuid']}\"]", text: 'My home project'
-            assert page.has_link?('Manage account'), 'No link - Manage account'
+            assert page.has_link?('My virtual machines'), 'No link - My virtual machines'
+            assert page.has_link?('My repositories'), 'No link - My repositories'
+            assert page.has_link?('My current token'), 'No link - My current token'
+            assert page.has_link?('My SSH keys'), 'No link - My SSH keys'
 
             if profile_config
               assert page.has_link?('Manage profile'), 'No link - Manage profile'
@@ -59,7 +62,10 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
             end
           else
             assert_no_selector 'a', text: 'My home project'
-            assert page.has_no_link?('Manage account'), 'Found link - Manage account'
+            assert page.has_no_link?('My virtual machines'), 'No link - My virtual machines'
+            assert page.has_no_link?('My repositories'), 'No link - My repositories'
+            assert page.has_no_link?('My current token'), 'No link - My current token'
+            assert page.has_no_link?('My SSH keys'), 'No link - My SSH keys'
             assert page.has_no_link?('Manage profile'), 'Found link - Manage profile'
           end
           assert page.has_link?('Log out'), 'No link - Log out'
diff --git a/apps/workbench/test/integration/user_manage_account_test.rb b/apps/workbench/test/integration/user_manage_account_test.rb
index c86ba0c..4d1e4ad 100644
--- a/apps/workbench/test/integration/user_manage_account_test.rb
+++ b/apps/workbench/test/integration/user_manage_account_test.rb
@@ -110,7 +110,7 @@ class UserManageAccountTest < ActionDispatch::IntegrationTest
   end
 
   test "verify repositories for active user" do
-    visit page_with_token('active', '/manage_account')
+    visit page_with_token('active', '/manage_repositories')
 
     repos = [[api_fixture('repositories')['foo'], true, true],
              [api_fixture('repositories')['repository3'], false, false],
@@ -136,7 +136,7 @@ class UserManageAccountTest < ActionDispatch::IntegrationTest
 
   test "request shell access" do
     ActionMailer::Base.deliveries = []
-    visit page_with_token('spectator', '/manage_account')
+    visit page_with_token('spectator', '/manage_virtual_machines')
     assert_text 'You do not have access to any virtual machines'
     click_link 'Send request for shell access'
 
@@ -173,7 +173,7 @@ class UserManageAccountTest < ActionDispatch::IntegrationTest
   end
 
   test "create new repository" do
-    visit page_with_token("active_trustedclient", "/manage_account")
+    visit page_with_token("active_trustedclient", "/manage_repositories")
     click_on "Add new repository"
     within ".modal-dialog" do
       fill_in "Name", with: "workbenchtest"

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list