Skip to content

Admin: calculate stats from admin page#4063

Merged
mathjazz merged 5 commits into
mozilla:mainfrom
functionzz:calculate_stats_from_admin
Apr 7, 2026
Merged

Admin: calculate stats from admin page#4063
mathjazz merged 5 commits into
mozilla:mainfrom
functionzz:calculate_stats_from_admin

Conversation

@functionzz
Copy link
Copy Markdown
Collaborator

This PR allows admins to calculate all project statistics directly via the /admin page, which removes the need for using the ./manage.py calculate_stats command via the python shell.

Fixes #3879.

@functionzz
Copy link
Copy Markdown
Collaborator Author

I would also like to rewrite the current admin.js as it seems to not be written in jQuery.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 57.89474% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.07%. Comparing base (d3823b8) to head (90f962e).
⚠️ Report is 5 commits behind head on main.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Collaborator

@mathjazz mathjazz left a comment

Choose a reason for hiding this comment

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

Great work!

We should probably just calculate stats of the enabled projects, right @flodolo?

Also, I'd move the button (perhaps called "Re-calculate stats"?) outside the search / filter area to the top right corner of the header of the page (see the position of the dropdwn on the Team pages).

@flodolo
Copy link
Copy Markdown
Collaborator

flodolo commented Apr 7, 2026

We should probably just calculate stats of the enabled projects, right @flodolo?

Yes, no point in running it on obsolete projects.

@flodolo
Copy link
Copy Markdown
Collaborator

flodolo commented Apr 7, 2026

We probably want to mention this in documentation, and why/when it might be needed?

@flodolo
Copy link
Copy Markdown
Collaborator

flodolo commented Apr 7, 2026

We probably want to mention this in documentation, and why/when it might be needed?

Would it make sense to put it in Maintenance?

Copy link
Copy Markdown
Collaborator

@mathjazz mathjazz left a comment

Choose a reason for hiding this comment

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

Nice job!

@mathjazz mathjazz merged commit 51f49e9 into mozilla:main Apr 7, 2026
5 checks passed
functionzz added a commit to functionzz/pontoon that referenced this pull request May 4, 2026
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.

Allow admins to calculate stats from main UI

4 participants