Skip to content

Commit

Permalink
Add new court and supervision subpopulation tig elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmoud authored and Mahmoud committed Oct 8, 2024
1 parent 9d1bb83 commit c6c4cb9
Show file tree
Hide file tree
Showing 30 changed files with 285 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
// 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/>.
// =============================================================================

/**
* Agency-wide Includes/Excludes definitions for Court and Supervision Subpopulation sectors
*/

export const boolToYesNoEnum = (bool: boolean) => (bool ? "YES" : "NO");

export const CourtsIncludesExcludes = {
SPECIAL_OR_LIMITED_JURISDICTION: {
label: "Courts of special or limited jurisdiction (e.g., traffic court)",
default: "YES",
},
GENERAL_JURISDICTION: {
label: "Courts of general jurisdiction",
default: "YES",
},
PROBLEM_SOLVING: {
label: "Problem-solving courts (e.g., drug court, veterans court)",
default: "YES",
},
APPEALS: {
label: "Courts of appeal",
default: "YES",
},
CIVIL: {
label: "Civil courts",
default: "NO",
},
FAMILY: {
label: "Family courts",
default: "NO",
},
JUVENILE: {
label: "Juvenile courts",
default: "NO",
},
};

export const ProbationIncludesExcludes = {
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: "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: "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: "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: "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: "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: "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: "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: "YES",
},
PROBATION_ANOTHER_JURISTICTION: {
label:
"People sentenced to probation who are being supervised by another jurisdiction",
default: "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: "NO",
},
PROBATION_ANOTHER_FORM_SUPERVISION: {
label:
"People sentenced to probation who are also on another form of supervision",
default: "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: "NO",
},
};

export const ParoleIncludesExcludes = {
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: "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: "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: "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: "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: "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: "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: "YES",
},
PAROLE_ANOTHER_FORM_SUPERVISION: {
label: "People on parole who are also on another form of supervision",
default: "NO",
},
PAROLE_ANOTHER_JURISTICTION: {
label: "People on parole who are being supervised by another jurisdiction",
default: "NO",
},
};

export const PretrialSupervisionIncludesExcludes = {
PRETRIAL_CITATION_RELEASE: {
label: "People on citation release (i.e., were never booked)",
default: "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: "YES",
},
PRETRIAL_STATUTORY_REQUIREMENT: {
label:
"People released from jail or otherwise not held pretrial due to statutory requirement",
default: "YES",
},
PRETRIAL_COURT_PROGRAM: {
label:
"People supervised as part of a pre-adjudication specialty or problem-solving court program (e.g., drug court)",
default: "YES",
},
PRETRIAL_HOLD_PENDING: {
label:
"People on pretrial supervision who are incarcerated on a hold pending resolution of a violation or revocation",
default: "YES",
},
PRETRIAL_ANOTHER_FORM_SUPERVISION: {
label:
"People on pretrial supervision who are also on another form of supervision",
default: "NO",
},
};

export const OtherSupervisionIncludesExcludes = {
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: "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: "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: "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: "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: "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: "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: "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: "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: "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: "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: "YES",
},
OTHER_ANOTHER_FORM_SUPERVISION: {
label:
"People on other community supervision who are also on another form of supervision",
default: "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: "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: "NO",
},
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import {
} from "@justice-counts/common/components/GlobalStyles";
import styled from "styled-components/macro";

import { AccountSettingsTitle } from "../AgencySettings/AccountSettings.styles";
import { LabelRow, Row, Table } from "../Reports";
import { AccountSettingsTitle } from "../Settings/AccountSettings.styles";

const STICKY_RESPONSIVE_UPLOADED_FILES_TITLE_HEIGHT = 48;

