Skip to content

Commit

Permalink
WIP [Bexley][WW] Add generic order link for deprecated boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
nephila-nacrea committed Nov 11, 2024
1 parent f97703d commit 0c1c290
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion perllib/FixMyStreet/Cobrand/Bexley/Waste.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,7 @@ sub construct_bin_request_form {

$page_list = [
request => {
intro => 'container_delivery_intro.html',
fields => [ grep { ! ref $_ } @$delivery_field_list, 'continue' ],

Check warning on line 1307 in perllib/FixMyStreet/Cobrand/Bexley/Waste.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Bexley/Waste.pm#L1307

Added line #L1307 was not covered by tests
title => 'Which containers do you need?',
check_unique_id => 0,
Expand Down Expand Up @@ -1726,7 +1727,7 @@ sub _set_request_containers {
push @containers_for_delivery,
_containers_for_requests()->{'Recycling Box Lids'};

$property->{can_order_lids} = 1;
$property->{has_boxes} = 1;

Check warning on line 1730 in perllib/FixMyStreet/Cobrand/Bexley/Waste.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Bexley/Waste.pm#L1730

Added line #L1730 was not covered by tests
}

$boxes_done = 1;
Expand Down
2 changes: 1 addition & 1 deletion t/app/controller/waste_bexley_container_requests.t
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ subtest '_set_request_containers' => sub {
note 'Checking containers set on property';
cmp_deeply $property, {
household_size_check => 1,
can_order_lids => 1,
has_boxes => 1,

containers_for_delivery => [
{ name => 'Green Wheelie Bin',
Expand Down
2 changes: 1 addition & 1 deletion templates/web/bexley/waste/_more_services_sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h3>More services</h3>
[% IF property.containers_for_removal.size %]
<li><a [% external_new_tab | safe %] href="[% c.uri_for_action('waste/request', [ property.id ]) %]?request_type=removal">Order removal of old containers</a></li>
[% END %]
[% IF property.can_order_lids %]
[% IF property.has_boxes %]
<li><a [% external_new_tab | safe %] href="[% c.uri_for_action('waste/request', [ property.id ]) %]?request_type=delivery">Order lids for recycling boxes</a></li>
[% END %]
[% END %]
Expand Down
5 changes: 3 additions & 2 deletions templates/web/bexley/waste/_services_request.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[% IF unit.delivery_allowed && !unit.delivery_open %]
[% SET is_box = unit.service_name.match('Box$') %]
[% IF ( unit.delivery_allowed || is_box ) && !unit.delivery_open %]
<form method="post" action="[% c.uri_for_action('waste/request', [ property.id ]) %]?request_type=delivery" id="form-[% unit.service_id %]-delivery">

<input type="hidden" name="token" value="[% csrf_token %]">
Expand All @@ -10,7 +11,7 @@
<input type="hidden" name="parent-[% unit.parent_name.replace(' ','-') %]" value="1">
[% END %]

<input type="submit" value="Request a new or replacement [% unit.service_name FILTER lower %]" class="waste-service-descriptor waste-service-link">
<input type="submit" value="Request a new or replacement [% IF unit.delivery_allowed %][% unit.service_name FILTER lower %][% ELSE %]recycling box[% END %]" class="waste-service-descriptor waste-service-link">
</form>
[% END %]

Expand Down
3 changes: 3 additions & 0 deletions templates/web/bexley/waste/container_delivery_intro.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[% IF property.has_boxes %]
<p>Certain recycling boxes are being phased out and can no longer be ordered. Please use the box options below.</p>
[% END %]

0 comments on commit 0c1c290

Please sign in to comment.