-
Notifications
You must be signed in to change notification settings - Fork 0
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
update metric settings badges to reflect custom reporting frequency #172
update metric settings badges to reflect custom reporting frequency #172
Conversation
f646fe0
to
bac641f
Compare
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.
@nichelle-hall can you do a search to see if there's anywhere else we need to update the rendering of frequency? I just remembered for instance that the badge also shows up on the Data page. Will your change here take care of that, or do we need to make an additional change for that?
@@ -358,6 +361,8 @@ class MetricConfigStore { | |||
this.metrics[systemMetricKey].description = metadata.description; | |||
this.metrics[systemMetricKey].frequency = | |||
metadata.frequency as ReportFrequency; | |||
this.metrics[systemMetricKey].customFrequency = |
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.
curious what @mxosman and @terryttsai think, but I'm wondering if we should define a property like frequencyToUse
here, which is customFrequency
if not null else frequency
, and then just use this everywhere when rendering. That way, up above we could replace
{metrics[systemMetricKey]?.customFrequency
? metrics[
systemMetricKey
]?.customFrequency?.toLocaleLowerCase()
: metrics[systemMetricKey]?.frequency?.toLowerCase()}
with
{metrics[systemMetricKey]?.frequencyToUse?.toLowerCase()}
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.
I really like that idea - love how clean it makes rendering the frequency! Let me know if TypeScript gives you any trouble, Nichelle!
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.
I wanted to leave the default frequency because I wasn't sure if it would be included as part of the design. For example, if the user wanted to see what the default was while scrolling through, or wanted to set every metric back to default. That said I think Humphrey's designs will come soon! I won't let this be blocking for more than a couple days but will finish up the other follow-ups first before doing these changes.
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.
For example, I wonder if we would want to include the default in the data tab design since we may need to distinguish that the reporting frequency has changed if we want to change the x axis of the charts.
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.
That's a great call - makes sense why you'd need them separated in the cases you mentioned!
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! Thank you, Nichelle!
Sounds good, thanks for explaining your reasoning @nichelle-hall ! |
bac641f
to
2af960c
Compare
Description of the change
This PR updates the badges used in the metric settings pages so that they reflect the custom reporting frequency of a metric if the custom frequency is not
undefined
.The default reporting frequency for
Civilians Complaints Sustained
is annual, but a custom reporting frequency has been added such that it is now reported monthly.Related issues
Related to #16218
Checklists
Development
This box MUST be checked by the submitter prior to merging:
These boxes should be checked by the submitter prior to merging:
Code review
These boxes should be checked by reviewers prior to merging: