Skip to content

Commit b9f0ab0

Browse files
showmentlimlindsayjmaithyy
authored
Create form preview (#138)
* Update frontend + add location * save and cancel buttons work, no location * locations fixed * Update alert modal for cancelling * Get data from endpoints & create initial frontend * Small change * implement features for form preview * styling drawer showing question and answer * fixing merge conflicts * minimize unnecessary changes * Refactored print form to stop the errors * use case switch * Fixed case manager monthly stats retrieval * render form item name if name exists * frontend done, logic is messed up * fix imports * fixed editing feature * request form preview stuff * what * new table bodies * fixed scroll * fixed front desk monthly form put route * add new forms for admin only * add functionality to request admin to see form * small fix --------- Co-authored-by: Lindsay Lim <limlindsayj@gmail.com> Co-authored-by: maithyy <maithyle265@yahoo.com>
1 parent 5ea8868 commit b9f0ab0

23 files changed

+4013
-257
lines changed

client/src/components/clientPage/editFormModals/ExitSurveyModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
useToast,
2222
} from "@chakra-ui/react";
2323
import { useBackendContext } from "../../../contexts/hooks/useBackendContext";
24-
import PrintForm from "../../../printForm/PrintForm";
24+
import PrintForm from "../../printForm/PrintForm";
2525
import { exitSurvey } from "../types/ExitSurvey";
2626

2727
interface ExitSurveyModalProps {

client/src/components/clientPage/subComponents/childrenCards.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
} from "@chakra-ui/react";
1818
import { useBackendContext } from "../../../contexts/hooks/useBackendContext";
1919
import toSnakeCase from "../../../utils/snakeCase";
20-
import image from "./pfp.jpeg";
20+
import image from "../pfp.jpeg";
2121
import { Children } from "../ViewPage";
2222