Expand Down
2 changes: 1 addition & 1 deletion publisher/src/components/DataViz/MetricsDataChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ import { useCurrentPng } from "recharts-to-png";
import { NotFound } from "../../pages/NotFound";
import { useStore } from "../../stores";
import { formatSystemName } from "../../utils";
import { useSettingsSearchParams } from "../AgencySettings";
import { ReactComponent as SwitchToChartIcon } from "../assets/switch-to-chart-icon.svg";
import { ReactComponent as SwitchToDataTableIcon } from "../assets/switch-to-data-table-icon.svg";
import { AppGuideKeys, GuideKeys } from "../HelpCenter/types";
import { createURLToGuide } from "../HelpCenter/utils";
import { Loading } from "../Loading";
import { ChildAgenciesDropdown } from "../MetricsConfiguration/ChildAgenciesDropdown";
import { useSettingsSearchParams } from "../Settings";
import ConnectedDatapointsView from "./ConnectedDatapointsView";
import * as Styled from "./MetricsDataChart.styled";
import { ChartView } from "./types";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
getActiveSystemMetricKey,
replaceSystemMetricKeyWithNewSystem,
useSettingsSearchParams,
} from "../Settings";
} from "../AgencySettings";
import * as Styled from "./Configuration.styled";
import MetricAvailability from "./MetricAvailability";
import MetricDefinitions from "./MetricDefinitions";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import {
getActiveSystemMetricKey,
replaceSystemMetricKeyWithNewSystem,
useSettingsSearchParams,
} from "../Settings";
} from "../AgencySettings";
import { ConfigurationStatusButton } from "./ConfigurationStatusButton";
import { RACE_ETHNICITY_DISAGGREGATION_KEY } from "./constants";
import DefinitionModalForm from "./DefinitionModalForm";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
getActiveSystemMetricKey,
replaceSystemMetricKeyWithNewSystem,
useSettingsSearchParams,
} from "../Settings";
} from "../AgencySettings";
import { ConfigurationStatusText } from "./ConfigurationStatusButton";
import { RACE_ETHNICITY_DISAGGREGATION_KEY } from "./constants";
import DefinitionModalForm from "./DefinitionModalForm";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import React, { useEffect, useState } from "react";
import { useParams } from "react-router-dom";

import { useStore } from "../../stores";
import { useSettingsSearchParams } from "../AgencySettings";
import { Loading } from "../Loading";
import { useSettingsSearchParams } from "../Settings";
import Configuration from "./Configuration";
import { MetricsOverview } from "./MetricsOverview";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ import { useParams } from "react-router-dom";
import { NotFound } from "../../pages/NotFound";
import { useStore } from "../../stores";
import { formatSystemName } from "../../utils";
import {
replaceSystemMetricKeyWithNewSystem,
useSettingsSearchParams,
} from "../AgencySettings";
import { ReactComponent as RightArrowIcon } from "../assets/bold-right-arrow-icon.svg";
import { AppGuideKeys, GuideKeys } from "../HelpCenter/types";
import { createURLToGuide } from "../HelpCenter/utils";
import { DisclaimerBanner } from "../primitives";
import {
replaceSystemMetricKeyWithNewSystem,
useSettingsSearchParams,
} from "../Settings";
import { ChildAgenciesDropdown } from "./ChildAgenciesDropdown";
import * as Styled from "./MetricsOverview.styled";
import { MetricInfo } from "./types";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { observer } from "mobx-react-lite";
import React from "react";

import { useStore } from "../../stores";
import { useSettingsSearchParams } from "../AgencySettings";
import { ReactComponent as RightArrowIcon } from "../assets/right-arrow.svg";
import { useSettingsSearchParams } from "../Settings";
import * as Styled from "./RaceEthnicitiesGrid.styled";
import { Ethnicity } from "./RaceEthnicitiesGridStates";
import { sortRaces } from "./utils";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import React, { useState } from "react";
import { useParams } from "react-router-dom";

import { useStore } from "../../stores";
import { useSettingsSearchParams } from "../Settings";
import { useSettingsSearchParams } from "../AgencySettings";
import * as Styled from "./ModalForm.styled";
import {
Ethnicity,
Expand Down
10 changes: 5 additions & 5 deletions publisher/src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import { TabbedBar } from "@justice-counts/common/components/TabbedBar";
import React, { useState } from "react";

import { AppGuideKeys, GuideKeys } from "../components/HelpCenter/types";
import { createURLToGuide } from "../components/HelpCenter/utils";
import {
AccountSettings,
AgencySettings,
Expand All @@ -29,9 +27,11 @@ import {
SettingsTabContainer,
SettingsTitle,
SettingsTitleContainer,
} from "../components/Settings";
import { AgencySettingsTeamManagement } from "../components/Settings/AgencySettingsTeamManagement";
import { TabContent } from "../components/Settings/TabContent";
} from "../components/AgencySettings";
import { AgencySettingsTeamManagement } from "../components/AgencySettings/AgencySettingsTeamManagement";
import { TabContent } from "../components/AgencySettings/TabContent";
import { AppGuideKeys, GuideKeys } from "../components/HelpCenter/types";
import { createURLToGuide } from "../components/HelpCenter/utils";

enum tabOptions {
ACCOUNT = "Account",
Expand Down
Loading

0 comments on commit c6c4cb9

Please sign in to comment.