Skip to content

Commit

Permalink
Show email form after logging in as leaving update
Browse files Browse the repository at this point in the history
With the recent login changes, the user form was being hidden after
logging in while leaving an update, meaning you had to click "Continue"
to see the thing it was asking you to check. Refactor the update flow
slightly in this area to be more like reporting, showing the relevant
bit of the user form immediately (and thus also not having it within a
hidden section).
  • Loading branch information
dracos committed Dec 6, 2018
1 parent fda50e0 commit ea41398
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
1 change: 0 additions & 1 deletion .cypress/cypress/integration/simple_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ describe('Leaving updates', function() {
cy.get('[name=password_sign_in]:last').type('password');
cy.get('[name=password_sign_in]:last').parents('form:first').submit();
cy.get('#map_sidebar').should('contain', 'check and confirm your details');
cy.get('.js-new-report-user-show').click(); // Should not have to do this, #2340
cy.get('[name=submit_register]').parents('form').submit();
cy.get('body').should('contain', 'Thank you for updating this issue');
}
Expand Down
16 changes: 10 additions & 6 deletions templates/web/base/report/update-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@
<form method="post" action="[% c.uri_for( '/report/update' ) %]" id="form_update_form" name="updateForm" class="validate"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %]>
<input type="hidden" name="token" value="[% csrf_token %]">
<fieldset>
[% IF NOT login_success AND NOT oauth_need_email %]
<div class="js-new-report-user-hidden">
[% INCLUDE 'report/update/form_update.html' %]
[% IF login_success %]
[% PROCESS "report/update/form_user_loggedin.html" %]
[% INCLUDE 'report/update/form_update.html' %]
[% ELSIF oauth_need_email %]
<div id="form_sign_in">
[% PROCESS "report/form/user_loggedout_by_email.html" object=update type='update' valid_class='validNameU' email_required=1 %]
<input type="hidden" name="oauth_need_email" value="1">
</div>
[% END %]
[% PROCESS "report/update/form_user.html" %]
[% IF login_success OR oauth_need_email %]
[% INCLUDE 'report/update/form_update.html' %]
[% ELSE %]
<div class="js-new-report-user-hidden">
[% INCLUDE 'report/update/form_update.html' %]
</div>
[% PROCESS "report/update/form_user.html" %]
[% END %]
</fieldset>
</form>
Expand Down
7 changes: 2 additions & 5 deletions templates/web/base/report/update/form_user.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- report/update/form_user.html -->
[% PROCESS 'report/form/user.html' %]

<div class="hidden-js js-new-report-user-shown">
Expand All @@ -9,13 +10,9 @@ <h2 class="form-section-heading">[% loc('Your update') %]</h2>

[% IF c.user_exists %]
[% PROCESS "report/update/form_user_loggedin.html" %]
[% ELSIF oauth_need_email %]
<div id="form_sign_in">
[% PROCESS 'report/form/user_loggedout_by_email.html' object=update type='update' valid_class='validNameU' email_required=1 %]
<input type="hidden" name="oauth_need_email" value="1">
</div>
[% ELSE %]
[% PROCESS "report/form/user_loggedout.html" type='update' object=update %]
[% END %]

</div>
<!-- /report/update/form_user.html -->

0 comments on commit ea41398

Please sign in to comment.