2323
interface ChildrenProps {

client/src/components/clientPage/subComponents/forms.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
useDisclosure,
1212
} from "@chakra-ui/react";
1313
import { FormsProps } from "../types";
14-
import PrintForm from "../../../printForm/PrintForm";
14+
import PrintForm from "../../printForm/PrintForm";
1515
import ExitSurveyModal from "../editFormModals/ExitSurveyModal";
1616
import SuccessStoryModal from "../editFormModals/SuccessStoryModal";
1717
import InitialInterviewModal from "../editFormModals/InitialInterviewModal";
Lines changed: 343 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,343 @@
1+
import { Td, Tr } from "@chakra-ui/react";
2+
3+
import {
4+
NumberInputComponent,
5+
TextInputComponent,
6+
} from "../intakeStatsForm/formComponents";
7+
8+
export const CaseManagerMonthlyTableBody = ({
9+
formData,
10+
handleChange,
11+
}: {
12+
formData: Record<string, any>;
13+
handleChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>) => void;
14+
}) => {
15+
return (
16+
<>
17+
<Tr>
18+
<Td fontSize="medium">Date</Td>
19+
<Td>
20+
<TextInputComponent
21+
name="date"
22+
value={formData.date}
23+
onChange={handleChange}
24+
type="date"
25+
width="100%"
26+
/>
27+
</Td>
28+
</Tr>
29+
<Tr>
30+
<Td fontSize="medium">Case Manager ID</Td>
31+
<Td>
32+
<NumberInputComponent
33+
name="cmId"
34+
value={formData.cmId}
35+
onChange={handleChange}
36+
min={0}
37+
width="100%"
38+
/>
39+
</Td>
40+
</Tr>
41+
<Tr>
42+
<Td fontSize="medium">Total Number of Contacts</Td>
43+
<Td>
44+
<NumberInputComponent
45+
name="totalNumberOfContacts"
46+
value={formData.totalNumberOfContacts}
47+
onChange={handleChange}
48+
min={0}
49+
width="100%"
50+
/>
51+
</Td>
52+
</Tr>
53+
<Tr>
54+
<Td fontSize="medium">Women's Birthdays</Td>
55+
<Td>
56+
<NumberInputComponent
57+
name="womenBirthdays"
58+
value={formData.womenBirthdays}
59+
onChange={handleChange}
60+
min={0}
61+
width="100%"
62+
/>
63+
</Td>
64+
</Tr>
65+
<Tr>
66+
<Td fontSize="medium">Kid's Birthdays</Td>
67+
<Td>
68+
<NumberInputComponent
69+
name="kidBirthdays"
70+
value={formData.kidBirthdays}
71+
onChange={handleChange}
72+
min={0}
73+
width="100%"
74+
/>
75+
</Td>
76+
</Tr>
77+
<Tr>
78+
<Td fontSize="medium">Birthday Cards Given</Td>
79+
<Td>
80+
<NumberInputComponent
81+
name="birthdayCards"
82+
value={formData.birthdayCards}
83+
onChange={handleChange}
84+
min={0}
85+
width="100%"
86+
/>
87+
</Td>
88+
</Tr>
89+
<Tr>
90+
<Td fontSize="medium">Value of Birthday Cards</Td>
91+
<Td>
92+
<NumberInputComponent
93+
name="birthdayCardsValue"
94+
value={formData.birthdayCardsValue}
95+
onChange={handleChange}
96+
min={0}
97+
width="100%"
98+
/>
99+
</Td>
100+
</Tr>
101+
<Tr>
102+
<Td fontSize="medium">Food Cards Given</Td>
103+
<Td>
104+
<NumberInputComponent
105+
name="foodCards"
106+
value={formData.foodCards}
107+
onChange={handleChange}
108+
min={0}
109+
width="100%"
110+
/>
111+
</Td>
112+
</Tr>
113+
<Tr>
114+
<Td fontSize="medium">Value of Food Cards</Td>
115+
<Td>
116+
<NumberInputComponent
117+
name="foodCardsValue"
118+
value={formData.foodCardsValue}
119+
onChange={handleChange}
120+
min={0}
121+
width="100%"
122+
/>
123+
</Td>
124+
</Tr>
125+
<Tr>
126+
<Td fontSize="medium">Bus Passes Given</Td>
127+
<Td>
128+
<NumberInputComponent
129+
name="busPasses"
130+
value={formData.busPasses}
131+
onChange={handleChange}
132+
min={0}
133+
width="100%"
134+
/>
135+
</Td>
136+
</Tr>
137+
<Tr>
138+
<Td fontSize="medium">Value of Bus Passes</Td>
139+
<Td>
140+
<NumberInputComponent
141+
name="busPassesValue"
142+
value={formData.busPassesValue}
143+
onChange={handleChange}
144+
min={0}
145+
width="100%"
146+
/>
147+
</Td>
148+
</Tr>
149+
<Tr>
150+
<Td fontSize="medium">Gas Cards Given</Td>
151+
<Td>
152+
<NumberInputComponent
153+
name="gasCards"
154+
value={formData.gasCards}
155+
onChange={handleChange}
156+
min={0}
157+
width="100%"
158+
/>
159+
</Td>
160+
</Tr>
161+
<Tr>
162+
<Td fontSize="medium">Value of Gas Cards</Td>
163+
<Td>
164+
<NumberInputComponent
165+
name="gasCardsValue"
166+
value={formData.gasCardsValue}
167+
onChange={handleChange}
168+
min={0}
169+
width="100%"
170+
/>
171+
</Td>
172+
</Tr>
173+
<Tr>
174+
<Td fontSize="medium">Women's Healthcare Referrals</Td>
175+
<Td>
176+
<NumberInputComponent
177+
name="womenHealthcareReferrals"
178+
value={formData.womenHealthcareReferrals}
179+
onChange={handleChange}
180+
min={0}
181+
width="100%"
182+
/>
183+
</Td>
184+
</Tr>
185+
<Tr>
186+
<Td fontSize="medium">Kid's Healthcare Referrals</Td>
187+
<Td>
188+
<NumberInputComponent
189+
name="kidHealthcareReferrals"
190+
value={formData.kidHealthcareReferrals}
191+
onChange={handleChange}
192+
min={0}
193+
width="100%"
194+
/>
195+
</Td>
196+
</Tr>
197+
<Tr>
198+
<Td fontSize="medium">Women's Counseling Referrals</Td>
199+
<Td>
200+
<NumberInputComponent
201+
name="womenCounselingReferrals"
202+
value={formData.womenCounselingReferrals}
203+
onChange={handleChange}
204+
min={0}
205+
width="100%"
206+
/>
207+
</Td>
208+
</Tr>
209+
<Tr>
210+
<Td fontSize="medium">Kid's Counseling Referrals</Td>
211+
<Td>
212+
<NumberInputComponent
213+
name="kidCounselingReferrals"
214+
value={formData.kidCounselingReferrals}
215+
onChange={handleChange}
216+
min={0}
217+
width="100%"
218+
/>
219+
</Td>
220+
</Tr>
221+
<Tr>
222+
<Td fontSize="medium">Babies Born</Td>
223+
<Td>
224+
<NumberInputComponent
225+
name="babiesBorn"
226+
value={formData.babiesBorn}
227+
onChange={handleChange}
228+
min={0}
229+
width="100%"
230+
/>
231+
</Td>
232+
</Tr>
233+
<Tr>
234+
<Td fontSize="medium">Degrees Earned by Women</Td>
235+
<Td>
236+
<NumberInputComponent
237+
name="womenDegreesEarned"
238+
value={formData.womenDegreesEarned}
239+
onChange={handleChange}
240+
min={0}
241+
width="100%"
242+
/>
243+
</Td>
244+
</Tr>
245+
<Tr>
246+
<Td fontSize="medium">Women Enrolled in School</Td>
247+
<Td>
248+
<NumberInputComponent
249+
name="womenEnrolledInSchool"
250+
value={formData.womenEnrolledInSchool}
251+
onChange={handleChange}
252+
min={0}
253+
width="100%"
254+
/>
255+
</Td>
256+
</Tr>
257+
<Tr>
258+
<Td fontSize="medium">Licenses Earned by Women</Td>
259+
<Td>
260+
<NumberInputComponent
261+
name="womenLicensesEarned"
262+
value={formData.womenLicensesEarned}
263+
onChange={handleChange}
264+
min={0}
265+
width="100%"
266+
/>
267+
</Td>
268+
</Tr>
269+
<Tr>
270+
<Td fontSize="medium">Family Reunifications</Td>
271+
<Td>
272+
<NumberInputComponent
273+
name="reunifications"
274+
value={formData.reunifications}
275+
onChange={handleChange}
276+
min={0}
277+
width="100%"
278+
/>
279+
</Td>
280+
</Tr>
281+
<Tr>
282+
<Td fontSize="medium">Interviews Conducted</Td>
283+
<Td>
284+
<NumberInputComponent
285+
name="numberOfInterviewsConducted"
286+
value={formData.numberOfInterviewsConducted}
287+
onChange={handleChange}
288+
min={0}
289+
width="100%"
290+
/>
291+
</Td>
292+
</Tr>
293+
<Tr>
294+
<Td fontSize="medium">Positive Tests</Td>
295+
<Td>
296+
<NumberInputComponent
297+
name="numberOfPositiveTests"
298+
value={formData.numberOfPositiveTests}
299+
onChange={handleChange}
300+
min={0}
301+
width="100%"
302+
/>
303+
</Td>
304+
</Tr>
305+
<Tr>
306+
<Td fontSize="medium">NCNs</Td>
307+
<Td>
308+
<NumberInputComponent
309+
name="numberOfNcns"
310+
value={formData.numberOfNcns}
311+
onChange={handleChange}
312+
min={0}
313+
width="100%"
314+
/>
315+
</Td>
316+
</Tr>
317+
<Tr>
318+
<Td fontSize="medium">Other</Td>
319+
<Td>
320+
<NumberInputComponent
321+
name="numberOfOthers"
322+
value={formData.numberOfOthers}
323+
onChange={handleChange}
324+
min={0}
325+
width="100%"
326+
/>
327+
</Td>
328+
</Tr>
329+
<Tr>
330+
<Td fontSize="medium">Interviews Accepted</Td>
331+
<Td>
332+
<NumberInputComponent
333+
name="numberOfInterviewsAccpeted"
334+
value={formData.numberOfInterviewsAccpeted}
335+
onChange={handleChange}
336+
min={0}
337+
width="100%"
338+
/>
339+
</Td>
340+
</Tr>
341+
</>
342+
);
343+
};

0 commit comments

Comments
 (0)