Skip to content

Commit 6d9dfcf

Browse files
committed
#2081: Added check for env var to enable reciept upload requirements
1 parent 5cbc6c2 commit 6d9dfcf

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/frontend/src/pages/FinancePage/ReimbursementRequestForm/ReimbursementRequestForm.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import { useHistory } from 'react-router-dom';
2424
import { routes } from '../../../utils/routes';
2525
import { useCurrentUserSecureSettings } from '../../../hooks/users.hooks';
2626

27+
const RECEIPT_REQUIRED = import.meta.env.VITE_RR_RECEIPT_REQUIREMENT || 'disabled';
28+
2729
export interface ReimbursementRequestInformation {
2830
vendorId: string;
2931
dateOfExpense: Date;
@@ -68,7 +70,10 @@ const schema = yup.object().shape({
6870
.required('reimbursement products required')
6971
.min(1, 'At least one Reimbursement Product is required'),
7072
receiptFiles:
71-
import.meta.env.MODE === 'development'
73+
// The requirement for receipt uploads is disabled by default on development to make testing easier;
74+
// if testing proper receipt uploads is needed, create an environment variable called VITE_RR_RECEIPT_REQUIREMENT
75+
// in src/frontend/.env and set it to 'enabled'.
76+
import.meta.env.MODE === 'development' && RECEIPT_REQUIRED !== 'enabled'
7277
? yup.array()
7378
: yup
7479
.array()

0 commit comments

Comments
 (0)