-
-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Brent] [Waste] Initial small items setup. #4595
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4595 +/- ##
===========================================
- Coverage 84.93% 69.25% -15.68%
===========================================
Files 336 42 -294
Lines 23778 4951 -18827
Branches 4491 0 -4491
===========================================
- Hits 20196 3429 -16767
+ Misses 2235 1522 -713
+ Partials 1347 0 -1347 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! One comment but doesn't necessarily needs actioning.
@@ -82,7 +82,8 @@ Display a report. | |||
sub display :PathPart('') :Chained('id') :Args(0) { | |||
my ( $self, $c ) = @_; | |||
|
|||
if ($c->stash->{problem}->cobrand_data eq 'waste' && $c->stash->{problem}->category eq 'Bulky collection' ) { | |||
my $problem = $c->stash->{problem}; | |||
if ($problem->cobrand_data eq 'waste' && ($problem->category eq 'Bulky collection' || $problem->category eq 'Small items collection')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of me thinks we should have a $problem->is_bulky
method or similar, but not sure if that's a bit premature, seeing as this check is only done in two places currently.
ee4e2ac
to
92106b3
Compare
e4e1738
to
f1ce1ae
Compare
8522ff9
to
11e15b2
Compare
f1ce1ae
to
bd4f69c
Compare
683a6da
to
fade136
Compare
ab825c8
to
405ba4c
Compare
On page load after clicking back, the form values can be filled in with their previous values by the browser, but this happens later, so switch to the pageshow event to update the autocomplete/messages and check the hidden select - as the autocomplete will have picked up an empty select at the time it was created.
This is so if the page being loaded isn't a bin days one, the heading gets replaced as well.
490166c
to
ad474f9
Compare
Uses the bulky waste controllers and configuration, but renamed to small items with a similar form. Includes various text tweaks requested and no per-item photos. Item list sorted by ID, not name, so we can specify the ordering the admin. Direct picture upload needed as reports are private.
Adds count of how many small electrical items have been selected and how many different 'types' of item have been selected. Add error if more than 4 small electrical or more than 3 types. Added text to clarify the limits allowed.
Changes templates to adapt for Brent and to add small items in relevant places instead of bulky waste.
ad474f9
to
95ce157
Compare
Provides an initial small items form, pretty much identical to bulky apart from wording and other small differences (e.g. sort order, photos). Uses the same controller/role/flags as Brent is having small items instead of bulky, and given timescales seemed quite a bit more straightforward than trying to allow both.
Takes a little bit of @MorayMySoc code for saving the items in the report metadata (though only if set), and little bit of @nephila-nacrea code for calling the clear cached slot.
[skip changelog]