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

Refactor report controller/views to remove local calculations #4136

Open
2 tasks
awwaiid opened this issue Feb 25, 2024 · 4 comments
Open
2 tasks

Refactor report controller/views to remove local calculations #4136

awwaiid opened this issue Feb 25, 2024 · 4 comments

Comments

@awwaiid
Copy link
Collaborator

awwaiid commented Feb 25, 2024

Summary

Inspired by View::Inventory, let's refactor report controller/views to incorporate all the queries into a single object (or set of objects) that can be passed down in the view. Look for any calculation, including things like sum and count in the view... We much prefer views to be extremely dumb and doing nothing but passing existing data into (possibly) rendering functions like number_to_delimiter.

Having a view object which we can calculate allows us a) to not have to deal with five or more instance variables and just have one, and b) to centralize all the logic that calculates that one view object.

Things to consider

No response

Criteria for Completion

  • Reports controller/views should have minimal calculations
  • Unit tests on calculations
@awwaiid awwaiid self-assigned this Feb 25, 2024
@cielf
Copy link
Collaborator

cielf commented Feb 26, 2024

It should also make any effort to speed up the things easier -- and a couple of the reports desperately need some speeding up.

Copy link
Contributor

This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.

@github-actions github-actions bot added the stale label Mar 28, 2024
Copy link
Contributor

github-actions bot commented Apr 4, 2024

Automatically unassigned after 7 days of inactivity.

@cielf
Copy link
Collaborator

cielf commented Apr 4, 2024

@awwaiid does this apply across all the bits we are putting under reports with dashboard, or is it just the annual report?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants