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

[Admin Panel] [Publisher] Add Reporting Agency Feature to Admin Panel #1553

Open
nichelle-hall opened this issue Oct 15, 2024 · 2 comments
Open
Assignees

Comments

@nichelle-hall
Copy link
Contributor

nichelle-hall commented Oct 15, 2024

CSG has requested a feature in the admin panel to assign reporting agencies for metrics. Currently, reporting agencies can be CSG, a vendor (e.g., Karpel), or a superagency that reports data for one or more metrics on behalf of another agency. This data is saved in the MetricSettings table and surfaced via the API for dashboards, but there is no way to input this information without directly editing the database.

To address this, we need to build a frontend feature in the admin panel that allows users to input and manage reporting agencies for each metric. We'll build this into existing agency modal that comes up when a user selects an agency in the Admin Panel. In addition to the other data that the FE sends, now there will be a new key/value pair in the API request that will look like this:

reporting_agencies: [
{
  "metric_key": "LAW_ENFORCEMENT_FUNDING" # Metric is reported by another agency
  "reporting_agency_id": 123,
  "is_self_reported": false
},
{
  "metric_key": "LAW_ENFORCEMENT_STAFF"  # Metric is self-reported by the agency
  "reporting_agency_id": null,
  "is_self_reported":True
},
{
  "metric_key": "LAW_ENFORCEMENT_ARRESTS". # Metric reporting agency has not been configured
  "reporting_agency_id": null,
  "is_self_reported":null
},
...
]

Additionally, the design should incorporate a drop-down menu for selecting the reporting agency for a metric. This dropdown will include a list of options. In this list there will be:

  • The agency's superagency, if it's a child agency.
  • Vendors: A list of vendors (e.g., Karpel) that have provided data for several agencies.
  • CSG Justice Center - because sometimes CSG uploads data for agencies.

A list of what agencies should be in this dropdown will be returned by the BE when fetching the metadata for the agency.

@mxosman
Copy link
Contributor

mxosman commented Oct 23, 2024

@nichelle-hall - can the metrics in the reporting_agencies be broken up by sector? Or even include the sector as a field to each object? That would be super helpful for the FE if it's not a too much of a hassle - as inferring from the keys can be wonky as far as figuring out the best place to split or maintaining a list of sector keys.

Also, the admin/agency/<agency_id> GET endpoint gives us a list of all of the metrics for an agency which is triggered when selecting the "Copy metric settings to child agency" checkbox - and I think we should trigger it when users click on the "Metrics Report Agency" tab within the modal - might be a perfect spot for the list of reporting agencies + metrics w/ assigned reporting agencies.

@mxosman
Copy link
Contributor

mxosman commented Oct 23, 2024

Hi @nasaownsky - just flagging this to give you a preview of the next high-priority task as soon as the team has a chance to look at the designs and the BE API is in place. We might be able to get a head start on some of the FE elements, but will let you know once things are ready to go. Will post the Figma designs here once they are ready.

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