Skip to content
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

Emergency message OOH and on reporting pages #4015

Merged
merged 0 commits into from
Aug 18, 2022

Conversation

dracos
Copy link
Member

@dracos dracos commented Jul 19, 2022

This PR firstly consolidates a couple of ways of showing a message top left on the reporting pages into using form_after_heading.html. It then adds the ability to customise that message in the admin, leaving the hard-coded ones alone (though they could be moved to the database way of storing it easily enough). And then it adds OOH handling to all the 'emergency' messages, with an interface for specifying out of hours (defaulting to weekends, BH, midnight-8am/6pm-midnight on weekdays).
Don't really like the allowing of <p class> in the scrubber, but couldn't see an easy way to accommodate both simple text messages like Bucks have with a <strong> and that's about it, or something in a <p class="box-warning"> like say National Highways.
Would need some documentation on e.g. using that class if that's what we wanted to do. Or set it up for them first time.
Fixes https://github.com/mysociety/societyworks/issues/2570

Note this doesn't apply OOH to extra question stopper messages, I think we'd wait to see if that was wanted then, because that would be another level of complexity, I think, hopefully this could cover most.

@dracos dracos requested a review from davea July 19, 2022 14:41
@dracos dracos force-pushed the phone-us-messaging-refactoring branch from d8137df to 07a2475 Compare July 19, 2022 14:43
@codecov
Copy link

codecov bot commented Jul 19, 2022

Codecov Report

Merging #4015 (620a031) into master (105c61f) will decrease coverage by 0.05%.
The diff coverage is 85.71%.

❗ Current head 620a031 differs from pull request most recent head cb578e8. Consider uploading reports for the commit cb578e8 to get more accurate results

@@            Coverage Diff             @@
##           master    #4015      +/-   ##
==========================================
- Coverage   82.84%   82.78%   -0.06%     
==========================================
  Files         362      362              
  Lines       25290    25267      -23     
  Branches     3818     3815       -3     
==========================================
- Hits        20951    20918      -33     
- Misses       3154     3160       +6     
- Partials     1185     1189       +4     
Impacted Files Coverage Δ
perllib/FixMyStreet/Cobrand/Default.pm 88.79% <70.00%> (-0.61%) ⬇️
...xMyStreet/App/Controller/Admin/EmergencyMessage.pm 78.46% <83.72%> (+1.79%) ⬆️
perllib/FixMyStreet/OutOfHours.pm 94.11% <94.11%> (ø)
perllib/FixMyStreet/Cobrand/UK.pm 82.40% <100.00%> (+2.90%) ⬆️
perllib/FixMyStreet/Template.pm 96.29% <100.00%> (-0.03%) ⬇️
perllib/Utils/Email.pm 91.89% <0.00%> (-2.71%) ⬇️
perllib/Open311.pm 92.07% <0.00%> (-1.66%) ⬇️
perllib/FixMyStreet/TestMech.pm 93.06% <0.00%> (-1.46%) ⬇️
perllib/FixMyStreet/Email.pm 90.00% <0.00%> (-1.18%) ⬇️
perllib/Utils.pm 97.97% <0.00%> (-1.02%) ⬇️
... and 18 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@davea davea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works well! I've sprinkled a few suggestions in which I think will make the admin editing page a bit nicer to use.

Biggest thing missing now is user documentation :)

templates/web/base/admin/emergencymessage/edit.html Outdated Show resolved Hide resolved
templates/web/base/admin/emergencymessage/edit.html Outdated Show resolved Hide resolved
templates/web/base/admin/emergencymessage/edit.html Outdated Show resolved Hide resolved
templates/web/base/admin/emergencymessage/edit.html Outdated Show resolved Hide resolved
templates/web/base/admin/emergencymessage/edit.html Outdated Show resolved Hide resolved
templates/web/base/admin/emergencymessage/edit.html Outdated Show resolved Hide resolved
templates/web/base/admin/emergencymessage/edit.html Outdated Show resolved Hide resolved
Copy link
Member

@davea davea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⏰ 🚨 🆗

@@ -47,6 +47,7 @@

[% IF hardcoded_reporting_message %]
<p>Your reporting page message is currently hard-coded.</p>
<pre>[% hardcoded_reporting_message %]</pre>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was originally thinking of a rendered preview, but actually showing the HTML makes a lot more sense!

@mysociety-pusher mysociety-pusher force-pushed the phone-us-messaging-refactoring branch 2 times, most recently from 93a92b5 to cb578e8 Compare August 16, 2022 18:23
@mysociety-pusher mysociety-pusher merged commit ecc8ceb into master Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants