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

Paginate alerts on user admin page #4158

Merged
merged 2 commits into from
Nov 9, 2022
Merged

Conversation

davea
Copy link
Member

@davea davea commented Nov 9, 2022

Some shared/service user accounts have thousands of alerts and this page was timing out when attempting to render them all.

Prompted by FD-2538

image

@davea davea marked this pull request as ready for review November 9, 2022 14:22
@davea davea requested a review from dracos November 9, 2022 14:23
@codecov
Copy link

codecov bot commented Nov 9, 2022

Codecov Report

Merging #4158 (63f5b55) into master (85b2665) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 63f5b55 differs from pull request most recent head f44b525. Consider uploading reports for the commit f44b525 to get more accurate results

@@            Coverage Diff             @@
##           master    #4158      +/-   ##
==========================================
- Coverage   83.06%   83.06%   -0.01%     
==========================================
  Files         360      360              
  Lines       26129    26118      -11     
  Branches     4029     4025       -4     
==========================================
- Hits        21705    21694      -11     
- Misses       3212     3213       +1     
+ Partials     1212     1211       -1     
Impacted Files Coverage Δ
perllib/FixMyStreet/App/Controller/Admin/Users.pm 86.58% <100.00%> (+0.09%) ⬆️
web/js/front.js 82.25% <0.00%> (-1.62%) ⬇️
perllib/FixMyStreet/Cobrand/FixMyStreet.pm 87.85% <0.00%> (-0.31%) ⬇️
perllib/FixMyStreet/Cobrand/TfL.pm 84.72% <0.00%> (ø)

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

@dracos dracos left a comment

Choose a reason for hiding this comment

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

Couple of comments, but looks fine :)

@@ -54,7 +54,13 @@ <h3>[% loc("User's alerts") %]</h3>
<td><input type="radio" name="edit_alert[[% alert.id %]]" value="delete"></td>
</tr>
[% END %]
<tr>
<td colspan=5></td>
<td colspan=3 class="center">
Copy link
Member

Choose a reason for hiding this comment

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

You can use align="center" and not need any utility CSS ;)

</form>
[% INCLUDE 'pagination.html', admin = 1, param = 'p', pager = alerts_pager %]
Copy link
Member

Choose a reason for hiding this comment

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

What is admin=1 for here? Hmm, I see it's there all the other places, so might as well leave it, but doesn't look like it does anything any more :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Hasn't done anything since 2016! Have removed it everywhere in f44b525.

Some shared/service user accounts have thousands of alerts and this page
was timing out when attempting to render them all.

Prompted by FD-2538
@davea davea merged commit f44b525 into master Nov 9, 2022
@github-pages github-pages bot temporarily deployed to github-pages November 9, 2022 19:23 Inactive
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