Skip to content

Commit e2f7876

Browse files
author
Katelyn Grimes
committed
Merge remote-tracking branch 'origin/main' into MPDX-9608-remove-extra-hcm-call
2 parents bc9b56d + 99f7984 commit e2f7876

3 files changed

Lines changed: 75 additions & 5 deletions

File tree

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,3 +719,29 @@ To learn more about Next.js, take a look at the following resources:
719719
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
720720

721721
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
722+
723+
## Browser Support
724+
725+
Browser and device usage based on GA4 28-day active users of the production MPDX app at next.mpdx.org (Apr 8 – May 5, 2026). _Last updated: May 2026 — review annually._
726+
727+
**Targeted browsers** (Next.js 15 build defaults): Chrome 64+, Edge 79+, Firefox 67+, Safari 12+ (macOS & iOS), and Opera 51+. Internet Explorer is not supported.
728+
729+
**Usage snapshot**
730+
731+
**Browser share**
732+
733+
| Browser | Share |
734+
| :-------- | :---- |
735+
| Chrome | 57.8% |
736+
| (not set) | 21.9% |
737+
| Safari | 15.2% |
738+
| Edge | 3.4% |
739+
| Firefox | 1.5% |
740+
741+
**Device share**
742+
743+
| Device | Share |
744+
| :------ | :---- |
745+
| Desktop | 87.9% |
746+
| Mobile | 11.9% |
747+
| Tablet | 1.2% |

src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/AddDonation/AddDonation.test.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,31 @@ describe('AddDonation', () => {
208208
).toHaveValue('Cool Designation Account (321)'),
209209
);
210210
});
211+
212+
it('shows required-field errors after a field is touched', async () => {
213+
const { queryByText, findByText, getByRole } = render(
214+
<LocalizationProvider dateAdapter={AdapterLuxon}>
215+
<ThemeProvider theme={theme}>
216+
<SnackbarProvider>
217+
<GqlMockedProvider>
218+
<AddDonation
219+
accountListId={accountListId}
220+
handleClose={handleClose}
221+
/>
222+
</GqlMockedProvider>
223+
</SnackbarProvider>
224+
</ThemeProvider>
225+
</LocalizationProvider>,
226+
);
227+
expect(await findByText('Amount')).toBeInTheDocument();
228+
expect(queryByText('Partner Account is required')).not.toBeInTheDocument();
229+
230+
const partnerAccount = getByRole('combobox', { name: 'Partner Account' });
231+
act(() => {
232+
partnerAccount.focus();
233+
partnerAccount.blur();
234+
});
235+
236+
expect(await findByText('Partner Account is required')).toBeInTheDocument();
237+
});
211238
});

src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/AddDonation/AddDonation.tsx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const donationSchema = yup.object({
4343
amount: yup
4444
.number()
4545
.typeError('Amount must be a valid number')
46-
.required()
46+
.required(i18n.t('Amount is required'))
4747
.test(
4848
'Is amount in valid currency format?',
4949
'Amount must be in valid currency format',
@@ -70,12 +70,12 @@ const donationSchema = yup.object({
7070
(value) => !value || parseFloat(value as unknown as string) > 0,
7171
),
7272
appealId: yup.string().nullable(),
73-
currency: yup.string().required(),
73+
currency: yup.string().required(i18n.t('Currency is required')),
7474
designationAccountId: yup
7575
.string()
7676
.required(i18n.t('Designation Account is required')),
77-
donationDate: requiredDateTime(),
78-
donorAccountId: yup.string().required(),
77+
donationDate: requiredDateTime(i18n.t('Date is required')),
78+
donorAccountId: yup.string().required(i18n.t('Partner Account is required')),
7979
memo: yup.string().nullable(),
8080
motivation: yup.string().nullable(),
8181
paymentMethod: yup.string().nullable(),
@@ -251,7 +251,7 @@ export const AddDonation = ({
251251
setFieldValue('currency', currencyCode);
252252
}}
253253
textFieldProps={{
254-
error: !!errors.currency,
254+
error: !!errors.currency && touched.currency,
255255
}}
256256
size="small"
257257
/>
@@ -288,6 +288,13 @@ export const AddDonation = ({
288288
onChange={(date) =>
289289
setFieldValue('donationDate', date)
290290
}
291+
error={Boolean(
292+
errors.donationDate && touched.donationDate,
293+
)}
294+
helperText={
295+
touched.donationDate &&
296+
(errors.donationDate as string)
297+
}
291298
/>
292299
)}
293300
</FastField>
@@ -355,6 +362,13 @@ export const AddDonation = ({
355362
autocompleteId="partner-account-input"
356363
labelId="partner-account-label"
357364
size="small"
365+
textFieldProps={{
366+
error:
367+
!!errors.donorAccountId &&
368+
touched.donorAccountId,
369+
helperText:
370+
touched.donorAccountId && errors.donorAccountId,
371+
}}
358372
/>
359373
</Box>
360374
)}
@@ -474,6 +488,9 @@ export const AddDonation = ({
474488
'aria-labelledby': 'appeal-amount-label',
475489
}}
476490
/>
491+
<FormHelperText>
492+
{touched.appealAmount && errors.appealAmount}
493+
</FormHelperText>
477494
</Box>
478495
)}
479496
</Field>

0 commit comments

Comments
 (0)