Skip to content

Commit 1a1ccaa

Browse files
author
Madalynn Nenninger
committed
#3991 moved account code to left column
1 parent 45a3609 commit 1a1ccaa

1 file changed

Lines changed: 54 additions & 54 deletions

File tree

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

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,60 @@ const ReimbursementRequestFormView: React.FC<ReimbursementRequestFormViewProps>
439439
</FormControl>
440440
)}
441441

442+
{/* Account Code */}
443+
<FormControl sx={{ borderRadius: '25px', width: '100%' }}>
444+
<FormLabel
445+
sx={{
446+
color: '#dd524c',
447+
textShadow: '1.5px 0 #dd524c',
448+
letterSpacing: '0.5px',
449+
textDecoration: 'underline',
450+
textUnderlineOffset: '3.5px',
451+
textDecorationThickness: '0.6px',
452+
paddingBottom: '2px',
453+
fontSize: 'x-large',
454+
fontWeight: 'bold'
455+
}}
456+
>
457+
Account Code*
458+
</FormLabel>
459+
<Controller
460+
name="accountCodeId"
461+
control={control}
462+
render={({ field: { onChange, value } }) => {
463+
const mappedAccountCodes = allAccountCodes
464+
.filter((accountCode) => accountCode.allowed)
465+
.map(accountCodesToAutocomplete);
466+
return (
467+
<Select
468+
value={value}
469+
onChange={(e) => {
470+
onChange(e.target.value);
471+
}}
472+
displayEmpty
473+
variant="outlined"
474+
fullWidth
475+
size="small"
476+
IconComponent={KeyboardArrowDownIcon}
477+
renderValue={(selected) => {
478+
if (!selected) {
479+
return <Typography style={{ color: 'gray' }}>Select Account Code</Typography>;
480+
}
481+
return mappedAccountCodes.find((accountCode) => accountCode.id === selected)?.label;
482+
}}
483+
>
484+
{mappedAccountCodes.map((accountCode) => (
485+
<MenuItem key={accountCode.id} value={accountCode.id}>
486+
{accountCode.label}
487+
</MenuItem>
488+
))}
489+
</Select>
490+
);
491+
}}
492+
/>
493+
<FormHelperText error>{errors.accountCodeId?.message}</FormHelperText>
494+
</FormControl>
495+
442496
{/* Refund Sources */}
443497
<FormControl sx={{ borderRadius: '25px', width: '100%' }}>
444498
<FormLabel
@@ -628,60 +682,6 @@ const ReimbursementRequestFormView: React.FC<ReimbursementRequestFormViewProps>
628682
{/* Right Column */}
629683
<Grid item xs={12} md={6}>
630684
<Stack spacing={3}>
631-
{/* Account Code */}
632-
<FormControl sx={{ borderRadius: '25px', width: '100%' }}>
633-
<FormLabel
634-
sx={{
635-
color: '#dd524c',
636-
textShadow: '1.5px 0 #dd524c',
637-
letterSpacing: '0.5px',
638-
textDecoration: 'underline',
639-
textUnderlineOffset: '3.5px',
640-
textDecorationThickness: '0.6px',
641-
paddingBottom: '2px',
642-
fontSize: 'x-large',
643-
fontWeight: 'bold'
644-
}}
645-
>
646-
Account Code*
647-
</FormLabel>
648-
<Controller
649-
name="accountCodeId"
650-
control={control}
651-
render={({ field: { onChange, value } }) => {
652-
const mappedAccountCodes = allAccountCodes
653-
.filter((accountCode) => accountCode.allowed)
654-
.map(accountCodesToAutocomplete);
655-
return (
656-
<Select
657-
value={value}
658-
onChange={(e) => {
659-
onChange(e.target.value);
660-
}}
661-
displayEmpty
662-
variant="outlined"
663-
fullWidth
664-
size="small"
665-
IconComponent={KeyboardArrowDownIcon}
666-
renderValue={(selected) => {
667-
if (!selected) {
668-
return <Typography style={{ color: 'gray' }}>Select Account Code</Typography>;
669-
}
670-
return mappedAccountCodes.find((accountCode) => accountCode.id === selected)?.label;
671-
}}
672-
>
673-
{mappedAccountCodes.map((accountCode) => (
674-
<MenuItem key={accountCode.id} value={accountCode.id}>
675-
{accountCode.label}
676-
</MenuItem>
677-
))}
678-
</Select>
679-
);
680-
}}
681-
/>
682-
<FormHelperText error>{errors.accountCodeId?.message}</FormHelperText>
683-
</FormControl>
684-
685685
{/* Upload Receipts */}
686686
<FormControl sx={{ display: 'flex', borderRadius: '25px', width: '100%' }}>
687687
<FormLabel

0 commit comments

Comments
 (0)