Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hides the Sign in-button on 401 page #4101

Merged
merged 5 commits into from
May 27, 2016

Conversation

sallakarppinen
Copy link
Contributor

@sallakarppinen sallakarppinen commented May 3, 2016

Fixes issue #4092. As a sidenote, I tried to open this using git pull-request -i 4092 -b oaeproject/3akai-ux:master -h sallakarppinen/3akai-ux:issue-4092 -m 'Hides the Sign in-button on 401 page' but it failed to link to the issue automatically (I've aliased hub as git).

@@ -237,7 +237,7 @@ define(['exports', 'jquery', 'oae.api.config', 'oae.api.i18n', 'oae.api.user', '

// Use the `auth.html` `authExternalButton` macro to create a form that performs this
// authentication
var $template = $('<div class="hide">${authExternalButton(strategy, opts)}</div>');
var $template = $('<div><!--${authExternalButton(strategy, opts)}--></div>');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My preference would be to do something along the following lines:

var $template = $('<div><!--' +
                             '  <div class="hide">' +
                             '    ${authExternalButton(strategy, opts)}' +
                             '  </div>' +
                             '--></div>');

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can then remove the addClass and it'll make it easier to make changes to this template further down the line

@nicolaasmatthijs
Copy link
Contributor

Finished review. Back to @sallakarppinen for follow-up

@@ -249,7 +249,7 @@ define(['exports', 'jquery', 'oae.api.config', 'oae.api.i18n', 'oae.api.user', '
});

// Submit the form
$($.trim(form)).appendTo('body').submit();
$($.trim(form)).addClass("hide").appendTo('body').submit();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm that triggering a submit on a hidden element isn't blocked by browsers?

@sallakarppinen
Copy link
Contributor Author

Updated. .submit() was not working on Chrome/Chromium but submitting via .click() seems to work fine.

@@ -237,7 +237,11 @@ define(['exports', 'jquery', 'oae.api.config', 'oae.api.i18n', 'oae.api.user', '

// Use the `auth.html` `authExternalButton` macro to create a form that performs this
// authentication
var $template = $('<div class="hide">${authExternalButton(strategy, opts)}</div>');
var $template = $('<div><!--'
+ '<div class="hide">'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can give this div an id so we can use that to limit the scope of the $('.btn-external-auth') selector below.

@nicolaasmatthijs
Copy link
Contributor

Left a comment. Back to @sallakarppinen

@sallakarppinen
Copy link
Contributor Author

Added id to the wrapper div.

@nicolaasmatthijs nicolaasmatthijs merged commit b78760b into oaeproject:master May 27, 2016
@nicolaasmatthijs
Copy link
Contributor

Looks good. Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants