Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ interface ReimbursementRequestFormViewProps {
reimbursementProducts: ReimbursementProductFormArgs[];
receiptPrepend: (args: ReimbursementReceiptUploadArgs) => void;
receiptRemove: (index: number) => void;
reimbursementProductAppend: (args: ReimbursementProductFormArgs) => void;
reimbursementProductPrepend: (args: ReimbursementProductFormArgs) => void;
reimbursementProductRemove: (index: number) => void;
onSubmit: (data: ReimbursementRequestFormInput) => void;
handleSubmit: UseFormHandleSubmit<ReimbursementRequestFormInput>;
Expand All @@ -98,7 +98,7 @@ const ReimbursementRequestFormView: React.FC<ReimbursementRequestFormViewProps>
control,
receiptPrepend,
receiptRemove,
reimbursementProductAppend,
reimbursementProductPrepend,
reimbursementProductRemove,
onSubmit,
handleSubmit,
Expand Down Expand Up @@ -900,7 +900,7 @@ const ReimbursementRequestFormView: React.FC<ReimbursementRequestFormViewProps>
<ReimbursementProductTable
errors={errors}
reimbursementProducts={reimbursementProducts}
appendProduct={reimbursementProductAppend}
prependProduct={reimbursementProductPrepend}
removeProduct={reimbursementProductRemove}
projectAutocompleteOptions={projectAutocompleteOptions}
watch={watch}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import CreateMaterialModal from '../../ProjectDetailPage/ProjectViewContainer/BO
interface ReimbursementProductTableProps {
reimbursementProducts: ReimbursementProductFormArgs[];
removeProduct: (index: number) => void;
appendProduct: (args: ReimbursementProductFormArgs) => void;
prependProduct: (args: ReimbursementProductFormArgs) => void;
projectAutocompleteOptions: {
label: string;
id: string;
Expand Down Expand Up @@ -145,7 +145,7 @@ const MaterialAutocomplete: React.FC<{
const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({
reimbursementProducts,
removeProduct,
appendProduct,
prependProduct,
projectAutocompleteOptions,
control,
errors,
Expand Down Expand Up @@ -403,7 +403,7 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({
options={projectAutocompleteOptions}
onChange={(_e, value) => {
if (value) {
appendProduct({
prependProduct({
reason: validateWBS(value.id),
name: '',
cost: 0,
Expand All @@ -428,7 +428,7 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({
getOptionLabel={(option) => formatReasonName(option.name)}
onChange={(_e, value) => {
if (value) {
appendProduct({
prependProduct({
reason: value,
name: '',
cost: 0,
Expand Down Expand Up @@ -834,7 +834,7 @@ const ReimbursementProductTable: React.FC<ReimbursementProductTableProps> = ({
onClick={(e) => {
const existingProducts = uniqueWbsElementsWithProducts.get(key);
if (existingProducts && existingProducts.length > 0) {
appendProduct({
prependProduct({
reason: existingProducts[0].reason,
name: '',
cost: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const ReimbursementRequestForm: React.FC<ReimbursementRequestFormProps> = ({
});
const {
fields: reimbursementProducts,
append: reimbursementProductAppend,
prepend: reimbursementProductPrepend,
remove: reimbursementProductRemove
} = useFieldArray({
control,
Expand Down Expand Up @@ -356,7 +356,7 @@ const ReimbursementRequestForm: React.FC<ReimbursementRequestFormProps> = ({
reimbursementProducts={reimbursementProducts}
receiptPrepend={receiptPrepend}
receiptRemove={receiptRemove}
reimbursementProductAppend={reimbursementProductAppend}
reimbursementProductPrepend={reimbursementProductPrepend}
reimbursementProductRemove={reimbursementProductRemove}
onSubmit={onSubmitWrapper}
handleSubmit={handleSubmit}
Expand Down
Loading