aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand/zurich.t
Commit message (Collapse)AuthorAgeLines
* Use sender in From if From and To domains match.Matthew Somerville2017-03-14-4/+4
| | | | | | To deal with a recipient mail server not allowing inbound email using the same domain as an internal domain, e.g. https://community.mimecast.com/docs/DOC-1419
* Move staging flags to their own config variable.Matthew Somerville2017-01-10-2/+2
|
* [Zurich] Fix 500 error when editing superusersDave Arter2016-12-06-1/+14
| | | | | | | | | | | | The Zurich::admin_type function was setting $c->stash->{body}, meaning that when trying to edit a superuser the 'fetch_contacts' function wasn't being called, causing an "Can't call method "all" on an undefined value" error as $c->stash->{live_contacts} wasn't ever being set. Fixed by changing the conditional to simply determine whether fetch_contacts needs to be called. Included a regression test that meant a small addition to the MapItZurich mock.
* Error if logged-in user visits admin without permission.Matthew Somerville2016-10-26-4/+4
| | | | | This is less confusing than redirecting to /auth and then to /my (as they're logged in). Fixes #1566.
* Add .btn and .form-control classes to inputsZarino Zappia2016-10-04-1/+1
|
* Factor out contains_or_lacks test function.Matthew Somerville2016-09-29-13/+2
|
* [Zurich] Add areas in test reports to fix warning.Matthew Somerville2016-08-09-0/+3
|
* [Zurich] Send admin emails from the do-not-reply addressDave Arter2016-07-28-1/+1
| | | | | Also takes the opportunity to fix the incorrectly-encoded sender name which was appearing to some clients as "Züri Wie Neu".
* Restrict add/editing of bodies in admin to superusersDave Arter2016-07-19-1/+1
|
* Improve CSRF tokens and add to more forms.Matthew Somerville2016-06-20-8/+3
|
* Refactor email handling to use Email::MIME alone.Matthew Somerville2016-03-30-1/+6
|
* Allow zurich tests to run without network.Matthew Somerville2016-03-23-11/+15
|
* Updates to cpanfile and code for perl 5.20/5.22.Matthew Somerville2016-03-23-3/+15
| | | | | | | | | | | | | | | | | | | | The following modules had bugs that have been fixed for working in recent perls: * List::MoreUtils * Guard * PadWalker * aliased * URI * Convert::NLS_DATE_FORMAT The CGI module was removed from core in 5.20, so include it in the snapshot (I don't think it's actually used, but is a dependency). "{" needs to be escaped in regular expressions, and ~~ should not be used. Fix some tests that expect e.g. a certain hash ordering, to use sorted output or better comparisons.
* Switch final few JSON uses to JSON::MaybeXS.Matthew Somerville2016-02-09-1/+0
|
* Reduce use of FixMyStreet::App.Matthew Somerville2015-12-02-7/+4
| | | | Command line scripts don't need a full blown app, just database.
* [Zurich] Set report's public response before sending email to userDave Arter2015-10-06-2/+36
| | | | | | | | The 'public response' to a problem was being omitted from the email sent to the user when the problem is closed, because the email was sent before the report's 'extra' field was updated with the response body text. This commit sets the public response on the problem before sending the email.
* [Zurich] Test that external message is visible for certain statesDave Arter2015-10-06-6/+6
|
* [Zurich] Override MAP_TYPE in tests where appropriateDave Arter2015-10-06-0/+20
|
* [Zurich] Tweaks to redirectHakim Cassimally2015-10-06-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See mysociety/FixMyStreet-Commercial#690 I understand redirection to summary page was introduced at ZWN's request, to make it easy to process reports and then quickly move onto the next one. However, during testing now, Tobias has mentioned this is a) slowing things down and b) confusing because it's not obvious that the report has been saved. I've tried to address (b) by adding the "Aktualisiert!" message when you are redirected. Also, for (a) I've removed the redirection from a few cases, and disabled it for superuser. If need be, I can remove redirection from more (or all) cases. Fix Official answer/Reply to user - hide label for status update on state change - correct wording on button for closure (single wording) - correct wording on label for user reply (either "Official answer" or "Reply to user" as appropriate) - Make sure the official response texts are shown for edit/static as appropriate, and test. - javascript improvements - honour public status update for Extern/Wunsch too - don't show public message for Wunsch - Ignore all other fields when rotating photos. (See mysociety/FixMyStreet-Commercial#718)
* [Zurich] additional closure statuses workHakim Cassimally2015-10-06-96/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requirements: ============= 1: DM to be able to mark a problem as Wish, Extern, Not contactable, Hidden, Jurisdiction unknown 2: SDM to be able to mark a problem as Not contactable. 3: DM to be able to add information to such a problem, and trigger emails to external agencies, and to user, closing the problem at the same time. 4: Closed reports must be categorized as Wish/Extern/NC/Hidden/JU for statistical reporting 5: Non-closed reports must appear as open, to allow DM to see them in the list, similar to what is currently done for Ruckmeldung Ausstehend (Feedback outstanding). 5b: however "Hidden" problems must be immediately hidden from public view. Proposal: ========= a) Requirement 1 will be carried out in exactly the same way by DM. e.g. Category dropdown select b) Requirement 2 will be carried out in exactly the same way by SDM. e.g. "Not contactable" button c) BUT, for a), c), the category will be diverted to "Ruckmeldung Ausstehend" (Feedback outstanding), and metadata will be saved with the appropriate closure type. d) NOTE: this means the report will still be visible to public as "In bearbeitung" (Except for Hidden reports, as per 5b) e) The extra fields will be presented on the "Ruckmeldung Ausstehend" page, just as defined in the PDF, depending on the metadata. e.g. - Wish: Zustaendige Stelle + Message - Extern: External body + Message2 - Not contactable: (no extra info) - Hidden: (no extra info) - Jurisdiction unknown: (no extra info) f) When the DM publishes the answer (e.g. "Antwort Veroeffentlichen" button), the state will normally change to Fixed. BUT in the new cases, the metadata saved in step c) will be checked, and the report will change state to Wish/Extern/Not contactable/Hidden/Jurisdiction unknown, as appropriate. The report will now be visible/hidden as previously discussed depending on the new state. g) If the report is edited again (in /admin/report_edit) it will be in the relevant state, and any extra fields will be visible as per e). Those fields may be updated. Alternatively, the state may be changed, possibly triggering a) again, and clearing any metadata. - Fix javascript interactions 690 - show new statuses in summary - fix photos on SDM page - fix Planned => Planned+metadata transition - stop "assignation .select" js affecting templates - fix redirection for Extern and generally See mysociety/FixMyStreet-Commercial#672, mysociety/FixMyStreet-Commercial#690
* [Zurich] Updated email templatesMatthew Somerville2015-10-06-0/+2
| | | | | | | - submit-external-wish.txt includes a link with report's coordinates, template values are interpolated Conflicts: perllib/FixMyStreet/SendReport/Zurich.pm
* [Zurich] admin workflow changes available statesHakim Cassimally2015-10-06-110/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | See mysociety/FixMyStreet-Commercial#690 - external_message for Extern/Wunsch states - as per PDF mockups, the "public response" field is now editable from more states, namely: - Ruckmeldung ausstehend - Extern - Zustandigkeit unbekannt - Wunsch - Nicht kontaktierbar - Unsichtbar - test fixes NB: slight hack to reorder Zurich report_display tests As these remove 'investigating' from hidden_states, these break tests for default cobrand (the FMS::App code expects to be called once on request start, not multiple times within one test) - Not contactable button and tests for this and the similar `send_back` functionality (previously untested). NB: Unsure why we need to specify form_number=2 just for these submits, but test won't find the buttons otherwise. - Make sure SDMs' "time_spent" figure is recorded. (See mysociety/FixMyStreet-Commercial#718)
* Add "time spent" admin logging.Hakim Cassimally2015-10-06-2/+20
| | | | | | | | | | | | | | | | | | | | | Mechanism is general, but current implementation only used for Zurich. - Zurich: Record time_spent field mysociety/FixMyStreet-Commercial#676 - template changes (including jQuery spinner) - backend changes to save data are made: - in log_edit, if supplied - and time on category change (and arbitrary actions) - Add update_admin_log to all paths for DM, ensuring that it gets called, while resetting the `time_spent` parameter, to make sure that there is never a duplicate record created. - Also quell warning about using DateTime values in query. - Also add (seemingly unrelated) parens to stop misparsing of OK line in questionnaire test now that DT::Format::Pg is used in Zurich cobrand See mysociety/FixMyStreet-Commercial#676
* [Zurich] Attach images to external bodyHakim Cassimally2015-10-06-1/+50
| | | | See mysociety/FixMyStreet-Commercial#675
* [Zurich] 'photo required' functionalityDave Arter2015-10-06-0/+36
| | | | | | | | | | | - Save 'photo_required' value in Contact->extra from admin edit form - Enforce per-category photo requirement on new reports A new step has been added to the photo upload process that ensures a photo is present if any of the categories chosen for the report require it. If the photo is missing an error is displayed to the user in the same manner as if the photo upload was invalid. - Add test of mandatory photo categories
* Add support for multiple photos per report.Hakim Cassimally2015-10-06-3/+15
| | | | | | | | For Zurich, see mysociety/FixMyStreet-Commercial#664. This commit includes a new PhotoSet class (NB: called Model:: though not really a model), should handle binary data (e.g. old style photos in database), fileids (40-char hash), and Catalyst::Upload objects.
* [Zurich] all admin users can see statsHakim Cassimally2015-10-06-2/+2
| | | | | | | Admin CR4 https://github.com/mysociety/FixMyStreet-Commercial/issues/673 seems like admin_pages should be able to generate the menu, but this change also needs template change.
* [Zurich] add columns to stats exportHakim Cassimally2015-03-31-1/+1
| | | | | | | | | | | | | | | - Original Report description - Amended Report description (unsure what this is) - Media URL (currently one picture, in the future 1-3 pictures) - Interface used (see open311) - Requested datetime (see open311) (seems to be same as created) - Agency sent datetime (see open311) - Updated datetime (see open311) - Council-Response - title as per https://github.com/mysociety/FixMyStreet-Commercial/issues/678
* Add Extra role to ease use of {extra} field.Hakim Cassimally2015-03-20-3/+6
| | | | | | | | | Historically, the extra field has been used in two different ways by different cobrands, both as a list (e.g. Open311 category fields) and a hash (e.g. the Zurich cobrand). This commit consolidates usage, adding an API to make use of the field easier and always returning a hash for the code to use. Fixes #1018.
* Factor out test contact creation to function.Matthew Somerville2015-03-13-7/+2
|
* By default, use area-based alerts.Matthew Somerville2014-12-12-21/+17
| | | | | | | | | The body-based alert only works if the body ID matches the MapIt ID. This fixes #959. Further work needs to be done to enable proper body-based alerts that work properly in all circumstances. Consequently, factor out fixed body IDs from many tests. Also fix a couple of tests not overriding geocoder correctly.
* Fix test of postcode that has moved ever so slightly.Matthew Somerville2014-05-30-5/+5
|
* Add MAPIT_GENERATION variable, to pin whitelist.Matthew Somerville2014-05-16-1/+3
| | | | | | Otherwise, when MapIt Global is updated, the 'point' lookup, as it only returns the current generation by default, might no longer return the areas present in the whitelist.
* Add some overrides to zurich tests to stop failureStruan Donald2014-04-08-0/+4
| | | | Make sure mapit_id_whitelist set for tests that submit
* Fix test breakageHakim Cassimally2013-12-23-6/+23
| | | | for Zurich tests, count how many reports already exist as a baseline.
* [Zurich] don't hardcode division ID in cleanup()Hakim Cassimally2013-12-23-8/+9
|
* [Zurich] admin template to respect closed_overdueHakim Cassimally2013-12-20-1/+5
| | | | | | | | | | | | | This value is now cached, but the template calls the function, calculating it anew, so for old reports (closed within SLA) the problem_row.html template showed these as overdue. Instead, we point the template at a function which first checks the cached value. (Attempting to roll this functionality into the .overdue() method itself caused a fair amount of collateral test breakage, and it seems safest to extract the caching function for now.) Closes https://github.com/mysociety/FixMyStreet-Commercial/issues/462
* [Zurich] stats export include 'hidden'Hakim Cassimally2013-12-17-11/+19
| | | | | | | | | | See https://github.com/mysociety/FixMyStreet-Commercial/issues/461 Again, we just need to substitute the %params line (which elides hidden reports) for the less restrictive %date_params. This commit includes very basic tests for the previously untested ?export=1 functionality.
* [Zurich] testing - create superuser earlierHakim Cassimally2013-12-10-2/+7
| | | | So that tests pass on clean dataset such as travis...
* [Zurich] also allow hidden reports for closed_overdueHakim Cassimally2013-12-10-2/+2
|
* [Zurich] fix moderated statistics to include hiddenHakim Cassimally2013-12-10-53/+127
| | | | | | As per comments after testing mysociety/FixMyStreet-Commercial#459, the business logic of the actual state changes is fine, but the stats do also then need to include hidden records.
* [Zurich] log admin changesHakim Cassimally2013-12-09-0/+10
| | | | | To allow us to infer additional stats changes requirements such as in mysociety/FixMyStreet-Commercial#459 better in future.
* [Zurich] move mech test into override_config stanzaHakim Cassimally2013-12-09-2/+2
| | | | | This was causing previous test failures when config != Zurich, due to expected logic not getting triggered.
* [Zurich] test factor out cleanup() routineHakim Cassimally2013-12-09-4/+9
|
* [Zurich] test /admin/statsHakim Cassimally2013-12-09-0/+39
| | | | | | | First test that this page is only available to superuser. Then test that the moderated and fixed stats are doing something that is (hopefully) the spec in mysociety/FixMyStreet-Commercial#459
* [Zurich] test moderated_overdueHakim Cassimally2013-12-09-0/+43
| | | | | | - is set to 0 on state change within time-limit - is set to 1 on state change after time-limit - only marks overdue on first time
* More accurate config overriding for Zurich.Matthew Somerville2013-10-24-2/+6
|
* Fix test suite to run regardless of config setup.Matthew Somerville2013-10-24-102/+171
|
* [Zurich] Remove phone number requirement for mobile app reportsChris Mytton2013-10-21-0/+23
| | | | | | | | | | | | | | | | | The phone number was made mandatory in #541. To make this change compatible with older versions of the mobile app I've had to drop server side validation of the phone number for requests that come in from mobile apps. To determine if it's a mobile request I'm checking the 'service' parameter in the request, which is only set in requests from the mobile apps [1]. The phone validation will still happen client side for the newer versions of the app, and the web app will continue to work with the server side validations. [1] https://github.com/mysociety/zurich_mobile/blob/1fec2bc21dad9326819105cdbf5d47183e7503ba/www/js/models.js#L75
* [Zurich] Default to not sending rejected emailsChris Mytton2013-09-20-1/+1
| | | | Closes mysociety/FixMyStreet-Commercial#410