Skip to content

Commit

Permalink
fixup! [Surrey] Continue button should not be visible when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
MorayMySoc committed Nov 27, 2024
1 parent ee83be9 commit 7263e2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .cypress/cypress/integration/surrey.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ describe('Reporting not on a road', function() {
cy.pickCategory('Abandoned vehicles');
cy.contains('You cannot send Surrey County Council a report');
cy.get('#map_sidebar').scrollTo('bottom');
cy.get('.js-reporting-page--next:hidden').should('be.disabled');
cy.get('.js-reporting-page--next').should('be.disabled');
cy.get('.js-reporting-page--next').should('not.be.visible');
cy.pickCategory('Flooding inside a building');
cy.contains('You cannot send Surrey County Council a report').should('not.be.visible');
cy.get('#map_sidebar').scrollTo('bottom');
cy.get('.js-reporting-page--next:visible').should('not.be.disabled');
cy.get('.js-reporting-page--next').should('be.visible');
});
});

Expand Down
11 changes: 9 additions & 2 deletions web/cobrands/fixmystreet/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ fixmystreet.message_controller = (function() {
if ( $('#js-roads-responsibility').is(':visible') || $('.js-mobile-not-an-asset').length ) {
return;
}
if (fixmystreet.cobrand === 'surrey') {
if (hide_continue_button()) {
$('.js-reporting-page--next').show();
}
$('.js-reporting-page--next').prop('disabled', false);
Expand All @@ -1549,12 +1549,19 @@ fixmystreet.message_controller = (function() {
$("#mob_ok, #toggle-fullscreen").addClass('hidden-js');
} else {
$('.js-reporting-page--next').prop('disabled', true);
if (fixmystreet.cobrand === 'surrey') {
if (hide_continue_button()) {
$('.js-reporting-page--next').hide();
}
}
}

function hide_continue_button() {
var cobrands_to_hide = ['surrey', 'hart'];
if (cobrands_to_hide.indexOf(fixmystreet.cobrand) !== -1) {
return 1;
}
}

// This hides the responsibility message, and (unless a
// stopper message or dupes are shown) reenables the report form
function responsibility_off(layer, type) {
Expand Down

0 comments on commit 7263e2c

Please sign in to comment.