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

Make anonymous comments clearer in alert emails #3417

Merged
merged 2 commits into from
May 4, 2021

Conversation

chrismytton
Copy link
Member

When showing a list of comments in HTML emails we previously didn't show anything for updates that were left anonymously. This led to some confusion about which text related to which update.

This change means that anonymous comments will show the text "Posted anonymously" next to them, which should make things a bit clearer.

Fixes https:/mysociety/fixmystreet-commercial/issues/2236

@chrismytton
Copy link
Member Author

Manually testing this was a bit awkward. I ended up changing this line to have item_anonymous => 1 so all updates appeared as anonymous on /_dev/email/alert-update. There may be a better way!

item_name => $u->name, item_anonymous => $u->anonymous, confirmed => $u->confirmed };

@codecov
Copy link

codecov bot commented Apr 28, 2021

Codecov Report

Merging #3417 (7c52e55) into master (26e80bb) will decrease coverage by 0.03%.
The diff coverage is 50.00%.

❗ Current head 7c52e55 differs from pull request most recent head 1f0e516. Consider uploading reports for the commit 1f0e516 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3417      +/-   ##
==========================================
- Coverage   82.51%   82.48%   -0.04%     
==========================================
  Files         325      325              
  Lines       21632    21633       +1     
  Branches     3263     3264       +1     
==========================================
- Hits        17849    17843       -6     
- Misses       2744     2750       +6     
- Partials     1039     1040       +1     
Impacted Files Coverage Δ
perllib/FixMyStreet/App/Controller/Develop.pm 77.31% <50.00%> (-1.14%) ⬇️
web/cobrands/fixmystreet-uk-councils/alloy.js 86.13% <0.00%> (-4.96%) ⬇️
web/cobrands/fixmystreet/fixmystreet.js 70.68% <0.00%> (-0.06%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 26e80bb...1f0e516. Read the comment docs.

@chrismytton chrismytton requested a review from davea April 28, 2021 17:06
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.

Nice and neat. Agreed that it's a bit awkward to test manually. I guess you could have the $q on L106 fetch updates from the report being displayed and fallback to the existing behaviour if there weren't any.

@chrismytton
Copy link
Member Author

I guess you could have the $q on L106 fetch updates from the report being displayed and fallback to the existing behaviour if there weren't any.

@davea This works really well, thanks! I've added an extra commit to the end of this PR which does this, would you mind taking a look?

@chrismytton chrismytton requested a review from davea April 29, 2021 14:26
@chrismytton chrismytton force-pushed the anonymous-author-metadata-in-alert-emails branch from 39a3ff0 to 7c52e55 Compare April 29, 2021 14:28
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! :)

(don't forget to check that fixamingata template and ack the cobrand-templates check)

When showing a list of comments in HTML emails we previously didn't show
anything for updates that were left anonymously. This led to some
confusion about which text related to which update.

This change means that anonymous comments will show the text "Posted
anonymously" next to them, which should make things clearer.
If the problem being used for the alert-update email preview has
comments associated with it, use those instead of 5 random comments.
@chrismytton chrismytton force-pushed the anonymous-author-metadata-in-alert-emails branch from 7c52e55 to 1f0e516 Compare May 4, 2021 09:56
@chrismytton chrismytton merged commit 7a392f0 into master May 4, 2021
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.

2 participants