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:
Raphaël Bosi
2025-02-01 08:18:48 +01:00
committed by GitHub
parent 58aa86cc0c
commit d9b86475d3
7 changed files with 42 additions and 1 deletions

View File

@ -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({

View File

@ -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}

View File

@ -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();
},
};