-
Notifications
You must be signed in to change notification settings - Fork 0
Pantry volunteer management #31
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
base: main
Are you sure you want to change the base?
Conversation
…ble to include new column volunteer_type enum
… populate volunteer management table
…stract out fetch assignmnets call to apiclient
…at volunteer id, not just the single assignment. Changed page to only display one row for each volunteer not each assignment
…ignments table in db so volunteers don't need to be assigned to a pantry.
controllers: [AssignmentsController], | ||
providers: [AssignmentsService, AuthService, JwtStrategy], | ||
}) | ||
export class AssignemntsModule {} |
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.
typo for assignmentsModule (assignemnts instead of assignments)
|
||
@Put(':id/role') | ||
async updateRole(@Param('id') id: number, @Body('role') role: string) { | ||
const upperCaseRole = role.toUpperCase(); |
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.
we can just leave the updated role as lowercase in the backend so we can get rid of upperCaseRole here
<Tbody> | ||
{filteredAssignments?.map((assignment) => ( | ||
<Tr key={assignment.assignmentId}> | ||
<Td>{assignment.volunteer.firstName}</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.
maybe it would be good to include both the volunteer's first and last name on this line
) | ||
} | ||
> | ||
{volunteerType} |
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.
Here the volunteerType is shown as what we have in the backend (lowercase with _) but we probably want to display it differently in the frontend; we could do something like
const VOLUNTEER_TYPES: Record<string, string> = {
LEAD_VOLUNTEER: 'Lead Volunteer',
STANDARD_VOLUNTEER: 'Standard Volunteer',
NON_PANTRY_VOLUNTEER: 'Non-Pantry Volunteer',
};
and then here, we would do {VOLUNTEER_TYPES[volunteerType.toUpperCase()] || volunteerType} instead of {volunteerType}
</option> | ||
<option value={VolunteerType.NON_PANTRY_VOLUNTEER}> | ||
Non-Pantry Volunteer | ||
</option> |
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.
if we decide to go with const VOLUNTEER_TYPES from below, we can replace lines 102-108 with {Object.entries(VOLUNTEER_TYPES).map(([value, label]) => (
{label}
))}
so we can stay consistent with the formatting
ℹ️ Issue
Closes changing volunteer type for pantry volunteer assignments and serving as a hub to navigate to adding volunteers or viewing assigned pantries for each volunteer.
📝 Description
I added a volunteer management page which displays each volunteer (that's assigned to a pantry) with a column for the volunteer name, a column for assigned pantries, and a column for volunteer type. The column for assigned pantries is simply a button for each row that navigates to a nonexistent page but it would house all the pantries assigned with this volunteer. The column for volunteer type is a dropdown that allows an admin to update the type. There is a button to reset unsaved changes and a button to save current changes made in the table (volunteer type is consistent across pantry assignments so when volunteer type is changed for one user, all assignments of that user change to that new volunteer type). An add new volunteer button is also present that navigates to a nonexistent page which would allow addition/deletion of volunteers entirely. The page finally includes a search bar filter to search by name and a volunteer type checkbox filter. This page is important because it allows admins to change a volunteer's type, or navigate to add/delete volunteers, or navigate to manage a volunteer's pantries.
Briefly list the changes made to the code:
✔️ Verification
To verify my new feature worked I had to manually create a pantry and a user in PGAdmin and I added rows to the assignments table assigning users as volunteers to pantries. I then made sure saving changes to volunteer type altered every row in the assignments table with that volunteer id. I also played around to make sure the filters on the page worked just by simply changing inputs.
🏕️ (Optional) Future Work / Notes
Notes: