Skip to content

Commit

Permalink
Revert "[fixmystreet.com] User survey banner."
Browse files Browse the repository at this point in the history
This reverts commit e964fa8.
  • Loading branch information
dracos committed Nov 8, 2023
1 parent 2b3da40 commit bf43281
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 187 deletions.
1 change: 0 additions & 1 deletion perllib/FixMyStreet/App/Controller/Develop.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
38 changes: 0 additions & 38 deletions perllib/FixMyStreet/Cobrand/FixMyStreet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
4 changes: 0 additions & 4 deletions t/Mock/Tilma.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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}' ] ];
}
}

Expand Down
10 changes: 1 addition & 9 deletions t/app/controller/questionnaire.t
Original file line number Diff line number Diff line change
Expand Up @@ -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('[email protected]', name => 'Test User');
Expand All @@ -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',
Expand Down Expand Up @@ -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 } );
Expand Down
13 changes: 0 additions & 13 deletions templates/web/fixmystreet.com/next_steps.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
[% IF utm_content == 'questionnaire completed' %]
<div class="survey-cta">
<div class="survey-cta__content">
<p class="content__preheading">Can you spare 5 minutes for a survey about FixMyStreet?</p>
<h2 class="content__heading">We want to know more about who uses FixMyStreet and what you use it for to help us improve the service.</h2>
<a href="https://survey.alchemer.com/s3/6214003/FixMyStreet-User-Survey?[% c.cobrand.user_survey_information %]" class="btn btn--secondary">Complete the short survey</a>
</div>
<div class="survey-cta__img">
<img src="/cobrands/fixmystreet.com/images/survey-img-1.svg" alt="" width="300" height="300">
</div>
</div>
[% END %]

[%# A trio of suggested steps, shown on completion pages across FMS.com %]

[% DEFAULT share_url = c.cobrand.base_url %]
Expand Down
30 changes: 0 additions & 30 deletions web/cobrands/fixmystreet.com/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
79 changes: 0 additions & 79 deletions web/cobrands/fixmystreet.com/images/survey-img-1.svg

This file was deleted.

13 changes: 0 additions & 13 deletions web/cobrands/fixmystreet.com/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf43281

Please sign in to comment.