-
Notifications
You must be signed in to change notification settings - Fork 0
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
Donation Tracking Table #37
Conversation
…r the added routes), also added a set for checked IDs when CSV is downloaded
…r the added routes), also added a set for checked IDs when CSV is downloaded (fixes #32)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good work jits! just a few changes to make. try to get them done by monday so we can merge.
.h1 { | ||
color: brown; | ||
text-align: center; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are you guys using this css? if you guys aren't using it you can delete it. also no need to do css for this task
<Td>NULL</Td> | ||
<Td>{donation_site.donationId}</Td> | ||
<Td>{donation_site.foodBank}</Td> | ||
<Td>{donation_site.reporter}</Td> | ||
<Td>{donation_site.email}</Td> | ||
<Td>{donation_site.date}</Td> | ||
<Td>{donation_site.cannedDogFoodQuantity}</Td> | ||
<Td>{donation_site.dryDogFoodQuantity}</Td> | ||
<Td>{donation_site.cannedCatFoodQuantity}</Td> | ||
<Td>{donation_site.dryCatFoodQuantity}</Td> | ||
<Td>{donation_site.miscItems}</Td> | ||
<Td>{donation_site.volunteerHours}</Td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iterate through these rather than listing them explicitly
<Th>Donation Site</Th> | ||
<Th>Donation ID</Th> | ||
<Th>Food Bank</Th> | ||
<Th>Person Reporting</Th> | ||
<Th>Email</Th> | ||
<Th>Date</Th> | ||
<Th>Canned Dog Food</Th> | ||
<Th>Dry Dog Food</Th> | ||
<Th>Canned Cat Food</Th> | ||
<Th>Dry Cat Food</Th> | ||
<Th>Misc Items</Th> | ||
<Th>Volunteer Hours</Th> | ||
<Th>Description</Th> | ||
<Th isNumeric>multiply by</Th> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make a list of the table headers and iterate to make the tags rather than listing explicitly. see BusinessTable as an example.
for (let i = 0; i < data.length; ++i) { | ||
var donation_site = { | ||
donationSite: null, | ||
donationId: data[i].donation_id, | ||
foodBank: data[i].food_bank_donation, | ||
reporter: data[i].reporter, | ||
email: data[i].email, | ||
date: data[i].date, | ||
cannedDogFoodQuantity: data[i].canned_dog_food_quantity, | ||
dryDogFoodQuantity: data[i].dry_dog_food_quantity, | ||
cannedCatFoodQuantity: data[i].canned_cat_food_quantity, | ||
dryCatFoodQuantity: data[i].dry_cat_food_quantity, | ||
miscItems: data[i].misc_items, | ||
volunteerHours: data[i].volunteer_hours, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for future reference, it would be better to only select these columns in the SQL statement to take the load off the frontend. for now you can leave it because we are doing schema changes so we can leave it like this atm
|
||
const [donationTrackingTableData, setDonationTrackingTableData] = useState([]); | ||
const [checkedSet, setCheckedSet] = useState(new Set()); | ||
const [topCheckBox, setTopCheckBox] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the topcheckbox doesn't work as a select all. the problem seems to be visually only since when i click the top check box then download the csv it returns all still.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will fix when we css it!
…rs and table data
}; | ||
useEffect(() => { | ||
getDonationTrackingTableData(filter); | ||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
React Hook useEffect has missing dependencies: 'filter' and 'getDonationTrackingTableData'. Either include them or remove the dependency array.
Filterable donation tracking table added (check PRs in FPH backend for the added routes), also added a set for checked IDs when CSV is downloaded (closes #32)