-
Notifications
You must be signed in to change notification settings - Fork 37
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
Utilization Analytics MVP #1136
Conversation
This also adds the utilization module back into code coverage checking
{% endblock %} | ||
|
||
{% block content %} | ||
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's bring this in house and serve ourselves for consistency by pulling the version we need into tock/tock/static/vendor
https://github.com/18F/tock/blob/main/docs/dependency-management.md#production
def _utilization_data(start_date, end_date): | ||
Timecard = apps.get_model("hours", "Timecard") | ||
billable_filter = Q(timecardobjects__project__accounting_code__billable=True) | ||
data = (Timecard.objects.filter(reporting_period__start_date__gte=start_date, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opportunity here to limit this to submitted timecards by filtering on Timecard.submitted
Looks :amaze: @neilmb, thank you!! |
@Jkrzy Comments addressed: filter on submitted, vendor plotly into static, sum using existing billable/non-billable totals on timecard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Description
There is lots of valuable information about 18F operations in the Tock database. This is a very early step in making that data visible. It adds a page under "Reports" called "Analytics" that currently has just a single graph of the total hours billed over time broken down by billable and non-billable.
There are many more relevant graphs that could be added here in the future, but this is an MVP to establish that we can include these kinds of graphs.
Additional information
This adds a dependency on the python
plotly
library for creating the plots in a way that can be included in the template and the template for the page then includes the Plotly.js library on-page from their CDN. If we need to ship a fixed version of that JS library, we could figure out how to do that instead.