forked from Code-4-Community/scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 0
Ddb/ssf 8 admin order management frontend #51
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
Open
dburkhart07
wants to merge
36
commits into
main
Choose a base branch
from
ddb/SSF-8-admin-order-management-frontend
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
1697cbe
Fixed branch issues ignoring lint (Chakra components still having wei…
dburkhart07 3f6f05c
Fixed issues
dburkhart07 379edb7
Merge conflict final commit
dburkhart07 7023e8a
Final commit
dburkhart07 27ba9d9
Merge branch 'main' into ddb/SSF-8-admin-order-management-frontend
amywng 693bed0
Fixed merge conflicts
dburkhart07 7fe9ca5
Final commit
dburkhart07 121d373
Fixed frontend changes
dburkhart07 a89873d
Fixed frontend changes
dburkhart07 815daab
Merged main into branch
dburkhart07 4a53a23
Fixed backend
dburkhart07 21eb829
Fixed backend
dburkhart07 505836d
Final commit
dburkhart07 b462dba
Fixed volunteer display
dburkhart07 906b21b
Final commit
dburkhart07 a2fec8c
Final commit
dburkhart07 35951a4
Resolved comments
dburkhart07 585b809
Styling changes
dburkhart07 56a9a82
prettier
dburkhart07 fdd5784
Resolved merge conflicts
dburkhart07 cb5ce22
Prettier
dburkhart07 54d4175
Fixed color theme and remove x from the modals
dburkhart07 4eff2ee
Final commit
dburkhart07 b594158
prettier
dburkhart07 ae13e1f
Added search feature
dburkhart07 8ca82ec
prettier
dburkhart07 7991740
Added modal similar to request form modal
dburkhart07 ecad35e
prettier
dburkhart07 430c293
More comments resolved
dburkhart07 a570951
prettier
dburkhart07 1cc1d48
Fixed modal styligs
dburkhart07 eb144ae
Resolved comments
dburkhart07 577b6aa
prettier
dburkhart07 039e240
Resolved merge conflicts
dburkhart07 71bade1
Merged main in
dburkhart07 8fc17d5
prettier
dburkhart07 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
27 changes: 13 additions & 14 deletions
27
apps/backend/src/migrations/1764816885341-RemoveUnusedStatuses.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,24 @@ | ||
| import { MigrationInterface, QueryRunner } from "typeorm"; | ||
| import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
|
||
| export class RemoveUnusedStatuses1764816885341 implements MigrationInterface { | ||
| public async up(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.query( | ||
| `ALTER TABLE allocations DROP COLUMN IF EXISTS status;`, | ||
| ); | ||
| await queryRunner.query( | ||
| `ALTER TABLE donation_items DROP COLUMN IF EXISTS status;`, | ||
| ); | ||
| } | ||
|
|
||
| public async up(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.query( | ||
| `ALTER TABLE allocations DROP COLUMN IF EXISTS status;` | ||
| ); | ||
| await queryRunner.query( | ||
| `ALTER TABLE donation_items DROP COLUMN IF EXISTS status;` | ||
| ); | ||
| } | ||
|
|
||
| public async down(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.query(` | ||
| public async down(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.query(` | ||
| ALTER TABLE allocations | ||
| ADD COLUMN status VARCHAR(25) NOT NULL DEFAULT 'pending'; | ||
| `); | ||
|
|
||
| await queryRunner.query(` | ||
| await queryRunner.query(` | ||
| ALTER TABLE donation_items | ||
| ADD COLUMN status VARCHAR(25) NOT NULL DEFAULT 'available'; | ||
| `); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
150 changes: 150 additions & 0 deletions
150
apps/frontend/src/components/forms/orderDetailsModal.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| import React, { useState, useEffect } from 'react'; | ||
| import { | ||
| Text, | ||
| Dialog, | ||
| CloseButton, | ||
| Flex, | ||
| Textarea, | ||
| Field, | ||
| Tag, | ||
| } from '@chakra-ui/react'; | ||
| import ApiClient from '@api/apiClient'; | ||
| import { FoodRequest, Order } from 'types/types'; | ||
| import { formatDate } from '@utils/utils'; | ||
|
|
||
| interface OrderDetailsModalProps { | ||
| order: Order; | ||
| isOpen: boolean; | ||
| onClose: () => void; | ||
| } | ||
|
|
||
| const OrderDetailsModal: React.FC<OrderDetailsModalProps> = ({ | ||
| order, | ||
| isOpen, | ||
| onClose, | ||
| }) => { | ||
| const [foodRequest, setFoodRequest] = useState<FoodRequest | null>(null); | ||
|
|
||
| useEffect(() => { | ||
| if (isOpen) { | ||
| const fetchData = async () => { | ||
| try { | ||
| const foodRequestData = await ApiClient.getFoodRequestFromOrder( | ||
| order.orderId, | ||
| ); | ||
| setFoodRequest(foodRequestData); | ||
| } catch (error) { | ||
| console.error('Error fetching food request details:', error); | ||
| } | ||
| }; | ||
|
|
||
| fetchData(); | ||
| } | ||
| }, [isOpen, order.orderId]); | ||
|
|
||
| return ( | ||
| <Dialog.Root | ||
| open={isOpen} | ||
| size="xl" | ||
| onOpenChange={(e: { open: boolean }) => { | ||
| if (!e.open) onClose(); | ||
| }} | ||
| closeOnInteractOutside | ||
| > | ||
| <Dialog.Backdrop /> | ||
| <Dialog.Positioner> | ||
| <Dialog.Content maxW={650}> | ||
| <Dialog.Header pb={0} mt={2}> | ||
| <Dialog.Title fontSize="lg" fontWeight={700} fontFamily="inter"> | ||
| Order {order.orderId} | ||
| </Dialog.Title> | ||
| </Dialog.Header> | ||
| <Dialog.Body> | ||
| {foodRequest && ( | ||
| <> | ||
| <Text textStyle="p2" color="#111111"> | ||
| {order.pantry.pantryName} | ||
| </Text> | ||
| <Text mb={8} color="#52525B" textStyle="p2" pt={0} mt={0}> | ||
| Requested {formatDate(foodRequest.requestedAt)} | ||
| </Text> | ||
|
|
||
| <Field.Root mb={4}> | ||
| <Field.Label> | ||
| <Text textStyle="p2" fontWeight={600} color="neutral.800"> | ||
| Size of Shipment | ||
| </Text> | ||
| </Field.Label> | ||
| <Text | ||
| fontSize="sm" | ||
| fontWeight="400" | ||
| color="neutral.800" | ||
| mt={1} | ||
| w="full" | ||
| > | ||
| {foodRequest.requestedSize} | ||
| </Text> | ||
| </Field.Root> | ||
|
|
||
| <Field.Root mb={4}> | ||
| <Field.Label> | ||
| <Text textStyle="p2" fontWeight={600} color="neutral.800"> | ||
| Food Type(s) | ||
| </Text> | ||
| </Field.Label> | ||
| <Flex wrap="wrap" mt={1} gap={2}> | ||
| {foodRequest.requestedItems.map((item, index) => ( | ||
| <Tag.Root | ||
| key={index} | ||
| size="xl" | ||
| variant="solid" | ||
| bg="neutral.100" | ||
| color="neutral.800" | ||
| borderRadius="4px" | ||
| borderColor="neutral.300" | ||
| borderWidth="1px" | ||
| fontFamily="Inter" | ||
| fontWeight={500} | ||
| > | ||
| <Tag.Label>{item}</Tag.Label> | ||
| </Tag.Root> | ||
| ))} | ||
| </Flex> | ||
| </Field.Root> | ||
|
|
||
| <Field.Root mb={4}> | ||
| <Field.Label> | ||
| <Text textStyle="p2" fontWeight={600} color="neutral.800"> | ||
| Additional Information | ||
| </Text> | ||
| </Field.Label> | ||
| <Textarea | ||
| value={ | ||
| foodRequest.additionalInformation || | ||
| 'No additional information supplied.' | ||
| } | ||
| readOnly | ||
| pl={-2} | ||
| size="lg" | ||
| textStyle="p2" | ||
| color="neutral.800" | ||
| bg="white" | ||
| border="none" | ||
| resize="none" | ||
| disabled | ||
| /> | ||
| </Field.Root> | ||
| </> | ||
| )} | ||
| </Dialog.Body> | ||
|
|
||
| <Dialog.CloseTrigger asChild> | ||
| <CloseButton size="lg" /> | ||
| </Dialog.CloseTrigger> | ||
| </Dialog.Content> | ||
| </Dialog.Positioner> | ||
| </Dialog.Root> | ||
| ); | ||
| }; | ||
|
|
||
| export default OrderDetailsModal; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.