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

Donation Tracking Table #37

Merged
merged 5 commits into from
Feb 20, 2024
Merged

Donation Tracking Table #37

merged 5 commits into from
Feb 20, 2024

Conversation

Xire7
Copy link
Contributor

@Xire7 Xire7 commented Feb 15, 2024

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)

…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)
Copy link
Contributor

@srukelman srukelman left a 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.

Comment on lines 1 to 4
.h1 {
color: brown;
text-align: center;
}
Copy link
Contributor

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

Comment on lines 27 to 38
<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>
Copy link
Contributor

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

Comment on lines 133 to 146
<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>
Copy link
Contributor

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.

Comment on lines 30 to 44
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,
};
Copy link
Contributor

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);
Copy link
Contributor

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.

Copy link
Contributor Author

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!

};
useEffect(() => {
getDonationTrackingTableData(filter);
}, []);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <react-hooks/exhaustive-deps> reported by reviewdog 🐶
React Hook useEffect has missing dependencies: 'filter' and 'getDonationTrackingTableData'. Either include them or remove the dependency array.

@Xire7 Xire7 merged commit a05da83 into main Feb 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Business Donation Tracking Table
4 participants