diff options
author | Chris Mytton <chrism@mysociety.org> | 2020-05-15 17:42:06 +0100 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-10-12 13:38:03 +0100 |
commit | 19deaf332d2843e3b4337f3e2047bce47e4a7cd1 (patch) | |
tree | 0b8c09257b286eda03f188f61e76acb2aeec9439 /web | |
parent | c778cff750282e814820b2f8ffee5e5c909e269a (diff) |
[Oxfordshire] Add instruct defect functionality back in
In the past Oxfordshire had a way for inspectors to "instruct a defect",
which generated a CSV which got emailed to Oxfordshire with a list of
defects.
They now want to bring this functionality back, but instead of emailing
a CSV they want it to call an API.
As a first step towards that goal, this change adds back some of the
instruct defect functionality that was removed in 68e18ff.
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/fixmystreet/staff.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/web/cobrands/fixmystreet/staff.js b/web/cobrands/fixmystreet/staff.js index 4bbc0b11d..ec85dbb8d 100644 --- a/web/cobrands/fixmystreet/staff.js +++ b/web/cobrands/fixmystreet/staff.js @@ -1,4 +1,16 @@ fixmystreet.staff_set_up = { + action_scheduled_raise_defect: function() { + $("#report_inspect_form").find('[name=state]').on('change', function() { + if ($(this).val() !== "action scheduled") { + $("#js-inspect-action-scheduled").addClass("hidden"); + $('#raise_defect_yes').prop('required', false); + } else { + $("#js-inspect-action-scheduled").removeClass("hidden"); + $('#raise_defect_yes').prop('required', true); + } + }); + }, + list_item_actions: function() { $('#js-reports-list').on('click', ':submit', function(e) { e.preventDefault(); @@ -423,6 +435,7 @@ $(fixmystreet).on('display:report', function() { fixmystreet.staff_set_up.response_templates(); if ($("#report_inspect_form").length) { fixmystreet.staff_set_up.report_page_inspect(); + fixmystreet.staff_set_up.action_scheduled_raise_defect(); } }); |