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

[Publisher][Agency Settings] Add new agency definition section for court and supervision sectors #1540

Open
mxosman opened this issue Oct 7, 2024 · 0 comments · May be fixed by #1594
Open
Assignees

Comments

@mxosman
Copy link
Contributor

mxosman commented Oct 7, 2024

There will be a new section added to the Agency Settings page that collects information on how a court/supervision agency defines itself and its respective sector(s). It will operate in the same way as the Metric Definitions, with a set of checkboxes that determine whether or not each item applies to the agencies definition of itself, along with a Justice Counts definition link-button that will automatically select the default definitions.

This section will live as the last field within the Agency Name, State, Sector, Description and URL section. When a user clicks the Edit button, a modal will pop up (very similar to the Metric Definitions) with a set of includes/excludes options for the agency to select/de-select. For the Supervision section, the questions should appear dynamically based on their Included selections for the Supervision Populations section (e.g. if only Parole and Probation are Included, then the modal should only show those two sections - as shown in the Figma).

For a Courts agency, they'll see the CourtsIncludesExcludes set of options, and for a Supervision agency that has subpopulations, they will see the relevant<Subpopulation>IncludesExcludes set of options located in the components/AgencySettings/includesExcludes.ts file (when PR #1541 is merged in).

Note:

  • If we have the unlikely & unusual case where an agency has both Court, and Supervision sectors, then we should show the all of the relevant sections when they open the modal (again, for the supervision sector - only the the supervision subpopulations they mark as Included).
  • For the supervision sector, the Justice Counts definition button can apply the default selections for all of the subpopulations at once (e.g. if they include Parole and Probation, and the user clicks Justice Counts definition - the defaults for both Parole and Probation are automatically selected).

Reference: Figma design (not to precise scale)

The backend for this is not yet implemented, so we should gate this section with a TODO to ungate once the BE is fleshed out.

We'll be using the same saveAgencySettings method and endpoint for sending the updates, and receiving the saved data from the same GET endpoint we use for the other settings.

GET endpoint structure:

  {
      setting_type: "SECTOR_INCLUDES_EXCLUDES",
      value: [
        {
          sector: "PAROLE",
          settings: [
            {
            	"key": "BOARD_APPROVED",
                "included": "Yes",
            },
            {...}
	  ]
        },
        {...}
      ]
	  },

PATCH endpoint structure (payload):

{
	settings: [
    {
        "setting_type": "HOMEPAGE_URL",
        ...
    },
    {
        "setting_type": "PURPOSE_AND_FUNCTIONS",
        ...
    },
    {
        "setting_type": "BIOLOGICAL_SEX_RACE_ETHNICITY_DATA_SOURCE",
        ...
    },
    {
        "setting_type": "SECTOR_INCLUDES_EXCLUDES",
        "source_id": 11, // We no longer need to send this field (please kindly remove from payload)
        "value": [
          {
            "sector": "PAROLE",
            "settings": [
              {
            	"key": "BOARD_APPROVED",
            	"included": "Yes",
              },
              {...}
            ]
	   },
           {...}
        ]
    },
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants