Skip to content

Commit 9e587bb

Browse files
authored
Merge branch 'master' into Issue-181
2 parents 2e97a21 + d5134c5 commit 9e587bb

17 files changed

+961
-71
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ Currently, they are storing data from their programs in separate Excel spreadshe
88

99
This project would work to migrate all of the disparate data sources into one system, make a UI that allows Prevention Point to access all participant data in one system, and increase the ease with which program coordinators can evaluate and monitor activities.
1010

11+
## Before Contributing:
12+
13+
* Read through the [Wiki](https://github.com/CodeForPhilly/prevention-point/wiki).
14+
* Familiarize yourself with the agreed upon project [change management practices](https://github.com/CodeForPhilly/prevention-point/wiki/Change-Management-Practices).
15+
1116
## [Code of Conduct](https://codeforphilly.org/pages/code_of_conduct/)
1217

1318
This is a Code for Philly project operating under their code of conduct.

firstPR.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

frontend/fixtures/MockQueueData.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export const caseManagementQueueData = {
1111
waitTime: "10 minutes",
1212
length: 2,
1313
rows: [
14-
createData(1, "FL159", "Last", "1:23 PM", "checkedIn", true),
15-
createData(1, "FL237", "Last", "1:23 PM", "checkedIn", false),
14+
createData(1, "FL159", "Last", "1:23 PM", "Waiting", true),
15+
createData(1, "FL237", "Last", "1:23 PM", "Waiting", false),
1616
],
1717
}
1818
export const legalServicesQueueData = {
@@ -21,9 +21,9 @@ export const legalServicesQueueData = {
2121
waitTime: "5 minutes",
2222
length: 3,
2323
rows: [
24-
createData(1, "FL262", "Last", "1:23 PM", "checkedIn", false),
25-
createData(1, "FL305", "Last", "1:23 PM", "checkedIn", false),
26-
createData(3, "FL356", "Last", "1:23 PM", "checkedIn", false),
24+
createData(1, "FL262", "Last", "1:23 PM", "Waiting", false),
25+
createData(1, "FL305", "Last", "1:23 PM", "Waiting", false),
26+
createData(3, "FL356", "Last", "1:23 PM", "Waiting", false),
2727
],
2828
}
2929
export const stepQueueData = {
@@ -32,10 +32,10 @@ export const stepQueueData = {
3232
waitTime: "7 minutes",
3333
length: 5,
3434
rows: [
35-
createData(1, "FL159", "Last", "1:23 PM", "checkedIn", false),
36-
createData(1, "FL237", "Last", "1:23 PM", "checkedIn", false),
37-
createData(3, "FL262", "Last", "1:23 PM", "checkedIn", true),
38-
createData(1, "FL305", "Last", "1:23 PM", "checkedIn", false),
39-
createData(5, "FL356", "Last", "1:23 PM", "checkedIn", true),
35+
createData(1, "FL159", "Last", "1:23 PM", "Waiting", false),
36+
createData(1, "FL237", "Last", "1:23 PM", "Waiting", false),
37+
createData(3, "FL262", "Last", "1:23 PM", "Waiting", true),
38+
createData(1, "FL305", "Last", "1:23 PM", "Waiting", false),
39+
createData(5, "FL356", "Last", "1:23 PM", "Waiting", true),
4040
],
4141
}

frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"moment": "^2.24.0",
6262
"node-sass": "^4.11.0",
6363
"prop-types": "^15.7.2",
64+
"query-string": "^6.9.0",
6465
"react": "^16.3.0",
6566
"react-dom": "^16.3.0",
6667
"react-router-dom": "^5.1.2",

frontend/src/api/index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import apisauce from "apisauce"
22
import createAuthRefreshInterceptor from "axios-auth-refresh"
33
import refreshAuthLogic from "./refreshAuthLogic"
4-
import { getParticipants } from "./participantEndpoints"
4+
import {
5+
getParticipants,
6+
createParticipant,
7+
updateParticipant,
8+
} from "./participantEndpoints"
59
import { createToken, verifyToken } from "./authEndpoints"
610
import { getQueue } from "./queueEndpoints"
711
import { postFrontDeskEvent } from "./frontDeskEventEndpoints"
@@ -11,6 +15,8 @@ import {
1115
createVisits,
1216
patchVisit,
1317
} from "./visitEndpoints"
18+
import { getInsurers } from "./insurersEndpoints"
19+
import { getPrograms } from "./programEndpoints"
1420

1521
const create = () => {
1622
const api = apisauce.create({
@@ -34,10 +40,14 @@ const create = () => {
3440
getQueue: getQueue(api),
3541
postFrontDeskEvent: postFrontDeskEvent(api),
3642
getParticipants: getParticipants(api),
43+
createParticipant: createParticipant(api),
44+
updateParticipant: updateParticipant(api),
3745
getVisits: getVisits(api),
3846
updateVisits: updateVisits(api),
3947
createVisits: createVisits(api),
4048
patchVisit: patchVisit(api),
49+
getInsurers: getInsurers(api),
50+
getPrograms: getPrograms(api),
4151
}
4252
}
4353

frontend/src/api/insurersEndpoints.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const getInsurers = api => async () => await api.get("insurers/")
Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,35 @@
1-
export const getParticipants = api => async params =>
2-
await api.get("participants/", params)
1+
import queryString from "query-string"
2+
3+
const removeEmptyParams = params => {
4+
let filteredParams = {}
5+
for (const key in params) {
6+
if (["", null, undefined].includes(params[key])) continue
7+
filteredParams[key] = params[key]
8+
}
9+
return filteredParams
10+
}
11+
12+
export const getParticipants = api => async params => {
13+
const queryParams = queryString.stringify(removeEmptyParams(params))
14+
return await api.get(
15+
queryParams ? `participants?${queryParams}` : "participants"
16+
)
17+
}
18+
19+
export const getParticipantById = api => async id =>
20+
await api.get(`participants/${id}/`)
21+
22+
export const getParticipantByName = api => async (firstname, lastname) =>
23+
await api.get(`participants/?first_name=${firstname}&last_name=${lastname}`)
24+
25+
export const getParticipant = api => async id =>
26+
await api.get(`/participants/${id}`)
27+
28+
export const updateParticipant = api => async (id, body) =>
29+
await api.put(`/participants/${id}/`, body)
30+
31+
export const createParticipant = api => async body =>
32+
await api.post("/participants/", body)
33+
34+
// export const postParticipant = api => async (id, body) =>
35+
// await api.post(`/participant/${id}`, body)

frontend/src/api/programEndpoints.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const getPrograms = api => async () => await api.get("programs/")

frontend/src/components/AllQueues.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,14 @@ const AllQueues = observer(() => {
9696
//Update all queues on first rendering
9797
useEffect(() => {
9898
for (let i = 1; i <= queueSize; i++) queueStore.getQueue(i)
99-
}, [queueSize, queueStore])
99+
//eslint-disable-next-line react-hooks/exhaustive-deps
100+
}, [])
100101

101102
//Update queue of selected tab
102103
useEffect(() => {
103104
queueStore.getQueue(tabValue + 1)
104-
}, [queueStore, tabValue])
105+
//eslint-disable-next-line react-hooks/exhaustive-deps
106+
}, [tabValue])
105107

106108
const tabArray = []
107109
for (let i = 1; i <= queueSize; i++) {

0 commit comments

Comments
 (0)