From bf43281acf48d03ac852f947900926bf01a97596 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 8 Nov 2023 12:09:20 +0000 Subject: [PATCH] Revert "[fixmystreet.com] User survey banner." This reverts commit e964fa824eb289d05e2f9717ff48f1bcd50de765. --- perllib/FixMyStreet/App/Controller/Develop.pm | 1 - perllib/FixMyStreet/Cobrand/FixMyStreet.pm | 38 --------- t/Mock/Tilma.pm | 4 - t/app/controller/questionnaire.t | 10 +-- templates/web/fixmystreet.com/next_steps.html | 13 --- web/cobrands/fixmystreet.com/base.scss | 30 ------- .../fixmystreet.com/images/survey-img-1.svg | 79 ------------------- web/cobrands/fixmystreet.com/layout.scss | 13 --- 8 files changed, 1 insertion(+), 187 deletions(-) delete mode 100644 web/cobrands/fixmystreet.com/images/survey-img-1.svg diff --git a/perllib/FixMyStreet/App/Controller/Develop.pm b/perllib/FixMyStreet/App/Controller/Develop.pm index a67b2153a2d..dd9ffe83bff 100755 --- a/perllib/FixMyStreet/App/Controller/Develop.pm +++ b/perllib/FixMyStreet/App/Controller/Develop.pm @@ -258,7 +258,6 @@ the supplied ?new_state and ?been_fixed query params. sub questionnaire_completed_previewer : Path('/_dev/questionnaire_completed') : Args(0) { my ( $self, $c ) = @_; - $c->stash->{questionnaire} = $c->model('DB::Questionnaire')->search(undef, { rows => 1 } )->first; $c->stash->{been_fixed} = $c->get_param('been_fixed'); $c->stash->{new_state} = $c->get_param('new_state'); $c->stash->{template} = 'questionnaire/completed.html'; diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm index 6d9ef0c59e8..49e3e255fbc 100644 --- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm +++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm @@ -2,9 +2,6 @@ package FixMyStreet::Cobrand::FixMyStreet; use base 'FixMyStreet::Cobrand::UK'; use Moo; -use LWP::Simple; -use JSON::MaybeXS; -use Try::Tiny; with 'FixMyStreet::Roles::BoroughEmails'; use constant COUNCIL_ID_BROMLEY => 2482; @@ -598,39 +595,4 @@ sub add_extra_area_types { return \@types; } -sub user_survey_information { - my $self = shift; - my $c = $self->{c}; - - my $q = $c->stash->{questionnaire}; - my $p = $q->problem; - - my $count = FixMyStreet::DB->resultset("Problem")->search({ user_id => $p->user_id })->count; - my $by_user = do { - if ($count > 100) { '101+' } - elsif ($count > 50) { '51-100' } - elsif ($count > 20) { '21-50' } - elsif ($count > 10) { '11-20' } - elsif ($count > 5) { '6-10' } - elsif ($count > 1) { '2-5' } - else { '1' } - }; - - my $imd = get('https://tilma.mysociety.org/lsoa_to_decile.php?lat=' . $p->latitude . '&lon=' . $p->longitude); - $imd = try { - decode_json($imd); - }; - - my $uri = URI->new; - $uri->query_form( - ever_reported => $q->ever_reported, - been_fixed => $c->stash->{been_fixed}, - category => $p->category, - num_reports_by_user => $by_user, - imd_decile => $imd->{UK_IMD_E_pop_decile}, - cobrand => $p->cobrand, - ); - return $uri->query; -} - 1; diff --git a/t/Mock/Tilma.pm b/t/Mock/Tilma.pm index 00059795310..06d6d2fea45 100644 --- a/t/Mock/Tilma.pm +++ b/t/Mock/Tilma.pm @@ -170,10 +170,6 @@ sub dispatch_request { } else { return [ 200, [ 'Content-Type' => 'application/xml' ], [ $thamesmead_asset_not_found ] ]; } - }, - - sub (GET + /lsoa_to_decile.php + ?*) { - return [ 200, [ 'Content-Type' => 'application/json' ], [ '{"UK_IMD_E_pop_decile": 6}' ] ]; } } diff --git a/t/app/controller/questionnaire.t b/t/app/controller/questionnaire.t index 2a8e8c5af4e..5925072883c 100644 --- a/t/app/controller/questionnaire.t +++ b/t/app/controller/questionnaire.t @@ -2,10 +2,6 @@ use DateTime; use FixMyStreet::TestMech; -use t::Mock::Tilma; -my $tilma = t::Mock::Tilma->new; -LWP::Protocol::PSGI->register($tilma->to_psgi_app, host => 'tilma.mysociety.org'); - ok( my $mech = FixMyStreet::TestMech->new, 'Created mech object' ); my $user = $mech->create_user_ok('test@example.com', name => 'Test User'); @@ -32,7 +28,7 @@ my $report = FixMyStreet::DB->resultset('Problem')->find_or_create( whensent => $sent_time, lang => 'en-gb', service => '', - cobrand => 'fixmystreet', + cobrand => '', cobrand_data => '', send_questionnaire => 1, latitude => '55.951963', @@ -470,10 +466,6 @@ FixMyStreet::override_config { $mech->content_contains( 'Has this problem been fixed?' ); $mech->content_lacks( 'ever reported' ); - $mech->submit_form_ok({ with_fields => { been_fixed => 'Unknown', another => 'No' } }); - $mech->content_contains('Can you spare 5 minutes for a survey about FixMyStreet?'); - $mech->content_contains('ever_reported=&been_fixed=Unknown&category=Street+lighting&num_reports_by_user=1&imd_decile=6&cobrand=fixmystreet'); - $token = FixMyStreet::DB->resultset("Token")->find( { scope => 'questionnaire', token => $token } ); ok $token, 'found token for questionnaire'; $questionnaire = FixMyStreet::DB->resultset('Questionnaire')->find( { id => $token->data } ); diff --git a/templates/web/fixmystreet.com/next_steps.html b/templates/web/fixmystreet.com/next_steps.html index e5e80bd7dd8..e561b9d9818 100644 --- a/templates/web/fixmystreet.com/next_steps.html +++ b/templates/web/fixmystreet.com/next_steps.html @@ -1,16 +1,3 @@ -[% IF utm_content == 'questionnaire completed' %] -
-
-

Can you spare 5 minutes for a survey about FixMyStreet?

-

We want to know more about who uses FixMyStreet and what you use it for to help us improve the service.

- Complete the short survey -
-
- -
-
-[% END %] - [%# A trio of suggested steps, shown on completion pages across FMS.com %] [% DEFAULT share_url = c.cobrand.base_url %] diff --git a/web/cobrands/fixmystreet.com/base.scss b/web/cobrands/fixmystreet.com/base.scss index 39c07674a7c..1434f2de95b 100644 --- a/web/cobrands/fixmystreet.com/base.scss +++ b/web/cobrands/fixmystreet.com/base.scss @@ -89,36 +89,6 @@ body.frontpage { color: $primary_text; } -.survey-cta { - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: left; - gap: 15px; - padding: 1.8em; - margin: 0 -1em; - background: $primary; - - .survey-cta__content { - max-width: 550px; - - .content__preheading { - margin-bottom: 10px; - color: #555555; // Instead of #666666 that won't pass the contrast test against yellow background - font-weight: bold; - } - - .content__heading { - margin-top: 0; - font-weight: bold; - } - } - - .survey-cta__img { - max-width: 175px; - } -} - .next-steps { margin: 0 -1em; // counteract padding on parent background-color: #faf7e2; diff --git a/web/cobrands/fixmystreet.com/images/survey-img-1.svg b/web/cobrands/fixmystreet.com/images/survey-img-1.svg deleted file mode 100644 index 9d0b38c4ae1..00000000000 --- a/web/cobrands/fixmystreet.com/images/survey-img-1.svg +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/web/cobrands/fixmystreet.com/layout.scss b/web/cobrands/fixmystreet.com/layout.scss index efdfa5ae5fd..3484c15c892 100644 --- a/web/cobrands/fixmystreet.com/layout.scss +++ b/web/cobrands/fixmystreet.com/layout.scss @@ -225,19 +225,6 @@ body.frontpage { } } -.survey-cta { - padding: 2.5em 1.8em; // More vertical spacing on bigger screens - - .survey-cta__content { - flex-basis: 55%; - } - - .survey-cta__img { - max-width: none; - flex-basis: 40%; - } -} - .next-steps { @include flex-container(); margin-bottom: 2em; // add some space between this and the footer