Repository navigation
Gayatri - Fix equipment update button and show saved update details - #5605
sawantgayatri19 wants to merge 1 commit into
Conversation
- The pencil (update) button in the Equipment list opened an empty "Edit Record" modal (recordType UpdatesEdit had a title but no body). It now links to the existing update page at /bmdashboard/tools/:equipmentId/update, and the dead UpdatesEdit option was removed from the modal. - The equipment detail page read Last Used Person from createdBy and Last Used Task from nonexistent fields. It now reads lastUsedBy, lastUsedFor and replacementRequired (formatted as Yes/No), falling back to the old fields for records saved before the backend fix.
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
manavkheni1
left a comment
There was a problem hiding this comment.
Tested locally with the paired backend PR #2379. Clicked the pencil icon in the Updates column, confirmed it correctly opens the "Update Tool or Equipment Status" page for that equipment instead of the previously empty "Equipments Edit Record" modal. Submitted an update (Broken/Needs repair, volunteer name, task, replacement Yes) and confirmed the success toast appeared. Opened the equipment's details page afterward and confirmed Current Status, Last Used Person, Last Used Task, and "Asked for a replacement?" all correctly matched the submitted values. No issues found.



Description
Description
Fixes: (PRIORITY MEDIUM) Phase 2: Equipment list update button doesn't work
Backend PR: OneCommunityGlobal/HGNRest#2379 (required, merge together)
On /bmdashboard/equipment, clicking the update (pencil) button opened an
"Equipments Edit Record" modal with nothing inside it.
Root cause
EquipmentListModalwithrecordType="UpdatesEdit",which had a title but no body, so the modal was empty.
"Last Used Person" and "Not Available" for task and replacement, because it
read the wrong fields (and the backend was dropping them; see backend PR).
Main changes
EquipmentsTable.jsx: the pencil now links to the existing, working update page/bmdashboard/tools/:equipmentId/update(UpdateEquipment), which saves viaPUT /bm/equipment/:equipmentId/status.EquipmentListModal.jsx: removed the unusedUpdatesEdittitle and propTypeoption, so an empty modal can't be opened again.
EquipmentDetail.jsx: "Last Used Person", "Last Used Task" and"Asked for a replacement?" now read
lastUsedBy,lastUsedForandreplacementRequired(shown as Yes/No), falling back to the old fields forrecords saved before the backend fix.
How to test
"Update Tool or Equipment Status" page opens for that equipment.
Jane Doe (Volunteer #3), Bathroom - plumbing,replacement Yes. Confirm the success toast.
Person, Last Used Task and "Asked for a replacement?" match what was submitted.
Screenshots
Notes / follow-ups (out of scope)
Jane Doe (Volunteer #1-4)),not real users.
shows Name/Class as "Unknown", because
itemTypeisn't populated in theequipment list API response. Happy to pick this up as a follow-up.