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

Vsr individual #17

Merged
merged 86 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
97d1bc2
Added folders for page routing
Syu125 Jan 18, 2024
2e91d71
lint fixes
2s2e Jan 19, 2024
2882ed1
Added route to POST and VSR controller
yotzkim Jan 19, 2024
90480d7
Added basic contents for individual view
Syu125 Jan 22, 2024
9389a96
Formatted content and added fonts
Syu125 Jan 22, 2024
4806553
Fixed some formatting, specifically for Contact Info
Syu125 Jan 25, 2024
fcd2f38
Added all contents for the sections (working on details and component…
Syu125 Jan 25, 2024
bd86e86
Added validation functions for form responses
2s2e Jan 26, 2024
c5f9be6
Added validation functions for form responses
2s2e Jan 26, 2024
191d148
Removed numOfBoys, numOfGirls from schema, cleaned up backend, rename…
2s2e Jan 26, 2024
b962925
Added tests for validate spouse name
2s2e Jan 26, 2024
4bbf60c
Added tests for validate ethnicity
2s2e Jan 26, 2024
9c8791b
Basic text field, multiple choice, dropdown, and submit
yotzkim Jan 28, 2024
ae56430
Fix linting issues and minor edit to gender field validation
yotzkim Jan 28, 2024
713a852
Basic components
yotzkim Jan 28, 2024
17b3bd5
Added top buttons and remaining detail styles (need to fix fonts and …
Syu125 Jan 29, 2024
aa064e2
app now uses post route
2s2e Jan 29, 2024
1cf38cf
Attempt at linking front end with back end, onbooarding code for fron…
2s2e Jan 30, 2024
ef8da1c
Reworked TextField component to do ref-forwarding, successfully pushe…
2s2e Jan 30, 2024
6bfbf3c
Finished formatting page content (need to add function to buttons)
Syu125 Jan 30, 2024
e84c5a0
Fixed couple bugs with date verification
2s2e Jan 31, 2024
9ea7802
Removed forwardRef
yotzkim Jan 31, 2024
bb4e877
Resolved merge conflicts between local and remote branches.
yotzkim Jan 31, 2024
2ad0630
Minor commit before merging in branch
Syu125 Feb 1, 2024
2efd132
Merge branch 'feature/steven+yoto-vsr-personal-info' into vsr_individual
Syu125 Feb 1, 2024
45b7de1
Backend connection works - able to retrieve data
Syu125 Feb 2, 2024
f1d112d
Retrieved more data and removed the hard-coded values
Syu125 Feb 2, 2024
9dc911b
Added title and description, required fields, and overall more styling
yotzkim Feb 5, 2024
3a36749
updated date to use current date, added more fields for the vsr page
2s2e Feb 6, 2024
5c4f986
Prototype of ethnicity selector
2s2e Feb 6, 2024
361c880
Made options unselectable
2s2e Feb 9, 2024
c7a9650
Working version of ethnicity form
2s2e Feb 9, 2024
7d400fc
Finished frontend
Syu125 Feb 9, 2024
d14e4bb
Prototype of appearing and disappearing children form
2s2e Feb 9, 2024
bf622fd
Finalized frontent with last button and N/A styling
Syu125 Feb 9, 2024
8e60996
Removed unused variables
Syu125 Feb 9, 2024
ea60d12
Modified unused message variable in requests.ts
Syu125 Feb 9, 2024
21d5120
Added sample data file
Syu125 Feb 9, 2024
7632444
Added gap between list items
Syu125 Feb 9, 2024
3edbd5d
Removed padding after list items
Syu125 Feb 10, 2024
07564f3
Moved components folder out of app director
Syu125 Feb 10, 2024
2a68894
Removed package-lock json
Syu125 Feb 10, 2024
9c2aad9
Removed package lock json from backend
Syu125 Feb 10, 2024
eb2f548
Add package lock back to backend
Syu125 Feb 10, 2024
50f5cdf
Add package lock back to frontend
Syu125 Feb 10, 2024
23e7258
Updated packag lock for frontend
Syu125 Feb 10, 2024
8ce9e83
Added cache section to frontent package json
Syu125 Feb 10, 2024
e51fcf7
Add next SWC to frontend package-lock.json
benjaminJohnson2204 Feb 10, 2024
f0e8354
Updated display to check empty lists, routed toDashboard, removed unu…
Syu125 Feb 10, 2024
deacec0
Created subfolders for components, fixed scrolling for dropdown, adde…
Syu125 Feb 11, 2024
fdabcff
Remove unused code
benjaminJohnson2204 Feb 11, 2024
a0d27b6
Minor styling fixes to status dropdown
benjaminJohnson2204 Feb 11, 2024
1da8f7c
Rename UserTag to VeteranTag, move individual getVSR, change name dis…
Syu125 Feb 11, 2024
1f2fec8
Use semantic HTML for VSR individual buttons
benjaminJohnson2204 Feb 11, 2024
82137bb
Accordion accessibility improvements
benjaminJohnson2204 Feb 11, 2024
21f6579
Added more styling
yotzkim Feb 11, 2024
8a8a6f5
Added more styling
yotzkim Feb 12, 2024
102fe1f
Added backend functionality for ages, changed Child #n name to Child …
2s2e Feb 14, 2024
2375b64
Fixed small bug with ethnicity, added numBoys and spouse to createVSR…
yotzkim Feb 14, 2024
4c62275
Fixed small bug with ethnicity, added numBoys and spouse to createVSR…
yotzkim Feb 14, 2024
3de89d6
fixed issue with ethnicity selection
2s2e Feb 16, 2024
33df593
merge conflict resolve
2s2e Feb 16, 2024
3981b09
Changed textbox styling to flex 1
yotzkim Feb 16, 2024
4a2fee2
Styling
yotzkim Feb 16, 2024
31bc3f8
Fixed issue with null values in age array
2s2e Feb 16, 2024
bfade0b
Page number component
yotzkim Feb 16, 2024
4146ee3
Page Number component
yotzkim Feb 16, 2024
f9a7374
added girls form
2s2e Feb 16, 2024
ba472c9
Merge branch 'feature/steven+yoto-vsr-personal-info' of https://githu…
2s2e Feb 16, 2024
2d49188
changes with validation
yotzkim Feb 16, 2024
be0365a
changes with validation
yotzkim Feb 16, 2024
6fc45e9
Yet even more lint fixes
2s2e Feb 20, 2024
ee25030
prettier
2s2e Feb 20, 2024
5683ce4
Merge branch 'main' into feature/steven+yoto-vsr-personal-info
benjaminJohnson2204 Feb 21, 2024
40f0fa0
Fix CSS styles & clean up code
benjaminJohnson2204 Feb 23, 2024
ad04b6a
Update favicon, title, & description, remove unused boilerplate
benjaminJohnson2204 Feb 23, 2024
01f7db2
Remove commented-out code & make ethnicity an array
benjaminJohnson2204 Feb 23, 2024
81e86af
Merge main branch
benjaminJohnson2204 Feb 23, 2024
af07992
Merge VSR form page 1 branch
benjaminJohnson2204 Feb 23, 2024
5321b1d
Merge branch 'main' into vsr_individual
benjaminJohnson2204 Feb 25, 2024
8eedf26
Minor fixes to VSR fields & individual view
benjaminJohnson2204 Feb 25, 2024
3b1e3c6
remove unused code, clean up CSS & fix accordion spelling
benjaminJohnson2204 Feb 25, 2024
7df2a41
Extract common code for VSR individual accordions
benjaminJohnson2204 Feb 26, 2024
61d4c9b
Refactor component names
benjaminJohnson2204 Feb 26, 2024
e20c4ec
Fix bug with displaying children's ages
benjaminJohnson2204 Feb 26, 2024
5ee2f91
Update example VSR JSON dates to ISO format
benjaminJohnson2204 Feb 28, 2024
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
6 changes: 5 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,9 @@
},
"_moduleAliases": {
"src": "src"
}
},
"cacheDirectories": [
"node_modules/",
".next/cache/"
]
}
23 changes: 21 additions & 2 deletions backend/src/controllers/vsr.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
import { RequestHandler } from "express";
import { validationResult } from "express-validator";
import createHttpError from "http-errors";
import VSRModel from "src/models/vsr";
import validationErrorParser from "src/util/validationErrorParser";

export const getVSR: RequestHandler = async (req, res, next) => {
const { id } = req.params;

try {
const vsr = await VSRModel.findById(id);

if (vsr === null) {
throw createHttpError(404, "VSR not found at id " + id);
}
res.status(200).json(vsr);
} catch (error) {
next(error);
}
};

export const createVSR: RequestHandler = async (req, res, next) => {
// extract any errors that were found by the validator
const errors = validationResult(req);
Expand All @@ -25,11 +41,10 @@ export const createVSR: RequestHandler = async (req, res, next) => {
validationErrorParser(errors);

// Get the current date as a timestamp for when VSR was submitted
const date = new Date();
const currentDate = new Date();

const vsr = await VSRModel.create({
name,
date,
gender,
age,
maritalStatus,
Expand All @@ -40,6 +55,10 @@ export const createVSR: RequestHandler = async (req, res, next) => {
employmentStatus,
incomeLevel,
sizeOfHome,

// Use current date as timestamp for received & updated
dateReceived: currentDate,
lastUpdated: currentDate,
});

// 201 means a new resource has been created successfully
Expand Down
24 changes: 23 additions & 1 deletion backend/src/models/vsr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { InferSchemaType, Schema, model } from "mongoose";

const vsrSchema = new Schema({
name: { type: String, required: true },
date: { type: Date, required: true },
gender: { type: String, require: true },
age: { type: Number, require: true },
maritalStatus: { type: String, required: true },
Expand All @@ -13,6 +12,29 @@ const vsrSchema = new Schema({
employmentStatus: { type: String, require: true },
incomeLevel: { type: String, require: true },
sizeOfHome: { type: String, require: true },
streetAddress: { type: String, required: true },
city: { type: String, required: true },
state: { type: String, required: true },
zipCode: { type: Number, required: true },
phoneNumber: { type: String, required: true },
email: { type: String, required: true },
branch: { type: [String], required: true },
conflicts: { type: [String], required: true },
dischargeStatus: { type: String, required: true },
serviceConnected: { type: String, required: true },
lastRank: { type: String, required: true },
militaryId: { type: Number, required: true },
petCompanion: { type: String, required: true },
hearFrom: { type: String, required: true },
bedroomFurnishing: { type: [String], required: true },
bathroomFurnishing: { type: [String], required: true },
kitchenFurnishing: { type: [String], required: true },
livingRoomFurnishing: { type: [String], required: true },
diningRoomFurnishing: { type: [String], required: true },
otherFurnishing: { type: [String], required: true },
dateReceived: { type: Date, required: true },
lastUpdated: { type: Date, required: true },
status: { type: String, required: true },
});

type VSR = InferSchemaType<typeof vsrSchema>;
Expand Down
1 change: 1 addition & 0 deletions backend/src/routes/vsr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as VSRValidator from "src/validators/vsr";

const router = express.Router();

router.get("/:id", VSRController.getVSR);
router.post("/", VSRValidator.createVSR, VSRController.createVSR);

export default router;
41 changes: 41 additions & 0 deletions frontend/__tests__/sampleData/pap.vsrs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[
{
"_id": {
"$oid": "65bc31561826f0d6ee2c4b21"
},
"name": "Sophia Yu",
"gender": "Female",
"age": "25",
"agesOfGirls": ["11"],
"employmentStatus": "Employed",
"ethnicity": "Asian",
"incomeLevel": "$12,500 - $25,000",
"maritalStatus": "Single",
"sizeOfHome": "House",
"spouseName": "Name",
"branch": ["Air Force", "Navy"],
"city": "San Diego",
"conflicts": ["WWII", "Irani Crisis"],
"email": "[email protected]",
"phoneNumber": "(858) 790-2406",
"state": "CA",
"streetAddress": "13571 Marguerite Creek Way",
"zipCode": "92130",
"agesOfBoys": [10],
"bedroomFurnishing": [],
"dischargeStatus": "dischargeStatus-1",
"lastRank": "lastRank-1",
"militaryId": 1030,
"petCompanion": "Yes-1",
"serviceConnected": "Yes-1",
"bathroomFurnishing": ["Toiletries"],
"dateReceived": "02-04-2024 [10:00 AM]",
"diningRoomFurnishing": ["Chairs", "Table"],
"kitchenFurnishing": ["Oven"],
"lastUpdated": "02-05-2024 [8:00 PM]",
"livingRoomFurnishing": ["Couch"],
"otherFurnishing": ["Lawn Chair"],
"status": "Received",
"hearFrom": "Family-1"
}
]
58 changes: 29 additions & 29 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"firebase": "^10.6.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"moment": "^2.30.1",
"next": "14.0.3",
"react": "^18",
"react-dom": "^18",
Expand Down
3 changes: 3 additions & 0 deletions frontend/public/dropdown.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/public/ic_arrowback.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions frontend/public/ic_edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions frontend/public/ic_upload.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions frontend/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<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&family=Lora&family=Open+Sans&display=swap"
rel="stylesheet"
/>
</head>
</html>
3 changes: 3 additions & 0 deletions frontend/public/keyboard_arrow_down10.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions frontend/public/keyboard_arrow_down24.svg
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 frontend/public/lora.woff
Binary file not shown.
Binary file added frontend/public/opensans.woff
Binary file not shown.
9 changes: 9 additions & 0 deletions frontend/public/user_ellipse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading