First step of #https://github.com/twentyhq/twenty/issues/3298. Here we update the search endpoint to allow for a filter argument, which we currently use in the relation pickers to restrict or exclude ids from search. In a future PR we will try to simplify the search logic in the FE
20 lines
786 B
TypeScript
20 lines
786 B
TypeScript
import { GoToHotkeyItemEffect } from '@/app/effect-components/GoToHotkeyItemEffect';
|
|
import { useNonSystemActiveObjectMetadataItems } from '@/object-metadata/hooks/useNonSystemActiveObjectMetadataItems';
|
|
import { useGoToHotkeys } from '@/ui/utilities/hotkey/hooks/useGoToHotkeys';
|
|
|
|
export const GotoHotkeys = () => {
|
|
const { nonSystemActiveObjectMetadataItems } =
|
|
useNonSystemActiveObjectMetadataItems();
|
|
|
|
// Hardcoded since settings is static
|
|
useGoToHotkeys('s', '/settings/profile');
|
|
|
|
return nonSystemActiveObjectMetadataItems.map((objectMetadataItem) => (
|
|
<GoToHotkeyItemEffect
|
|
key={`go-to-hokey-item-${objectMetadataItem.id}`}
|
|
hotkey={objectMetadataItem.namePlural[0]}
|
|
pathToNavigateTo={`/objects/${objectMetadataItem.namePlural}`}
|
|
/>
|
|
));
|
|
};
|