Skip to content
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

IEEE-287 (adding new order statuses) #513

Open
wants to merge 41 commits into
base: develop
Choose a base branch
from

Conversation

carmen-chau
Copy link
Contributor

@carmen-chau carmen-chau commented Jan 2, 2024

Overview

This PR is preliminary work for IEEE-287.

The current list of order statuses are as follows:

  • Submitted [Pre-existing] (orders that teams have submitted, but tech team has not looked at yet)
  • Ready for Pickup [Pre-existing] (order has been packaged by tech team, ready for pick up)
  • Picked Up [Pre-existing] (team has received order)
  • Cancelled [Pre-existing] (Note: In current main branch, orders that were cancelled by either tech team or hacking team are grouped in 1 category. Do we want to seperate these 2 cases?)
  • Returned [Pre-existing]
  • Pending [NEW] (Denote orders that are currently being packed). There is probably a better name for this (Eg: "Packing?)
  • Rejected [NEW] (Denotes orders manually denied by IEEE team)

Work done so far:

  1. I've re-coloured the Updated Time UI tag on the Admin/Participant table to be pink instead of blue (to avoid colour confusion with the Pending tag)

  2. I've added the Pending tag to all currently packing orders on Admin/Participant table

  3. Made sure that the Pending and Rejected status are in the Admin Order page (via the OrderFilter component)

  4. I've modified the code for Django admin site accordingly to include both the Pending and Rejected status

Work left to be done

  1. Discuss and agree to new order status names [DONE]
  2. Finish code for button to transition Pending orders to Ready for Pickup [DONE]
  3. Potentially change other files I missed**[DONE]**
  4. Modify and/or write new unit tests

Unit Tests Created

  • N/A, most likely need to modify mockData.tsx to pass all tests

Known bugs

  1. No matter how many times I attempt to refresh, on the admin side, the order filter number count for: Ready for Pickup, Returned, Pending, Rejected are always 0

  2. The Handles double row click event test in OrdersTable.tsx is failing, unsure why

Screenshots of changes on HSS site

  1. On Admin side
Screenshot 2024-01-02 at 1 38 56 AM
  1. On participant side
Screenshot 2024-01-02 at 1 40 49 AM
  1. On Django site
Screenshot 2024-01-02 at 1 41 30 AM

@carmen-chau carmen-chau changed the title modified helpers.ts to add new statuses IEEE-287 (adding new order statuses) Jan 2, 2024
@Mustaballer
Copy link
Contributor

Mustaballer commented Jan 2, 2024

Hey @carmen-chau, great start! I will be addressing your next steps below.

  1. Regarding the new status names the ones you made are great, I think its fine if we remove rejected because cancelled is good for both cases. So rejected tag isn't needed imo.
  2. I'm wondering if you are able to change the order status on the Orders page?(Edit dw about this)
  3. For the bug we will probably need to modify some code related to the Orders Filters, but you can put this bug on hold for now and work on the things you can do rn.

@@ -160,7 +160,7 @@ def get_team_code(obj: Order):

class OrderChangeSerializer(OrderListSerializer):
change_options = {
"Submitted": ["Cancelled", "Ready for Pickup"],
"Submitted": ["Cancelled", "Ready for Pickup"], # TODO: Unsure about whether I need to add the status "Pending" and "Rejected" to the list
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah you should add Pending Status here, I believe it means from submitted status it can changed to cancelled or ready for pickup. I'm thinking now that instead of pending we call it "Preparing" so that means admins are actively building the order.

submitted_orders.push(order);
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

change to else if (order.status === "Packing")

@carmen-chau
Copy link
Contributor Author

carmen-chau commented Jan 15, 2024

Current bugs with the ticket:

  1. On the participant side, the "Cancel Order" button for "Packing Orders" does not work. If you try pressing the "Delete Order" button after the Pop-up modal, the following pop-up will show. I know this has something to do with the cancelOrderThunk in orderSlice.ts but am unsure of where to go from here.
Screenshot 2024-01-14 at 7 18 10 PM
  1. The Swagger Endpoint for /hardware/orders/{id}/ doesn't exactly work when you try to change the status of a packing order to "Ready for Pickup". Although the order status does end up changing, you likely will get an error when running the website (something to do with orders.foreach()?
Screenshot 2024-01-14 at 7 19 33 PM Screenshot 2024-01-14 at 7 27 09 PM
  1. On the same topic/endpoint as the 2nd point, this is the error message when changing order from "Packing" => "Cancelled"
Screenshot 2024-01-14 at 7 25 25 PM

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.

None yet

2 participants