Fix multiselect on activities

This commit is contained in:
Charles Bochet 2023-12-14 19:05:10 +01:00
parent 36164ab59b
commit e22b242ef8
3 changed files with 3 additions and 10 deletions

View File

@ -56,7 +56,7 @@ export const useMapToObjectRecordIdentifier = ({
const avatarUrl = const avatarUrl =
objectMetadataItem.nameSingular === CoreObjectNameSingular.Company objectMetadataItem.nameSingular === CoreObjectNameSingular.Company
? getLogoUrlFromDomainName(imageIdentifierFieldValue ?? '') ? getLogoUrlFromDomainName(record['domainName'] ?? '')
: imageIdentifierFieldValue ?? null; : imageIdentifierFieldValue ?? null;
return { return {

View File

@ -10,7 +10,6 @@ import { DropdownMenuSearchInput } from '@/ui/layout/dropdown/components/Dropdow
import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator'; import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator';
import { SelectableItem } from '@/ui/layout/selectable-list/components/SelectableItem'; import { SelectableItem } from '@/ui/layout/selectable-list/components/SelectableItem';
import { SelectableList } from '@/ui/layout/selectable-list/components/SelectableList'; import { SelectableList } from '@/ui/layout/selectable-list/components/SelectableList';
import { useSelectableList } from '@/ui/layout/selectable-list/hooks/useSelectableList';
import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem'; import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem';
import { MenuItemMultiSelectAvatar } from '@/ui/navigation/menu-item/components/MenuItemMultiSelectAvatar'; import { MenuItemMultiSelectAvatar } from '@/ui/navigation/menu-item/components/MenuItemMultiSelectAvatar';
import { useListenClickOutside } from '@/ui/utilities/pointer-event/hooks/useListenClickOutside'; import { useListenClickOutside } from '@/ui/utilities/pointer-event/hooks/useListenClickOutside';
@ -103,12 +102,6 @@ export const MultipleEntitySelect = <
<SelectableItem itemId={entity.id} key={entity.id}> <SelectableItem itemId={entity.id} key={entity.id}>
<MenuItemMultiSelectAvatar <MenuItemMultiSelectAvatar
key={entity.id} key={entity.id}
isKeySelected={
useSelectableList({
selectableListId: 'multiple-entity-select-list',
itemId: entity.id,
}).isSelectedItemId
}
selected={value[entity.id]} selected={value[entity.id]}
onSelectChange={(newCheckedValue) => onSelectChange={(newCheckedValue) =>
onChange({ ...value, [entity.id]: newCheckedValue }) onChange({ ...value, [entity.id]: newCheckedValue })

View File

@ -75,12 +75,12 @@ export const SingleEntitySelectBase = ({
selectableListId="single-entity-select-base-list" selectableListId="single-entity-select-base-list"
selectableItemIdArray={selectableItemIds} selectableItemIdArray={selectableItemIds}
hotkeyScope={RelationPickerHotkeyScope.RelationPicker} hotkeyScope={RelationPickerHotkeyScope.RelationPicker}
onEnter={(_itemId) => { onEnter={(itemId) => {
if (showCreateButton) { if (showCreateButton) {
onCreate?.(); onCreate?.();
} else { } else {
const entity = entitiesInDropdown.findIndex( const entity = entitiesInDropdown.findIndex(
(entity) => entity.id === _itemId, (entity) => entity.id === itemId,
); );
onEntitySelected(entitiesInDropdown[entity]); onEntitySelected(entitiesInDropdown[entity]);
} }