[ARVADOS] updated: 2.1.0-794-gc10061b6d
Git user
git at public.arvados.org
Fri May 14 20:20:43 UTC 2021
Summary of changes:
apps/workbench/app/views/users/welcome.html.erb | 36 ++++++++++++++-----------
1 file changed, 20 insertions(+), 16 deletions(-)
via c10061b6de6b85e7c445723a0f32a717ee76fe85 (commit)
from 44d2d5e6d2b509551e37c7f748d8f79fcdf177f3 (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 c10061b6de6b85e7c445723a0f32a717ee76fe85
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Fri May 14 16:19:39 2021 -0400
17499: Rewrite javascript to pass phantomJS tests
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/apps/workbench/app/views/users/welcome.html.erb b/apps/workbench/app/views/users/welcome.html.erb
index 2842cd884..8d3e42e4e 100644
--- a/apps/workbench/app/views/users/welcome.html.erb
+++ b/apps/workbench/app/views/users/welcome.html.erb
@@ -5,10 +5,10 @@ SPDX-License-Identifier: AGPL-3.0 %>
<% content_for :breadcrumbs do raw '<!-- -->' end %>
<%= javascript_tag do %>
- async function controller_password_authenticate(event) {
+ function controller_password_authenticate(event) {
event.preventDefault()
document.getElementById('login-authenticate-error').innerHTML = '';
- const resp = await fetch('<%= "#{Rails.configuration.Services.Controller.ExternalURL}" %>arvados/v1/users/authenticate', {
+ fetch('<%= "#{Rails.configuration.Services.Controller.ExternalURL}" %>arvados/v1/users/authenticate', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
@@ -16,20 +16,24 @@ SPDX-License-Identifier: AGPL-3.0 %>
username: document.getElementById('login-username').value,
password: document.getElementById('login-password').value,
}),
- })
- if (!resp.ok) {
- const respj = await resp.json()
- document.getElementById('login-authenticate-error').innerHTML = `<p>${respj.errors[0]}</p>`;
- return
- }
- var redir = document.getElementById('login-return-to').value
- if (redir.indexOf('?') > 0) {
- redir += '&'
- } else {
- redir += '?'
- }
- const respj = await resp.json()
- document.location = redir + "api_token=v2/" + respj.uuid + "/" + respj.api_token
+ }).then(function(resp) {
+ if (!resp.ok) {
+ resp.json().then(function(respj) {
+ document.getElementById('login-authenticate-error').innerHTML = `<p>${respj.errors[0]}</p>`;
+ });
+ return;
+ }
+
+ var redir = document.getElementById('login-return-to').value
+ if (redir.indexOf('?') > 0) {
+ redir += '&'
+ } else {
+ redir += '?'
+ }
+ resp.json().then(function(respj) {
+ document.location = redir + "api_token=v2/" + respj.uuid + "/" + respj.api_token;
+ });
+ });
}
function clear_authenticate_error() {
document.getElementById('login-authenticate-error').innerHTML = "";
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list