Do not display back button at the root level of the command menu (#10073)

Do not display back button at the root level of the command menu
This commit is contained in:
Raphaël Bosi
2025-02-07 15:33:02 +01:00
committed by GitHub
parent aee43b10ad
commit 08b8a0cc60
2 changed files with 9 additions and 18 deletions

View File

@ -126,13 +126,15 @@ export const CommandMenuTopBar = () => {
<StyledContentContainer>
{isCommandMenuV2Enabled && (
<>
<CommandMenuContextChip
Icons={[<IconChevronLeft size={theme.icon.size.sm} />]}
onClick={() => {
goBackFromCommandMenu();
}}
testId="command-menu-go-back-button"
/>
{commandMenuPage !== CommandMenuPages.Root && (
<CommandMenuContextChip
Icons={[<IconChevronLeft size={theme.icon.size.sm} />]}
onClick={() => {
goBackFromCommandMenu();
}}
testId="command-menu-go-back-button"
/>
)}
{isDefined(contextStoreCurrentObjectMetadataId) &&
commandMenuPage !== CommandMenuPages.SearchRecords ? (
<CommandMenuContextChipGroupsWithRecordSelection

View File

@ -197,17 +197,6 @@ export const NoResultsSearchFallback: Story = {
},
};
export const GoBack: Story = {
play: async () => {
const canvas = within(document.body);
const goBackButton = await canvas.findByTestId(
'command-menu-go-back-button',
);
await userEvent.click(goBackButton);
await expect(goBackButton).not.toBeVisible();
},
};
export const ClickOnSearchRecordsAndGoBack: Story = {
play: async () => {
const canvas = within(document.body);