Prevent setting addition from being broken

This commit is contained in:
Charles Bochet 2023-12-03 12:01:37 +01:00
parent fd9467c54d
commit 7e7bd6b9e7
2 changed files with 6 additions and 5 deletions

View File

@ -16,7 +16,7 @@ export const useRelationFieldPreviewValue = ({
: undefined; : undefined;
const { records: relationObjects } = useFindManyRecords({ const { records: relationObjects } = useFindManyRecords({
objectNameSingular: relationObjectMetadataItem?.nameSingular ?? '', objectNameSingular: relationObjectMetadataItem?.nameSingular ?? 'company', // TODO fix this hack
skip: skip || !relationObjectMetadataItem, skip: skip || !relationObjectMetadataItem,
}); });

View File

@ -60,14 +60,15 @@ export const IconPicker = ({
const { icons, isLoadingIcons: isLoading } = useLazyLoadIcons(); const { icons, isLoadingIcons: isLoading } = useLazyLoadIcons();
const iconKeys = useMemo(() => { const iconKeys = useMemo(() => {
const filteredIconKeys = Object.keys(icons).filter( const filteredIconKeys = Object.keys(icons).filter((iconKey) => {
(iconKey) => return (
iconKey !== selectedIconKey && iconKey !== selectedIconKey &&
(!searchString || (!searchString ||
[iconKey, convertIconKeyToLabel(iconKey)].some((label) => [iconKey, convertIconKeyToLabel(iconKey)].some((label) =>
label.toLowerCase().includes(searchString.toLowerCase()), label.toLowerCase().includes(searchString.toLowerCase()),
)), ))
); );
});
return ( return (
selectedIconKey selectedIconKey