-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Publisher] Agency Settings - Add new agency-wide Courts + Supervisio…
…n Subpopulation TIG elements (#1541) * Add new court and supervision subpopulation tig elements * Add comments * Strongly type the IncludesExcludes constants * Consolidate sector elements into one config object and strongly type * Fix lint --------- Co-authored-by: Mahmoud <mahmoud@Mahmouds-MacBook-Pro.local>
- Loading branch information
Showing
31 changed files
with
331 additions
and
18 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
272 changes: 272 additions & 0 deletions
272
publisher/src/components/AgencySettings/IncludesExcludes/includesExcludes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,272 @@ | ||
// Recidiviz - a data platform for criminal justice reform | ||
// Copyright (C) 2024 Recidiviz, Inc. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
// ============================================================================= | ||
|
||
import { AgencySystems } from "@justice-counts/common/types"; | ||
|
||
import { AgencyIncludesExcludesType, IncludesExcludesEnum } from "./types"; | ||
|
||
/** | ||
* Agency-wide Includes/Excludes definitions for Court and Supervision Subpopulation sectors | ||
*/ | ||
|
||
// Helper function to map boolean values to `YES` | `NO` enums | ||
export const boolToYesNoEnum = (bool: boolean): IncludesExcludesEnum => | ||
bool ? IncludesExcludesEnum.YES : IncludesExcludesEnum.NO; | ||
|
||
export const AgencyIncludesExcludes: AgencyIncludesExcludesType = { | ||
[AgencySystems.COURTS_AND_PRETRIAL]: { | ||
SPECIAL_OR_LIMITED_JURISDICTION: { | ||
label: "Courts of special or limited jurisdiction (e.g., traffic court)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
GENERAL_JURISDICTION: { | ||
label: "Courts of general jurisdiction", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PROBLEM_SOLVING: { | ||
label: "Problem-solving courts (e.g., drug court, veterans court)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
APPEALS: { | ||
label: "Courts of appeal", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
CIVIL: { | ||
label: "Civil courts", | ||
default: IncludesExcludesEnum.NO, | ||
}, | ||
FAMILY: { | ||
label: "Family courts", | ||
default: IncludesExcludesEnum.NO, | ||
}, | ||
JUVENILE: { | ||
label: "Juvenile courts", | ||
default: IncludesExcludesEnum.NO, | ||
}, | ||
}, | ||
[AgencySystems.PROBATION]: { | ||
PROBATION_IN_LIEU_INCARCERATION: { | ||
label: | ||
"People sentenced to a period of probation in lieu of incarceration (including to electronic monitoring, home confinement, traditional supervision, etc.)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PROBATION_AFTER_INCARCERATION: { | ||
label: | ||
"People sentenced to a period of probation after a period of incarceration (including to electronic monitoring, home confinement, traditional supervision, etc.)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PROBATION_POST_ADJUCATION_PROGRAM: { | ||
label: | ||
"People on probation as part of a post-adjudication specialty or problem-solving court program (e.g., drug court)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PROBATION_TEMPORARILY_CONFINED: { | ||
label: | ||
"People sentenced to probation who are temporarily confined in jail, prison, or another confinement center for a short “dip” sanction (typically less than 30 days)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PROBATION_CONFINED_ANY_LENGTH: { | ||
label: | ||
"People sentenced to probation confined for any length of time in a violation center or halfway back facility operated by the supervision agency", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PROBATION_HOLD_PENDING: { | ||
label: | ||
"People sentenced to probation who are in jail or prison on a hold pending resolution of a violation or revocation", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PROBATION_LONGER_SANCTION: { | ||
label: | ||
"People sentenced to probation who are confined in jail or prison for a longer sanction (e.g., more than 30 days, 120 days, 6 months, etc.)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PROBATION_COMPACT_AGREEMENT: { | ||
label: | ||
"People sentenced to probation in another jurisdiction who are supervised by the agency through interstate compact, intercounty compact, or other mutual supervision agreement", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PROBATION_ANOTHER_JURISTICTION: { | ||
label: | ||
"People sentenced to probation who are being supervised by another jurisdiction", | ||
default: IncludesExcludesEnum.NO, | ||
}, | ||
PROBATION_IN_COMMUNITY: { | ||
label: | ||
"People who have not been sentenced but are supervised on probation in the community prior to the resolution of their case", | ||
default: IncludesExcludesEnum.NO, | ||
}, | ||
PROBATION_ANOTHER_FORM_SUPERVISION: { | ||
label: | ||
"People sentenced to probation who are also on another form of supervision", | ||
default: IncludesExcludesEnum.NO, | ||
}, | ||
PROBATION_PRE_ADJUCTATION_PROGRAM: { | ||
label: | ||
"People on probation as part of a pre-adjudication specialty or problem-solving court program (e.g., drug court)", | ||
default: IncludesExcludesEnum.NO, | ||
}, | ||
}, | ||
[AgencySystems.PAROLE]: { | ||
PAROLE_EARLY_RELEASE: { | ||
label: | ||
"People approved by a parole board or similar entity for early conditional release from incarceration to parole supervision (including to electronic monitoring, home confinement, traditional supervision, etc.)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PAROLE_STATUTORY_REQUIREMENT: { | ||
label: | ||
"People conditionally released from incarceration to parole supervision by statutory requirement (including to electronic monitoring, home confinement, traditional supervision, etc.)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PAROLE_TEMPORARILY_CONFINED: { | ||
label: | ||
"People on parole who are temporarily confined in jail, prison, or another confinement center for a short “dip” sanction (typically less than 30 days)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PAROLE_CONFINED_ANY_LENGTH: { | ||
label: | ||
"People on parole confined for any length of time in a violation center or halfway back facility operated by the supervision agency", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PAROLE_HOLD_PENDING: { | ||
label: | ||
"People on parole who are in jail or prison on a hold pending resolution of a violation or revocation", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PAROLE_LONGER_SANCTION: { | ||
label: | ||
"People on parole who are confined in jail or prison for a longer sanction (e.g., more than 30 days, 120 days, 6 months, etc.)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PAROLE_COMPACT_AGREEMENT: { | ||
label: | ||
"People released to parole in another jurisdiction who are supervised by the agency through interstate compact, intercounty compact, or other mutual supervision agreement", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PAROLE_ANOTHER_FORM_SUPERVISION: { | ||
label: "People on parole who are also on another form of supervision", | ||
default: IncludesExcludesEnum.NO, | ||
}, | ||
PAROLE_ANOTHER_JURISTICTION: { | ||
label: | ||
"People on parole who are being supervised by another jurisdiction", | ||
default: IncludesExcludesEnum.NO, | ||
}, | ||
}, | ||
[AgencySystems.PRETRIAL_SUPERVISION]: { | ||
PRETRIAL_CITATION_RELEASE: { | ||
label: "People on citation release (i.e., were never booked)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PRETRIAL_CONDITION_SUPERVISION: { | ||
label: | ||
"People released from jail or otherwise not held pretrial on the condition of supervision (including electronic monitoring, home confinement, traditional supervision, etc.)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PRETRIAL_STATUTORY_REQUIREMENT: { | ||
label: | ||
"People released from jail or otherwise not held pretrial due to statutory requirement", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PRETRIAL_COURT_PROGRAM: { | ||
label: | ||
"People supervised as part of a pre-adjudication specialty or problem-solving court program (e.g., drug court)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PRETRIAL_HOLD_PENDING: { | ||
label: | ||
"People on pretrial supervision who are incarcerated on a hold pending resolution of a violation or revocation", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
PRETRIAL_ANOTHER_FORM_SUPERVISION: { | ||
label: | ||
"People on pretrial supervision who are also on another form of supervision", | ||
default: IncludesExcludesEnum.NO, | ||
}, | ||
}, | ||
[AgencySystems.OTHER_SUPERVISION]: { | ||
OTHER_IN_LIEU_INCARCERATION: { | ||
label: | ||
"People sentenced to a period of other community supervision in lieu of incarceration (including to electronic monitoring, home confinement, traditional supervision, etc.)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
OTHER_DETERMINATE_PERIOD: { | ||
label: | ||
"People sentenced to a determinate period of other community supervision after a period of incarceration (including to electronic monitoring, home confinement, traditional supervision, etc.)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
OTHER_POST_ADJUCATION_PROGRAM: { | ||
label: | ||
"People on other community supervision as part of a post-adjudication specialty or problem-solving court program (e.g., drug court)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
OTHER_EARLY_RELEASE: { | ||
label: | ||
"People approved by a parole board or similar entity for early conditional release from incarceration to other community supervision (including to electronic monitoring, home confinement, traditional supervision, etc.)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
OTHER_STATUTORY_REQUIREMENT: { | ||
label: | ||
"People conditionally released from incarceration to other community supervision by statutory requirement (including to electronic monitoring, home confinement, traditional supervision, etc.)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
OTHER_TEMPORARILY_CONFINED: { | ||
label: | ||
"People on other community supervision who are temporarily confined in jail, prison, or another confinement center for a short “dip” sanction (typically less than 30 days)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
OTHER_CONFINED_ANY_LENGTH: { | ||
label: | ||
"People on other community supervision confined for any length of time in a violation center or halfway back facility operated by the supervision agency", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
OTHER_JAIL_OR_PRISON_HOLD_PENDING: { | ||
label: | ||
"People on other community supervision who are in jail or prison on a hold pending resolution of a violation or revocation", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
OTHER_LONGER_SANTION: { | ||
label: | ||
"People on other community supervision who are confined in jail or prison for a longer sanction (e.g., more than 30 days, 120 days, 6 months, etc.)", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
OTHER_INCARCERATED_HOLD_PENDING: { | ||
label: | ||
"People on other community supervision who are incarcerated on a hold pending resolution of a violation or revocation", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
OTHER_COMPACT_AGREEMENT: { | ||
label: | ||
"People on supervision in another jurisdiction who are supervised by the agency through interstate compact, intercounty compact, or other mutual supervision agreement", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
OTHER_ANOTHER_FORM_SUPERVISION: { | ||
label: | ||
"People on other community supervision who are also on another form of supervision", | ||
default: IncludesExcludesEnum.YES, | ||
}, | ||
OTHER_PRIOR_TO_RESOLUTION: { | ||
label: | ||
"People on other community supervision who have not been sentenced but are supervised in the community prior to the resolution of their case", | ||
default: IncludesExcludesEnum.NO, | ||
}, | ||
OTHER_COURT_PROGRAM: { | ||
label: | ||
"People on other community supervision in a pre-adjudication specialty or problem-solving court program (e.g., drug court, etc.)", | ||
default: IncludesExcludesEnum.NO, | ||
}, | ||
}, | ||
}; |
41 changes: 41 additions & 0 deletions
41
publisher/src/components/AgencySettings/IncludesExcludes/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Recidiviz - a data platform for criminal justice reform | ||
// Copyright (C) 2024 Recidiviz, Inc. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
// ============================================================================= | ||
|
||
import { AgencySystems } from "@justice-counts/common/types"; | ||
|
||
export enum IncludesExcludesEnum { | ||
YES = "YES", | ||
NO = "NO", | ||
} | ||
|
||
export type IncludesExcludesWithDefault = { | ||
[key: string]: { | ||
label: string; | ||
default: IncludesExcludesEnum; | ||
}; | ||
}; | ||
|
||
type AgencySystemKeys = | ||
| AgencySystems.COURTS_AND_PRETRIAL | ||
| AgencySystems.PAROLE | ||
| AgencySystems.PROBATION | ||
| AgencySystems.PRETRIAL_SUPERVISION | ||
| AgencySystems.OTHER_SUPERVISION; | ||
|
||
export type AgencyIncludesExcludesType = { | ||
[key in AgencySystemKeys]: IncludesExcludesWithDefault; | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
00f6e4b
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.
@mxosman [LOW_RISK] Hi, we noticed you made a commit in GitHub that may contain sensitive information (details below). Please double check if you intended to include or share this sensitive information in the issue.
Note that it may have already been addressed automatically by an administrator.
What types of sensitive information were detected?
Recidiviz Email Address
What was the context?
When did this happen?
Fri, 11 Oct 2024 at 21:16:18 UTC
Where did this happen?
Repository: justice-counts
File Path: publisher/src/components/MetricsConfiguration/MetricsOverview.tsx
What can I do now?
Please review the incident details carefully and help us remediate with these actions
Report as False Positive
Provide Business Justification