Skip to content

Comments

SSF-143 Reusable Order Details Modal #110

Open
Juwang110 wants to merge 6 commits intomainfrom
jw/SSF-143-reusable-order-details-modal
Open

SSF-143 Reusable Order Details Modal #110
Juwang110 wants to merge 6 commits intomainfrom
jw/SSF-143-reusable-order-details-modal

Conversation

@Juwang110
Copy link

ℹ️ Issue

Closes https://vidushimisra.atlassian.net/jira/software/projects/SSF/boards/1?selectedIssue=SSF-143

📝 Description

This simple PR involves changes to make a reusable order details modal component that displays details of an order and the associated request. This modal is used by Admin, Volunteer, Pantry so this component will be used in many places.

The order details modal was updated on this existing page: /admin-order-management

✔️ Verification

I added a new route to get order details given an orderId so I added controller and service tests for that. I also verified the modal aligned with the figma designs.

Screenshot 2026-02-16 164606 Screenshot 2026-02-16 164603

🏕️ (Optional) Future Work / Notes

N/A

orderId: number;
status: OrderStatus;
foodManufacturerName: string;
trackingLink: string;
Copy link
Member

Choose a reason for hiding this comment

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

i think tracking link can be nullable?

{ allocationId: 3, orderId: 2 },
];

const mockOrderDetails: Partial<OrderDetailsDto>[] = [
Copy link
Member

Choose a reason for hiding this comment

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

why does this need to be an array and not just a singular OrderDetailsDto

return this.ordersService.findOne(orderId);
}

@Get('/:orderId/order-details')
Copy link
Member

Choose a reason for hiding this comment

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

maybe the endpoint can be simplified to /:orderId/details since it being an order is implied

).toBe(true);
});
});
const seededOrder = await orderRepo.findOne({
Copy link
Member

Choose a reason for hiding this comment

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

why can't we just call findOne on the service here?

it('updates order status to delivered', async () => {
const orderId = 3;
const order = await service.findOne(orderId);
describe('updateStatus', () => {
Copy link
Member

Choose a reason for hiding this comment

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

there seems to be some indentation problems - i think every other test is nested in the findOrderDetails one


{foodRequest.requestedItems.length > 0 && (
<Flex wrap="wrap" mt={3} gap={2}>
{foodRequest.requestedItems.map((item) => (
Copy link
Member

Choose a reason for hiding this comment

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

i made a reusable component called tagGroup i think you can use here

orderId: number;
status: OrderStatus;
foodManufacturerName: string;
trackingLink: string;
Copy link
Member

Choose a reason for hiding this comment

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

again can be nullable

return {
orderId: order.orderId,
status: order.status,
foodManufacturerName: order.foodManufacturer?.foodManufacturerName,
Copy link
Member

Choose a reason for hiding this comment

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

food manufacturer is a required relation in the db so idt u need the ? here

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.

2 participants