[ARVADOS] updated: f5a30607d1746b29688363530a3011ee5c2f4f9a
git at public.curoverse.com
git at public.curoverse.com
Wed Feb 11 14:09:23 EST 2015
Summary of changes:
apps/workbench/app/assets/javascripts/application.js | 8 --------
.../app/assets/javascripts/request_shell_access.js | 14 ++++++++++----
.../app/views/users/_manage_virtual_machines.html.erb | 19 +++++++++----------
.../test/integration/user_manage_account_test.rb | 9 +++++----
4 files changed, 24 insertions(+), 26 deletions(-)
via f5a30607d1746b29688363530a3011ee5c2f4f9a (commit)
from 4993b8b44022fd3dc73fcebf20f80d054bdf4370 (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 f5a30607d1746b29688363530a3011ee5c2f4f9a
Author: Radhika Chippada <radhika at curoverse.com>
Date: Wed Feb 11 14:07:24 2015 -0500
4951: Incorporate review feedback. Always show the request button, along with the "sent" message if applicable. Include timestamp in sent message. Some text updates as well.
diff --git a/apps/workbench/app/assets/javascripts/application.js b/apps/workbench/app/assets/javascripts/application.js
index d80420b..63887b3 100644
--- a/apps/workbench/app/assets/javascripts/application.js
+++ b/apps/workbench/app/assets/javascripts/application.js
@@ -238,11 +238,3 @@ function hideLoadingModal() {
function hasHTML5History() {
return !!(window.history && window.history.pushState);
}
-
-function getLocalStorageValue(item) {
- return localStorage.getItem(item);
-}
-
-function clearLocalStorageValue(item) {
- localStorage.removeItem(item);
-}
diff --git a/apps/workbench/app/assets/javascripts/request_shell_access.js b/apps/workbench/app/assets/javascripts/request_shell_access.js
index 9378c6b..a40334b 100644
--- a/apps/workbench/app/assets/javascripts/request_shell_access.js
+++ b/apps/workbench/app/assets/javascripts/request_shell_access.js
@@ -1,8 +1,9 @@
$(document).ready(function(){
var $noShellAccessDiv = $('#no_shell_access');
if ($noShellAccessDiv.length) {
- if (getLocalStorageValue('request_shell_access') == 'sent') {
- $('div').remove('.no_shell_access_msg');
+ requestSent = localStorage.getItem('request_shell_access');
+ if (requestSent != null) {
+ $("#shell_access_requested_msg").html(requestSent)
} else {
$('div').remove('.shell_access_requested');
}
@@ -18,8 +19,13 @@ $(document).
$.ajax('/').
success(function(data, status, jqxhr) {
$('div').remove('.no_shell_access_msg');
- $('.no_shell_access').append('<div class="alert alert-success"><p class="contain-align-left">Request sent for shell access.</p></div>');
- localStorage.setItem("request_shell_access", "sent");
+ $('div').remove('.shell_access_requested');
+
+ $('.no_shell_access').append('<div class="alert alert-success"><p class="contain-align-left">A request for shell access was sent.</p></div>');
+ var timestamp = new Date();
+ localStorage.setItem("request_shell_access", "A request for shell access was sent on " +
+ timestamp.toLocaleDateString() +
+ " at " + timestamp.toLocaleTimeString());
}).
fail(function(jqxhr, status, error) {
var $sendButton = $('#request_shell_submit');
diff --git a/apps/workbench/app/views/users/_manage_virtual_machines.html.erb b/apps/workbench/app/views/users/_manage_virtual_machines.html.erb
index 5683316..1e7fb3b 100644
--- a/apps/workbench/app/views/users/_manage_virtual_machines.html.erb
+++ b/apps/workbench/app/views/users/_manage_virtual_machines.html.erb
@@ -7,23 +7,22 @@
<% if !@my_virtual_machines.any? %>
<div id='no_shell_access' class='no_shell_access'>
- <div id='shell_access_requested' class='shell_access_requested'>
- <div class="alert alert-info">
- <p class="contain-align-left">You do not have access to any virtual machines. A request was sent on your behalf.</p>
- </div>
- </div>
-
- <div id='no_shell_access_msg' class='no_shell_access_msg'>
- You do not have access to any virtual machines. Many of the Arvados features depend on having shell access to a hosted VM.
+ <div class='no_shell_access_msg'>
+ You do not have access to any virtual machines.
+ Some Arvados features require using the command line.
+ You may request access to a hosted virtual machine with the command line shell.
<div style='display:inline-block'>
- <%= button_to('Request shell access', request_shell_access_user_url(id: current_user.uuid),
+ <%= button_to('Send request for shell access', request_shell_access_user_url(id: current_user.uuid),
id: 'request_shell_submit', class: 'btn btn-xs btn-primary', remote: true) %>
</div>
+ </div><br/>
+ <div class='shell_access_requested alert alert-info'>
+ <p id='shell_access_requested_msg' class="contain-align-left">A request for shell access was sent eariler.</p>
</div>
</div>
<% else %>
- <script> clearLocalStorageValue('request_shell_access'); </script>
+ <script> localStorage.removeItem('request_shell_access'); </script>
<table class="table virtual-machines-table">
<colgroup>
<col style="width: 25%" />
diff --git a/apps/workbench/test/integration/user_manage_account_test.rb b/apps/workbench/test/integration/user_manage_account_test.rb
index af790f3..a84d424 100644
--- a/apps/workbench/test/integration/user_manage_account_test.rb
+++ b/apps/workbench/test/integration/user_manage_account_test.rb
@@ -137,8 +137,9 @@ class UserManageAccountTest < ActionDispatch::IntegrationTest
test "request shell access" do
visit page_with_token('spectator', '/manage_account')
assert_text 'You do not have access to any virtual machines'
- click_button 'Request shell access'
- assert_text 'Request sent for shell access'
+ click_button 'Send request for shell access'
+ assert_text 'A request for shell access was sent.'
+ assert_no_text 'You do not have access to any virtual machines.'
# revisit the page and verify that the Request button is no longer shown
within('.navbar-fixed-top') do
@@ -147,7 +148,7 @@ class UserManageAccountTest < ActionDispatch::IntegrationTest
find('a', text: 'Manage account').click
end
end
- assert_no_selector 'a', text: 'Request shell access'
- assert_text 'You do not have access to any virtual machines. A request was sent on your behalf.'
+ assert_text 'You do not have access to any virtual machines.'
+ assert_text 'A request for shell access was sent on '
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list