-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Description: The grant creation/editing modal (created in #152) currently exists but needs additional functionality and refinement to fully support creating and editing grants. This includes connecting the modal to the backend, handling both “create” and “edit” modes dynamically, adjusting UI sizing, and implementing the “Add Deadline” and “Add Document” features.
Instructions:
- Adjust modal sizing and layout for better readability and consistency with Figma.
- Use the useState functions populate and update the grant creation object.
- Connect the modal to the backend:
- On Create, use the POST
/grant/new-grantroute to add a new grant to the database. - On Edit, use the PUT
/grant/saveroute to update the existing grant.
- On Create, use the POST
- Add a boolean prop (e.g., isEditing) to determine mode:
- If true, pre-populate all fields with the selected grant’s data.
- When saving, trigger the PUT route.
- If false, fields should be empty and trigger the POST route when saving.
- Update the store after successful POST/PUT so the UI reflects changes without a full refresh.
- If true, pre-populate all fields with the selected grant’s data.
- Implement functionality for the “Add Deadline” and “Add Document” buttons (Users should be able to add multiple report deadlines and document links)
- Refer to the Figma (presenter mode) to replicate expected dynamic field behavior.
- EDITS POST 11/4 MEETING:
- For the "add deadline" button, make sure the very first deadline you add is also able to be deleted! Some grants may not have report deadlines at all
- For the "add document" button, we want every document to be a LINK. It should open 3 text fields for the user to fill out:
- Overall, make sure everything fits (like the text fits in the buttons, and the expanded view shows all the components including the buttons)**
Acceptance Criteria
- Modal sizing and spacing align with Figma designs and make it so user can easily view and edit fields (can be up to your own discretion)
- Create modal successfully posts a new grant to the backend and updates the store.
- Edit modal pre-populates with existing data and successfully updates the grant via PUT.
- Adding multiple deadlines and documents works dynamically and matches Figma behavior.
- Store updates immediately reflect changes (no manual refresh required).
- All inputs and buttons follow the existing design system and use consistent state handling.
Metadata
Metadata
Assignees
Labels
No labels
