323 add object name inside the search (#9962)
Closes https://github.com/twentyhq/core-team-issues/issues/323 Before: <img width="495" alt="Capture d’écran 2025-01-31 à 18 11 56" src="https://github.com/user-attachments/assets/dd1d3ac1-6c97-4398-b233-d323eeacdbb9" /> After: <img width="500" alt="Capture d’écran 2025-01-31 à 18 09 58" src="https://github.com/user-attachments/assets/68d23990-2d0b-437d-ad2e-a686cdb320e1" />
This commit is contained in:
@ -8,6 +8,7 @@ import { ReactNode } from 'react';
|
||||
|
||||
export type CommandMenuItemProps = {
|
||||
label: string;
|
||||
description?: string;
|
||||
to?: string;
|
||||
id: string;
|
||||
onClick?: () => void;
|
||||
@ -19,6 +20,7 @@ export type CommandMenuItemProps = {
|
||||
|
||||
export const CommandMenuItem = ({
|
||||
label,
|
||||
description,
|
||||
to,
|
||||
id,
|
||||
onClick,
|
||||
@ -40,6 +42,7 @@ export const CommandMenuItem = ({
|
||||
<MenuItemCommand
|
||||
LeftIcon={Icon}
|
||||
text={label}
|
||||
description={description}
|
||||
hotKeys={hotKeys}
|
||||
onClick={() =>
|
||||
onItemClick({
|
||||
|
||||
@ -124,6 +124,7 @@ export const CommandMenuList = ({
|
||||
id={item.id}
|
||||
Icon={item.Icon}
|
||||
label={item.label}
|
||||
description={item.description}
|
||||
to={item.to}
|
||||
onClick={item.onCommandClick}
|
||||
hotKeys={item.hotKeys}
|
||||
|
||||
@ -123,6 +123,8 @@ export const SearchRecordsAction: Story = {
|
||||
await sleep(openTimeout);
|
||||
await userEvent.type(searchInput, 'n');
|
||||
expect(await canvas.findByText('Linkedin')).toBeVisible();
|
||||
const companyTexts = await canvas.findAllByText('Company');
|
||||
expect(companyTexts[0]).toBeVisible();
|
||||
expect(await canvas.findByText(companiesMock[0].name)).toBeVisible();
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user