Skip to content
Snippets Groups Projects
Commit 94907cc4 authored by Ali-D-Akbar's avatar Ali-D-Akbar
Browse files

Unauthenticated Contact Us improvements

fix password reset page, add another test and remove typo

improve js test

add quality changes

add quality changes
parent 6a78c30a
No related branches found
No related tags found
No related merge requests found
......@@ -18,26 +18,19 @@ function LoggedOutUser({ platformName, loginQuery, supportEmail }) {
</div>
<div className="row">
<div className="col-sm-12">
<div className="col-sm-6">
<a href={`/login${loginQuery}`} className="btn btn-primary btn-signin">{gettext('Sign in')}</a>
</div>
<div className="col-sm-6">
<a className="btn btn-secondary" href={`/register${loginQuery}`}>
{gettext('Create an Account')}
</a>
</div>
</div>
<div className="row">
<div className="col-sm-12">
<a className="create-account" href={`/register${loginQuery}`}>
{StringUtils.interpolate(
// FIXME: not all platforms start with a vowel
gettext('Create an {platform} account'),
{ platform: platformName },
)}
</a>
<p className="create-account-note">
{StringUtils.interpolate(
gettext('If you are unable to access your account contact us via email using {email}.'),
{ email: supportEmail },
)}
</p>
<a href="/password_assistance" type="button" class="forgot-password field-link">{gettext('Need help logging in?')}</a>
</div>
</div>
</div>
......
......@@ -65,6 +65,22 @@ class SupportViewManageUserTests(SupportViewTestCase):
super(SupportViewManageUserTests, self).setUp()
SupportStaffRole().add_users(self.user)
def test_get_contact_us(self):
"""
Tests Support View contact us Page
"""
url = reverse('support:contact_us')
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
def test_get_password_assistance(self):
"""
Tests password assistance
"""
url = '/password_assistance'
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
def test_get_support_form(self):
"""
Tests Support View to return Manage User Form
......
......@@ -179,8 +179,8 @@
// Simulate a click on the reset password link
view.resetPassword();
// Verify that the login-anchor is hidden
expect($('#login-anchor')).toHaveClass('hidden');
// Verify that the login-form is hidden
expect($('#login-form')).toHaveClass('hidden');
// Verify that the password reset form is not hidden
expect($('#password-reset-form')).not.toHaveClass('hidden');
......
......@@ -128,7 +128,12 @@
},
loadForm: function(type) {
var loadFunc = _.bind(this.load[type], this);
var loadFunc;
if (type === 'reset') {
loadFunc = _.bind(this.load.login, this);
loadFunc(this.formDescriptions.login);
}
loadFunc = _.bind(this.load[type], this);
loadFunc(this.formDescriptions[type]);
},
......@@ -225,7 +230,7 @@
},
passwordEmailSent: function() {
var $loginAnchorElement = $('#login-anchor');
var $loginAnchorElement = $('#login-form');
this.element.hide($(this.el).find('#password-reset-anchor'));
this.element.show($loginAnchorElement);
this.element.scrollTop($loginAnchorElement);
......@@ -236,7 +241,7 @@
category: 'user-engagement'
});
this.element.hide($(this.el).find('#login-anchor'));
this.element.hide($(this.el).find('#login-form'));
this.loadForm('reset');
this.element.scrollTop($('#password-reset-anchor'));
},
......
......@@ -241,7 +241,7 @@
font-weight: $font-regular;
}
.help-button {
.help-button, .btn-secondary {
margin-bottom: $baseline;
height: $baseline * 2;
font-weight: $font-regular;
......
......@@ -7,7 +7,7 @@
</section>
<section id="password-reset-anchor" class="form-type">
<div id="password-reset-form" class="form-wrapper hidden"></div>
<div id="password-reset-form" class="form-wrapper <% if ( mode !== 'reset' ) { %>hidden<% } %>"></div>
</section>
<section id="institution_login-anchor" class="form-type">
......
......@@ -20,4 +20,6 @@ urlpatterns += [
{'initial_mode': 'login'}, name='signin_user'),
url(r'^register$', login_form.login_and_registration_form,
{'initial_mode': 'register'}, name='register_user'),
url(r'^password_assistance', login_form.login_and_registration_form,
{'initial_mode': 'reset'}, name='password_assistance'),
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment