From 6053a7d1a8cb8eec1cecb1184ce1b9f9b6edce9a Mon Sep 17 00:00:00 2001 From: Caleb Alldrin Date: Fri, 1 Dec 2023 08:53:29 -0800 Subject: [PATCH 1/2] Show Designation accounts from all organizations in autocomplete --- .../AddMenu/Items/AddDonation/AddDonation.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/AddDonation/AddDonation.tsx b/src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/AddDonation/AddDonation.tsx index f4affc05b..87f70f6d0 100644 --- a/src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/AddDonation/AddDonation.tsx +++ b/src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/AddDonation/AddDonation.tsx @@ -125,6 +125,10 @@ export const AddDonation = ({ const pledgeCurrencies = constants?.pledgeCurrencies; + const newDesignationAccounts = + data?.designationAccounts && + data?.designationAccounts.flatMap((x) => x.designationAccounts); + const initialDonation: Omit = { amount: 0, appealAmount: null, @@ -425,16 +429,14 @@ export const AddDonation = ({ autoSelect autoHighlight options={ - (data?.designationAccounts && - data?.designationAccounts[0]?.designationAccounts.map( - ({ id }) => id, - )) ?? + (newDesignationAccounts && + newDesignationAccounts.map(({ id }) => id)) ?? [] } getOptionLabel={(accountId): string => { const account = - data?.designationAccounts && - data?.designationAccounts[0]?.designationAccounts.find( + newDesignationAccounts && + newDesignationAccounts.find( ({ id }) => id === accountId, ); return account From 71b2fd4a40de3c0be62c294e7980a1399d1aed39 Mon Sep 17 00:00:00 2001 From: Caleb Alldrin Date: Fri, 1 Dec 2023 09:18:52 -0800 Subject: [PATCH 2/2] Change to regular DatePicker --- .../TopBar/Items/AddMenu/Items/AddDonation/AddDonation.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/AddDonation/AddDonation.tsx b/src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/AddDonation/AddDonation.tsx index 87f70f6d0..8e23cac96 100644 --- a/src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/AddDonation/AddDonation.tsx +++ b/src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/AddDonation/AddDonation.tsx @@ -21,7 +21,7 @@ import { } from '@mui/material'; import { styled } from '@mui/material/styles'; import { DateTime } from 'luxon'; -import { MobileDatePicker } from '@mui/x-date-pickers'; +import { DatePicker } from '@mui/x-date-pickers'; import { DonationCreateInput } from '../../../../../../../../../graphql/types.generated'; import { useApiConstants } from '../../../../../../../Constants/UseApiConstants'; import { @@ -310,7 +310,7 @@ export const AddDonation = ({ {({ field }: FieldProps) => ( - (