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

Update ticket status texts #196

Merged
merged 1 commit into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions backend/emails/emails.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ const sendEmailUPRCreatedToApprovers = async (upr) => {
}

const sendEmailUPRPurchasedToReporter = async (upr) => {
const Subject = `[Purchased] ${upr.codename}`
const Subject = `[Ordered] ${upr.codename}`
const HTMLPart =
getMainMessageHTML(
`Your UW Finance Purchase Request has been purchased! When the item is ready to be picked up, we will let you know.`
`Your UW Finance Purchase Request has been ordered! When the item is ready to be picked up, we will let you know.`
) +
(await getUPRTicketInfoHTML(upr)) +
getTicketLinkHTML(upr.path)
Expand All @@ -191,10 +191,10 @@ const sendEmailUPRPurchasedToReporter = async (upr) => {
}

const sendEmailUPRPurchasedToCoordinator = async (upr) => {
const Subject = `[Purchased] ${upr.codename}`
const Subject = `[Ordered] ${upr.codename}`
const HTMLPart =
getMainMessageHTML(
'Thanks for purchasing the item(s)! When the item is ready to be picked up, please update the ticket below.'
'Thanks for ordering the item(s)! When the item is ready to be picked up, please update the ticket below.'
) +
(await getUPRTicketInfoHTML(upr)) +
getTicketLinkHTML(upr.path)
Expand Down
25 changes: 8 additions & 17 deletions frontend/src/components/TicketContent/PPRAdminContentTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,19 @@ const PPRAdminContentTable = () => {
case 'SEEKING_APPROVAL':
return (
<>
<h1>No Current Actions Available</h1>
<h2>Will automatically transition to READY_TO_BUY</h2>
<h2>
Condition: All three approvals below must be checked
To transition status, all three approvals below must
be checked
</h2>
</>
)
case 'READY_TO_BUY':
return (
<>
<h1>No Current Actions Available</h1>
<h2>
Will automatically transition to
PURCHASED_AND_RECEIPTS_SUBMITTED
</h2>
<h2>
Condition: Reporter uploads supporting documents and
manually transitions status
To transition status, reporter must upload
supporting documents and manually transition the
status
</h2>
</>
)
Expand All @@ -51,14 +46,10 @@ const PPRAdminContentTable = () => {
case 'REPORTER_PAID':
return (
<>
<h1>No Current Actions Available</h1>
<h2>
Will automatically transition to
REPORTER_REIMBURSE_CONFIRMED
</h2>
<h2>
Condition: Reporter confirms they have been
reimbursed and manually transitions status
To transition status, reporter must confirm they
have been reimbursed and manually transition the
status
</h2>
</>
)
Expand Down
24 changes: 23 additions & 1 deletion frontend/src/components/TicketContent/PPRContentTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,33 @@ const PPRContentTable = () => {
}
}

const statusToStatusText = {
SEEKING_APPROVAL: 'Seeking Approval',
READY_TO_BUY: 'Ready to Buy',
PURCHASED_AND_RECEIPTS_SUBMITTED: 'Purchased and Receipts Submitted',
REPORTER_PAID: 'Reporter Paid',
REPORTER_REIMBURSE_CONFIRMED: 'Reporter Reimbursed',
}

const statusToNextStatusText = {
SEEKING_APPROVAL: 'Ready to Buy',
READY_TO_BUY: 'Purchased and Receipts Submitted',
PURCHASED_AND_RECEIPTS_SUBMITTED: 'Reporter Paid',
REPORTER_PAID: 'Reporter Reimbursed',
REPORTER_REIMBURSE_CONFIRMED: 'N/A',
}

return (
<VStack>
<Table mb="12px">
<Tbody>
<TicketContentTableRow
heading={'Status'}
value={currentTicket.status}
value={statusToStatusText[currentTicket.status]}
/>
<TicketContentTableRow
heading={'Next Status'}
value={statusToNextStatusText[currentTicket.status]}
/>
<TicketContentTableRow
heading={'Cost'}
Expand Down Expand Up @@ -84,6 +104,7 @@ const PPRContentTable = () => {
heading={'Finance/Admin Approval'}
value={
<Checkbox
borderColor="lightslategrey"
disabled={
!auth.isAdmin ||
currentTicket.status !==
Expand All @@ -101,6 +122,7 @@ const PPRContentTable = () => {
heading={'Faculty Advisor Approval'}
value={
<Checkbox
borderColor="lightslategrey"
disabled={
!auth.isAdmin ||
currentTicket.status !==
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/components/TicketContent/SFContentTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@ import { useGetCurrentTicket } from '../../hooks/hooks'

const SFContentTable = () => {
const currentTicket = useGetCurrentTicket()
const statusToText = {
ALLOCATED: 'Allocated',
CLAIM_SUBMITTED: 'Claim Submitted',
REIMBURSED: 'Reimbursed',
}

return (
<VStack>
<Table>
<Tbody>
<TicketContentTableRow
heading={'Status'}
value={currentTicket.status}
value={statusToText[currentTicket.status]}
/>
<TicketContentTableRow
heading={'Funding Allocation'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const UPRAdminContentTable = () => {
onClick={transitionToPurchased}
disabled={!poNum || !reqNum}
>
Transition To Purchased
Transition To Ordered
</Button>
)}
{currentTicket.status === 'ORDERED' && (
Expand Down
24 changes: 23 additions & 1 deletion frontend/src/components/TicketContent/UPRContentTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,33 @@ const UPRContentTable = () => {
}
}

const statusToStatusText = {
SEEKING_APPROVAL: 'Seeking Approval',
SENT_TO_COORDINATOR: 'Sent to Coordinator',
ORDERED: 'Ordered',
READY_FOR_PICKUP: 'Ready for Pickup',
PICKED_UP: 'Picked up',
}

const statusToNextStatusText = {
SEEKING_APPROVAL: 'Sent to Coordinator',
SENT_TO_COORDINATOR: 'Ordered',
ORDERED: 'Ready for Pickup',
READY_FOR_PICKUP: 'Picked up',
PICKED_UP: 'N/A',
}

return (
<VStack>
<Table mb="12px">
<Tbody>
<TicketContentTableRow
heading={'Status'}
value={currentTicket.status}
value={statusToStatusText[currentTicket.status]}
/>
<TicketContentTableRow
heading={'Next Status'}
value={statusToNextStatusText[currentTicket.status]}
/>
<TicketContentTableRow
heading={'Cost'}
Expand Down Expand Up @@ -92,6 +112,7 @@ const UPRContentTable = () => {
heading={'Finance/Admin Approval'}
value={
<Checkbox
borderColor="lightslategrey"
disabled={
!auth.isAdmin ||
currentTicket.status !==
Expand All @@ -109,6 +130,7 @@ const UPRContentTable = () => {
heading={'Faculty Advisor Approval'}
value={
<Checkbox
borderColor="lightslategrey"
disabled={
!auth.isAdmin ||
currentTicket.status !==
Expand Down
Loading