Skip to content

Commit

Permalink
Merge branch '2340-update-flow-issue'
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Dec 8, 2018
2 parents 50ab5b1 + 42d7d8a commit afdd274
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 95 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
2 changes: 2 additions & 0 deletions templates/web/base/report/update/form_update.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
</div>
[% END %]

[% TRY %][% PROCESS 'report/update/before_update.html' %][% CATCH file %][% END %]

<label for="form_update">[% loc( 'Update' ) %]</label>
[% IF c.user AND (c.user.is_superuser OR c.user.belongs_to_body(problem.bodies_str)) %]
[% INCLUDE 'admin/response_templates_select.html' for='form_update' %]
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" type='update' %]
[% 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 -->
30 changes: 0 additions & 30 deletions templates/web/bromley/report/update-form.html

This file was deleted.

9 changes: 9 additions & 0 deletions templates/web/bromley/report/update/before_update.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="general-notes">
<p>Please note that new and separate occurrences of issues
should be logged as new reports, to avoid conflicting
information or updates and ensure the information is passed
promptly to our teams. Please log any new issue via
<a href="https://www.bromley.gov.uk/report">https://www.bromley.gov.uk/report</a>
using the map marker and description to detail where the issue
is located.</p>
</div>
53 changes: 0 additions & 53 deletions templates/web/bromley/report/update/form_update.html

This file was deleted.

22 changes: 22 additions & 0 deletions templates/web/bromley/report/update/form_user.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- report/update/form_user.html -->
[% PROCESS 'report/form/user.html' %]

<div class="hidden-js js-new-report-user-shown">
<div class="hidden-nojs form-section-preview">
<h2 class="form-section-heading">[% loc('Your update') %]</h2>
<p class="js-form-section-preview" data-source="#form_update"></p>
<button class="btn btn--block js-new-report-user-hide">[% loc('Edit your update') %]</button>
</div>

[% IF c.user_exists %]
[% PROCESS "report/update/form_user_loggedin.html" %]
[% ELSE %]
[% PROCESS "report/form/user_loggedout.html" type='update' object=update %]
[% END %]

</div>

[%# Same as parent apart from this line %]
<p>Your information will only be used in accordance with our <a href="/faq#privacy">privacy policy</a>.</p>

<!-- /report/update/form_user.html -->
Empty file.

0 comments on commit afdd274

Please sign in to comment.