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

Migrate the Justice Counts Publisher frontend #4

Merged
merged 180 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
61db0fe
[Justice Counts] Setting up justice-counts frontend subdirectories an…
mxosman Mar 18, 2022
31b9ac3
[Justice Counts] Adding auth wall component and barebones stores (#11…
mxosman Mar 26, 2022
9e982f1
[Justice Counts] Bash script and instructions for running the Control…
lilidworkin Mar 28, 2022
88dd6f2
[Justice Counts] Calling an API (#11629)
mxosman Mar 31, 2022
da32018
[Justice Counts] Adding basic navigation and UI scaffolding (#11631)
mxosman Apr 1, 2022
be7fb0d
[Justice Counts] Adds UserStore (#11919)
mxosman Apr 6, 2022
11a66f7
[Justice Counts] Add ability to retrieve public Auth0 config via wind…
mxosman Apr 6, 2022
3948f9e
Bump minimist in /frontends/justice-counts/control-panel (#12016)
dependabot[bot] Apr 8, 2022
5232c1c
[Justice Counts][1/n] Initial work on Reports List View [Styles] (#12…
mxosman Apr 11, 2022
68567f6
Bump node-forge in /frontends/justice-counts/control-panel (#12121)
dependabot[bot] Apr 12, 2022
f5d2e54
[Justice Counts][2/n] Initial work on Reports List View [ReportStore,…
mxosman Apr 12, 2022
0565a73
[Justice Counts][3/n] Initial work on Reports List View [Report Year …
mxosman Apr 12, 2022
4178dc8
[Justice Counts][4/n] Initial work on Reports List View [Filter Repor…
mxosman Apr 12, 2022
5fffead
Update README: remove auth env instructions (#12233)
mxosman Apr 14, 2022
a1f63e0
[Justice Counts] Update ReportStore and UserStore to utilize agency a…
mxosman Apr 15, 2022
4864a75
[Justice Counts][1/k] Get `user_id` from Auth0 access token, rather t…
lilidworkin Apr 18, 2022
9392ea0
[Justice Counts] Creating A Report (#12295)
mxosman Apr 18, 2022
6206a3d
[Justice Counts] Update Styles To Match Latest Mocks (#12339)
mxosman Apr 19, 2022
0e2fab9
[Justice Counts] Store report overviews + report metrics in key value…
terryttsai Apr 19, 2022
4eee90c
[Justice Counts][2/k] Pass list of users's Auth0 permissions to front…
lilidworkin Apr 20, 2022
8a7a0e2
[Justice Counts] Fixes and updates to Authorization flows (#12380)
lilidworkin Apr 20, 2022
981baf9
[Justice Counts] Mock report response and display mocked response on …
terryttsai Apr 21, 2022
ee6a5a3
[Justice Counts] Only show Create Report button if user has permissio…
mxosman Apr 22, 2022
36d249e
[Justice Counts] Initial work on data entry view, form components, an…
mxosman Apr 22, 2022
e2f1566
[Justice Counts] Updating Metric Values (Metric, Contexts and Disaggr…
mxosman Apr 26, 2022
e9ffe01
[Justice Counts] Settings Page Scaffolding (#12526)
mxosman May 3, 2022
3807520
[Justice Counts] Create FormStore to Store & Update Form State (#12540)
mxosman May 4, 2022
1a1c374
[Justice Counts] Publish Data Confirmation Page (#12565)
mxosman May 4, 2022
0017bbb
[Justice Counts] Form Error Handling & Validation (#12618)
mxosman May 4, 2022
ebec765
[Justice Counts] Report Summary Panel (#12744)
mxosman May 4, 2022
58c761f
[Justice Counts] Bug fix within data entry component for play-testing…
mxosman May 4, 2022
2f35eb1
[Justice Counts] Key Form Inputs By Report ID (#12769)
mxosman May 5, 2022
c711116
Fix function that maps form values to full metric object (#12772)
mxosman May 5, 2022
32b9f14
Updating mocks to match actual metrics, minor styling adjustment (#12…
mxosman May 5, 2022
3cb7e6b
[Justice Counts] Implementing /reports/<report_id> [GET] (#12819)
mxosman May 6, 2022
ee03e50
Bump ejs from 3.1.6 to 3.1.7 in /frontends/justice-counts/control-pan…
dependabot[bot] May 9, 2022
4818ace
Allow development `docker-compose` apps to exercise `SQLAlchemyEngine…
ohaibbq May 9, 2022
7fa6b01
Reverts commits to unblock deploy (#12871)
elchao96 May 9, 2022
ad74162
[Justice Counts] Minor fixes from JC retreat work (#12912)
mxosman May 11, 2022
e55a765
Allow local `docker-compose` apps to exercise `SQLAlchemyEngineManage…
ohaibbq May 11, 2022
d2d9eb6
[Justice Counts] Implementing /reports/<report_id> [POST] & Updated M…
mxosman May 12, 2022
d902121
[Justice Counts] Report Editors & Last Modified Details (#12877)
mxosman May 12, 2022
9e50805
[Justice Counts] Loading state for reports view (#12977)
mxosman May 16, 2022
f3c55d9
Fix infinite loading on error (#13002)
mxosman May 16, 2022
8a40174
Move loadingOverview assignment outside of loop (#13006)
mxosman May 16, 2022
818e1bf
[Justice Counts] Validation & Form Handling Refactor (#12997)
mxosman May 17, 2022
86e5c55
[Justice Counts] Update Favicons & Logo (#13027)
mxosman May 18, 2022
f3000d1
[Justice Counts] Publish Confirmation w/ Full Metric Details (#12892)
mxosman May 18, 2022
654071a
[Justice Counts] Validation Adjustments (#13025)
mxosman May 19, 2022
3a1de0e
[Justice Counts] Prevent Publishing w/ No/Invalid Data (#13128)
mxosman May 25, 2022
7e97786
[Justice Counts][Design Updates][1/n] Colors & Typography (#13100)
mxosman May 25, 2022
a1de6e1
[Justice Counts][Design Updates][2/n] Header & Navigation (#13101)
mxosman May 25, 2022
10499e3
[Justice Counts][Design Updates][3/n] Report Overview (#13102)
mxosman May 25, 2022
1c29f8a
[Justice Counts][Design Updates][4/n] Text Input Field (#13103)
mxosman May 25, 2022
3f2428f
Fix displaying binary context options and clear input (#13135)
mxosman May 25, 2022
cb44730
[Justice Counts][Design Updates][5/n] Data Entry Form Updates (#13115)
mxosman May 26, 2022
9061c34
[Justice Counts][Design Updates][6/n] Report Summary Panel Updates [P…
mxosman May 31, 2022
795dea8
[Justice Counts] Make it possible to switch between agencies (#13152)
lilidworkin May 31, 2022
e7d9237
[Justice Counts][Design Additions][7/n] Simple Toast Component (#13160)
mxosman Jun 1, 2022
25c7812
[Justice Counts] New Create Report flow (#13182)
terryttsai Jun 2, 2022
960b43e
[Justice Counts][Frontend] Adjust Input Sanitization To Not Convert T…
mxosman Jun 3, 2022
99e0733
Add learn more link and open in new tab (#13253)
mxosman Jun 3, 2022
1e6dec2
[Justice Counts][Frontend] Truncate Overflowing Text (#13252)
mxosman Jun 3, 2022
88d1ade
[Justice Counts] Toasts for creating report (#13231)
terryttsai Jun 3, 2022
b3dfc37
[Justice Counts] Fixing up a few more date related issues (#13270)
lilidworkin Jun 4, 2022
cca45b9
Bump async in /frontends/justice-counts/control-panel (#13266)
dependabot[bot] Jun 6, 2022
946eef6
[Justice Counts] Change boolean context to multiple choice (#13233)
nichelle-hall Jun 6, 2022
aea2d67
fix-reports-header (#13322)
terryttsai Jun 6, 2022
751d480
Loading states for reports list and data entry, error state for data …
terryttsai Jun 6, 2022
b1dda68
[Justice Counts][Frontend] Autosave (#13213)
mxosman Jun 6, 2022
34af270
fix test warnings (#13328)
terryttsai Jun 6, 2022
8f124b8
Fix z-index of header bar (#13338)
mxosman Jun 7, 2022
1cd2019
[Justice Counts][Frontend] Temporarily Disable Settings Page (#13345)
mxosman Jun 7, 2022
5c5cdf4
[Justice Counts][2/n] Agencies can belong to multiple systems (part t…
lilidworkin Jun 8, 2022
d38add2
[Justice Counts][Frontend] Refer to users by name || email (#13347)
mxosman Jun 8, 2022
8e3b55f
Fix padding on additional context input (#13352)
mxosman Jun 8, 2022
f24378f
[Justice Counts][Frontend] Update Elapsed Days Print Out (#13346)
mxosman Jun 8, 2022
2b00cb4
[Justice Counts] Data entry responsive layout (#13353)
terryttsai Jun 8, 2022
96de6c6
remove temp save button (#13387)
terryttsai Jun 9, 2022
95cd40d
[Justice Counts] Fix bug in switching agencies (#13391)
lilidworkin Jun 9, 2022
91ea1d9
[Justice Counts][3/n] Frontend piece of allowing agencies to belong t…
lilidworkin Jun 9, 2022
273105f
[Justice Counts] Required context (#13390)
terryttsai Jun 10, 2022
98a8a13
[Justice Counts] Multiline support for additional contexts of type te…
terryttsai Jun 10, 2022
260c8d0
Extract normalizeToString function into helperUtils, add tests (#13397)
mxosman Jun 13, 2022
4fd0729
[Justice Counts][Frontend] Update display of metric description, defi…
mxosman Jun 13, 2022
87a3dc6
[Justice Counts] Refactor permissions structure #13441
lilidworkin Jun 13, 2022
fb58921
[Justice Counts] Modify Saving toast behavior (#13431)
terryttsai Jun 13, 2022
3385066
show all names in editors tooltip (#13491)
terryttsai Jun 15, 2022
7354779
[Justice Counts] Fix missing publish and go back link in create repor…
terryttsai Jun 15, 2022
ebd35d2
[Justice Counts] Publish Confirm responsive layout (#13488)
terryttsai Jun 15, 2022
82e1c4e
[Justice Counts][tiny] No more "Welcome, undefined at undefined" (#13…
lilidworkin Jun 16, 2022
161eaec
Format text input that accept numbers - add decimal support within fo…
mxosman Jun 16, 2022
6c29155
Adjust status indicators logic (#13470)
mxosman Jun 16, 2022
2691246
[Justice Counts] Put back the "switch agencies" permission (#13535)
lilidworkin Jun 16, 2022
cce7f48
fix case of width shrinking (#13543)
terryttsai Jun 16, 2022
b25682b
[Justice Counts] Remove "as string" cast + suppress lint warning (#13…
terryttsai Jun 17, 2022
ea67b76
Remove DataPreview component (#13588)
mxosman Jun 22, 2022
39d103a
[Justice Counts] Update Report Overview After Autosave (#13566)
mxosman Jun 22, 2022
d908924
[Justice Counts] Add tooltip to truncated fields (#13564)
mxosman Jun 22, 2022
718cea6
[Justice Counts] Only autosave the active metric (#13445)
lilidworkin Jun 23, 2022
c7cdcd1
[Justice Counts] API to delete a report (#13468)
lilidworkin Jun 24, 2022
fd373e1
Refactor FE to only get agencies and permissions from BE (#13627)
nichelle-hall Jun 24, 2022
6a04bd8
userstore fixes (#13630)
terryttsai Jun 24, 2022
8fa8c19
[Justice Counts] Fix duplicate error message when user is not attache…
lilidworkin Jun 28, 2022
65cc7ef
[Justice Counts] Users can update name and email (#13639)
nichelle-hall Jun 29, 2022
022ffc0
add success and error toasts to user settings page (#13697)
nichelle-hall Jul 1, 2022
90c1232
[Justice Counts] New Email Verification Page (#13750)
nichelle-hall Jul 1, 2022
602ec95
[Justice Counts][Frontend] Analytics for Publisher Control Panel (#13…
terryttsai Jul 5, 2022
8f832a7
[Justice Counts][Frontend][Design Updates] JC-Branded Loading Compone…
mxosman Jul 6, 2022
2451204
fix issue with context multiple choice buttons if two with the same c…
terryttsai Jul 6, 2022
c8f91c3
Handle viewing a report that has already been published (#13828)
terryttsai Jul 6, 2022
7dd021c
[Justice Counts][Frontend] First Run Experience (Onboarding) (#13650)
mxosman Jul 7, 2022
554f9f1
[Justice Counts][Frontend] Deleting Reports (#13845)
mxosman Jul 8, 2022
68339a2
[Justice Counts][Bug] CSRF: Re-Initialize Session & Retry Request Aft…
mxosman Jul 8, 2022
4f4e60b
[Justice Counts][Frontend] Remove inline analytics (#13894)
terryttsai Jul 8, 2022
a55d14c
[Justice Counts][Tiny] Rename "Cancel" -> "Back to Data Entry" #13915
lilidworkin Jul 11, 2022
02bf1ab
[Justice Counts][Frontend] Update validation text + error tooltip on …
terryttsai Jul 12, 2022
eef8520
[Justice Counts][Frontend] FRE: Data Entry Full Summary (#13899)
mxosman Jul 12, 2022
382f7f5
fix missing disabled states (#13996)
terryttsai Jul 14, 2022
e58b936
[Justice Counts][Frontend] Add agency data to reports analytic events…
terryttsai Jul 14, 2022
5118ffa
[Justice Counts][Frontend] Add load time analytics (#13993)
terryttsai Jul 14, 2022
814d0e9
[Justice Counts] Handle Auth0 "Login Required" error message (#14125)
lilidworkin Jul 26, 2022
67d72a2
[Justice Counts][Frontend][1/n] Metrics View UI (#14012)
mxosman Jul 27, 2022
84d4c69
[Justice Counts][Frontend][2/n] Metrics View UI State (#14147)
mxosman Jul 27, 2022
a92456e
Refactor: adjust the states and stateful components to new structure …
mxosman Jul 27, 2022
d6270a6
[Justice Counts][Frontend] Metrics View: Follow Ups (#14260)
mxosman Jul 28, 2022
dd303f9
[Justice Counts][Frontend] Metrics View - GET (#14262)
mxosman Jul 28, 2022
1d274a5
[Justice Counts] Don't allow one editor to overwrite another who had …
lilidworkin Jul 28, 2022
0253b0a
Readd scrolling behavior when moving to another metric (#14264)
mxosman Jul 28, 2022
56d9774
Implement metric filtering (#14266)
mxosman Jul 28, 2022
9ff8d66
[Justice Counts][Fix] Refresh Metric Settings & Breakdown UI Updates …
mxosman Jul 29, 2022
6fc1b35
Fix all lint warnings (#14235)
mxosman Jul 29, 2022
f1f2c8b
Bump terser in /frontends/justice-counts/control-panel (#14083)
dependabot[bot] Aug 1, 2022
601164c
[Justice Counts][Frontend][Bug] Sticky Report Title & Publish Confirm…
mxosman Aug 1, 2022
480d377
Set active metric key to the first filtered metric when switching to …
mxosman Aug 1, 2022
ceb68b7
Fix double nested form element (#14365)
mxosman Aug 2, 2022
674fdb3
[Justice Counts][Frontend] Remember current user agency across browse…
terryttsai Aug 2, 2022
2b33a24
[Justice Counts][Frontend][Playtesting] Hide Data Tab for Non-Admins …
mxosman Aug 3, 2022
993e040
[Justice Counts][Frontend][1/3] Data Entry Form Updates (#14302)
mxosman Aug 4, 2022
3d3d297
[Justice Counts][Frontend][Playtesting Fix] Saving (#14378)
mxosman Aug 4, 2022
25c0e66
[Justice Counts][Frontend][Playtesting] Metrics View: Error Retrievin…
mxosman Aug 4, 2022
94003c6
[Justice Counts][Frontend][Playtesting] Metrics View Design Updates (…
mxosman Aug 4, 2022
c3b3d66
[Justice Counts][Ingest][4/n] Small fixes + infer aggregate values if…
lilidworkin Aug 4, 2022
e6d420b
[Justice Counts][Frontend][Playtesting] Quick Debounce Save Refactor …
mxosman Aug 5, 2022
76a71b3
Fix header z-index (#14465)
mxosman Aug 5, 2022
aa0d960
[Justice Counts][Frontend][Playtesting] Prevent validation on disable…
mxosman Aug 8, 2022
dac1478
CreateReport styling fix (#14482)
mxosman Aug 8, 2022
8b59f86
[Justice Counts][Frontend] Fix ReportSummary Overflow (#14496)
mxosman Aug 8, 2022
012b103
[Justice Counts][Frontend] Badge Component (#14479)
mxosman Aug 8, 2022
563829c
[Justice Counts][Frontend] Data Upload: Modal Component (#14514)
mxosman Aug 11, 2022
36c3f8d
[Justice Counts][Frontend] Data Entry Page: Fix left panel heights in…
mxosman Aug 12, 2022
9971fd6
[Justice Counts][Frontend] Data Upload: API (#14588)
mxosman Aug 16, 2022
1373e87
Implement GET request for list of uploaded spreadsheets (#14661)
mxosman Aug 17, 2022
5ba6b1e
[Justice Counts][Frontend] Data Upload: Download Spreadsheet (#14690)
mxosman Aug 18, 2022
2636093
[Justice Counts][Frontend] Data Upload: Instructions (#14686)
mxosman Aug 18, 2022
6a73c53
[Justice Counts][Frontend] Data Upload: Loading & Error States (#14699)
mxosman Aug 19, 2022
3c69878
[Justice Counts] Take a pass over the General Instructions for Data U…
lilidworkin Aug 19, 2022
e7f877e
[Justice Counts][Frontend] Metrics Data Viz (#14576)
terryttsai Aug 23, 2022
14e6677
[Justice Counts][Frontend][1/2] Data Upload: Playtesting Follow Up (#…
mxosman Aug 23, 2022
e17cb73
Update getUploadedFilesList - update path and sends current agency ID…
mxosman Aug 23, 2022
d3a4f6b
[Justice Counts] System-specific Instructions for Data Upload (#14791)
lilidworkin Aug 24, 2022
bce5072
[Justice Counts][Frontend] Data Upload: Select System to Upload (for …
mxosman Aug 24, 2022
c5a8a56
[Justice Counts][Frontend][2/2] Data Upload: Playtesting Follow Up (#…
mxosman Aug 24, 2022
f6e8bfb
[Justice Counts][Frontend] Data Viz visual tweaks (#14828)
terryttsai Aug 24, 2022
29c4cee
[Justice Counts][Frontend][Fix] Data Upload: Small Fix for Download T…
mxosman Aug 25, 2022
b5f3341
[Justice Counts] Fix link to Courts metrics #14847
lilidworkin Aug 25, 2022
1876696
Ungate delete button and adjust styles (#14853)
mxosman Aug 25, 2022
5dae81b
remove configure metrics (#14852)
terryttsai Aug 25, 2022
b96a7a7
z-index close button (#14855)
mxosman Aug 25, 2022
3c373f8
update api names to conform with flask app best practices (#14827)
nichelle-hall Aug 29, 2022
346abc3
Fix jest test failure by mocking `new Date()` (#14937)
terryttsai Aug 29, 2022
2402e3f
[Justice Counts][Frontend][Bug Bash] Replace Intersection Observer (#…
mxosman Aug 30, 2022
41f0bf7
[Justice Counts][Frontend][Bug Bash] Data Entry: System Title Divisor…
mxosman Aug 30, 2022
91f2ecb
[Justice Counts][Frontend][Bug Bash] Metrics View: Filter By System (…
mxosman Aug 30, 2022
537ab40
[Justice Counts][Frontend] Show all unreported metric dimensions in d…
terryttsai Aug 31, 2022
6bdc42b
Rename cases rejected to cases declined (#14933)
nichelle-hall Aug 31, 2022
761b343
[Justice Counts][Frontend] Data Viz Insights Row (#15019)
terryttsai Sep 3, 2022
47b3a83
[Justice Counts][Frontend] Data Upload v1: UI Update (#15085)
mxosman Sep 9, 2022
08dd17d
merge
lilidworkin Sep 13, 2022
ba91823
fix readme
lilidworkin Sep 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# justice-counts

Technical infrastructure for the Justice Counts initiative
30 changes: 30 additions & 0 deletions publisher/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Justice Counts Control Panel: Frontend

Welcome to the Justice Counts Control Panel - a tool that allows agencies to report Justice Counts metrics.

The frontend of this application, which lives in this directory, was bootstrapped with [Create React App](https://github.com/facebook/create-react-app), written in [TypeScript](https://www.typescriptlang.org/docs), and authenticated via [Auth0](https://auth0.com/). The backend of the application lives in [recidiviz-data/justice_counts/control_panel](https://github.com/Recidiviz/recidiviz-data/tree/main/recidiviz/justice_counts/control_panel).

To run the app locally, you need to spin up both the backend and frontend simultaneously. Instructions for spinning up the frontend are below; instructions for spinning up the backend can be found in its directory's README.

## Running the app frontend

1. Install dependencies

##### For all Yarn installation options, see [Yarn Installation](https://yarnpkg.com/en/docs/install).

```sh
yarn install
```

2. Run the local development server

```sh
yarn run dev
```

3. Test your development environment

```sh
yarn test
yarn lint
```
103 changes: 103 additions & 0 deletions publisher/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"name": "recidiviz-justice-counts-control-panel",
"version": "0.1.0",
"description": "A tool that allows agencies to report Justice Counts metrics",
"private": true,
"author": "Recidiviz <[email protected]>",
"license": "GNU General Public License v3",
"dependencies": {
"@auth0/auth0-react": "^1.9.0",
"@recidiviz/design-system": "^2.7.0",
"@testing-library/dom": "^8.11.3",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.2.1",
"lodash.debounce": "^4.0.8",
"lodash.mapvalues": "^4.6.0",
"lodash.pickby": "^4.6.0",
"mobx": "^6.4.2",
"mobx-persist-store": "^1.0.6",
"mobx-react-lite": "^3.3.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-is": "^17.0.2",
"react-router-dom": "^6",
"react-scripts": "5.0.0",
"recharts": "^2.1.13",
"styled-components": "^5.3.3",
"typescript": "^4.4.2",
"web-vitals": "^2.1.0"
},
"scripts": {
"dev": "react-scripts start",
"build": "react-scripts build",
"lint": "tsc && eslint '**/*.{ts,tsx}'",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"@recidiviz/eslint-config",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"homepage": "/",
"proxy": "http://localhost:5001",
"devDependencies": {
"@auth0/auth0-spa-js": "^1.20.1",
"@babel/core": "^7.0.0-0",
"@babel/plugin-syntax-flow": "^7.14.5",
"@babel/plugin-transform-react-jsx": "^7.14.9",
"@recidiviz/eslint-config": "^2.0.0",
"@recidiviz/tsconfig": "^1.0.0",
"@types/auth0": "^2.34.13",
"@types/jest": "^27.0.1",
"@types/lodash": "^4.14.182",
"@types/lodash.debounce": "^4.0.7",
"@types/node": "^16.7.13",
"@types/qs": "^6.9.7",
"@types/reach__router": "^1.3.10",
"@types/react": "^17.0.20",
"@types/react-dom": "^17.0.9",
"@types/react-modal": "^3.13.1",
"@types/react-router-dom": "^5.3.3",
"@types/styled-components": "^5.1.24",
"@typescript-eslint/eslint-plugin": "^5.15.0",
"@typescript-eslint/parser": "^5.15.0",
"autoprefixer": "^10.0.2",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.3",
"eslint": "^8.11.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-config-react-app": "^7.0.0",
"eslint-import-resolver-typescript": "^2.5.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"jest-fetch-mock": "^3.0.3",
"postcss": "^8.1.0",
"prettier": "^2.6.0",
"react-modal": "^3.14.4"
},
"jest": {
"moduleNameMapper": {
"^d3-(.*)$": "d3-$1/dist/d3-$1"
}
}
}
Binary file added publisher/public/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added publisher/public/android-chrome-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added publisher/public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added publisher/public/assets/COURTS_AND_PRETRIAL.xlsx
Binary file not shown.
Binary file added publisher/public/assets/DEFENSE.xlsx
Binary file not shown.
Binary file added publisher/public/assets/JAILS.xlsx
Binary file not shown.
Binary file added publisher/public/assets/LAW_ENFORCEMENT.xlsx
Binary file not shown.
Binary file added publisher/public/assets/PRISONS.xlsx
Binary file not shown.
Binary file added publisher/public/assets/PROSECUTION.xlsx
Binary file not shown.
Binary file added publisher/public/assets/SUPERVISION.xlsx
Binary file not shown.
Binary file added publisher/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added publisher/public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added publisher/public/favicon.ico
Binary file not shown.
50 changes: 50 additions & 0 deletions publisher/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Justice Counts | Control Panel</title>

<script src="%PUBLIC_URL%/app_public_config.js"></script>

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">

</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
20 changes: 20 additions & 0 deletions publisher/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"short_name": "Control Panel",
"name": "Control Panel by Recidiviz",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"start_url": ".",
"display": "browser",
"theme_color": "#014c48",
"background_color": "#014c48"
}
3 changes: 3 additions & 0 deletions publisher/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
55 changes: 55 additions & 0 deletions publisher/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Recidiviz - a data platform for criminal justice reform
// Copyright (C) 2022 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 createAuth0Client from "@auth0/auth0-spa-js";
import { render, screen } from "@testing-library/react";
import React from "react";

import App from "./App";
import AuthWall from "./components/Auth";
import { StoreProvider } from "./stores";

jest.mock("@auth0/auth0-spa-js");

const mockCreateAuth0Client = createAuth0Client as jest.Mock;
const mockIsAuthenticated = jest.fn();
const mockLoginWithRedirect = jest.fn();

beforeEach(() => {
mockCreateAuth0Client.mockResolvedValue({
isAuthenticated: mockIsAuthenticated,
loginWithRedirect: mockLoginWithRedirect,
});
});

afterEach(() => {
jest.resetAllMocks();
});

test("renders loading on load", () => {
render(
<StoreProvider>
<AuthWall>
<App />
</AuthWall>
</StoreProvider>
);
const loader = screen.getByTestId("loading");
expect(loader).toBeInTheDocument();

expect.hasAssertions();
});
56 changes: 56 additions & 0 deletions publisher/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Recidiviz - a data platform for criminal justice reform
// Copyright (C) 2022 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 { observer } from "mobx-react-lite";
import React, { ReactElement, useEffect } from "react";
import { Route, Routes, useLocation } from "react-router-dom";

import { trackNavigation } from "./analytics";
import { DataUpload } from "./components/DataUpload";
import { PageWrapper } from "./components/Forms";
import Header from "./components/Header";
import { MetricsView } from "./components/MetricsView";
import CreateReports from "./components/Reports/CreateReport";
import ReportDataEntry from "./components/Reports/ReportDataEntry";
import AccountSettings from "./pages/AccountSettings";
import Reports from "./pages/Reports";

const App: React.FC = (): ReactElement => {
const location = useLocation();
useEffect(() => {
trackNavigation(location.pathname + location.search);
}, [location]);

return (
<>
<PageWrapper>
<Header />

<Routes>
<Route path="/" element={<Reports />} />
<Route path="/reports/create" element={<CreateReports />} />
<Route path="/reports/:id" element={<ReportDataEntry />} />
<Route path="/settings" element={<AccountSettings />} />
<Route path="/metrics" element={<MetricsView />} />
<Route path="/upload" element={<DataUpload />} />
</Routes>
</PageWrapper>
</>
);
};

export default observer(App);
Loading