Skip to content

Commit c0d2653

Browse files
authored
Merge pull request #1477 from Northeastern-Electric-Racing/#1277-only-proj-reimbursement
#1277 only proj reimbursement
2 parents 4b50ffd + 12a5855 commit c0d2653

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({
7878
<TableHead>
7979
<TableRow>
8080
<TableCell width={'40%'}>
81-
<FormLabel>WBS Element</FormLabel>
81+
<FormLabel>Project</FormLabel>
8282
</TableCell>
8383
<TableCell width={'60%'}>
8484
<FormLabel>Products</FormLabel>
@@ -167,7 +167,7 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({
167167
}}
168168
id={'append-product-autocomplete'}
169169
size={'small'}
170-
renderInput={(params) => <TextField {...params} placeholder="Select a Wbs Element" />}
170+
renderInput={(params) => <TextField {...params} placeholder="Select a Project" />}
171171
/>
172172
</TableCell>
173173
</TableRow>

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* See the LICENSE file in the repository root folder for details.
44
*/
55
import { useFieldArray, useForm } from 'react-hook-form';
6-
import { ClubAccount, ReimbursementProductCreateArgs, ReimbursementReceiptUploadArgs, WbsNumber } from 'shared';
6+
import { ClubAccount, ReimbursementProductCreateArgs, ReimbursementReceiptUploadArgs } from 'shared';
77
import { useGetAllExpenseTypes, useGetAllVendors } from '../../../hooks/finance.hooks';
88
import { useToast } from '../../../hooks/toasts.hooks';
99
import LoadingIndicator from '../../../components/LoadingIndicator';
@@ -14,7 +14,6 @@ import CreateReimbursementRequestFormView from './ReimbursementFormView';
1414
import { useAllProjects } from '../../../hooks/projects.hooks';
1515
import { useHistory } from 'react-router-dom';
1616
import { routes } from '../../../utils/routes';
17-
import { getAllWbsElements } from '../../../utils/reimbursement-request.utils';
1817
import { useCurrentUserSecureSettings } from '../../../hooks/users.hooks';
1918

2019
export interface ReimbursementRequestFormInput {
@@ -165,10 +164,12 @@ const ReimbursementRequestForm: React.FC<ReimbursementRequestFormProps> = ({
165164
}
166165
};
167166

168-
const allWbsElements: {
169-
wbsNum: WbsNumber;
170-
wbsName: string;
171-
}[] = getAllWbsElements(allProjects);
167+
const allProjectWbsElements = allProjects.map((proj) => {
168+
return {
169+
wbsNum: proj.wbsNum,
170+
wbsName: proj.name
171+
};
172+
});
172173

173174
return (
174175
<CreateReimbursementRequestFormView
@@ -185,7 +186,7 @@ const ReimbursementRequestForm: React.FC<ReimbursementRequestFormProps> = ({
185186
reimbursementProductRemove={reimbursementProductRemove}
186187
onSubmit={onSubmitWrapper}
187188
handleSubmit={handleSubmit}
188-
allWbsElements={allWbsElements}
189+
allWbsElements={allProjectWbsElements}
189190
submitText={submitText}
190191
previousPage={previousPage}
191192
setValue={setValue}

0 commit comments

Comments
 (0)