Remove "When no records are selected" actions on record page ⌘O (#8575)
Closes #8566 - Introduce the concept of scope for an ActionMenuEntry, scope is either `global` or `record-selection`
This commit is contained in:
@ -65,21 +65,25 @@ export const RightDrawerActionMenuDropdown = () => {
|
||||
}}
|
||||
dropdownComponents={
|
||||
<DropdownMenuItemsContainer>
|
||||
{actionMenuEntries.map((item, index) => (
|
||||
<MenuItem
|
||||
key={index}
|
||||
LeftIcon={item.Icon}
|
||||
onClick={() => {
|
||||
closeDropdown(
|
||||
getRightDrawerActionMenuDropdownIdFromActionMenuId(
|
||||
actionMenuId,
|
||||
),
|
||||
);
|
||||
item.onClick?.();
|
||||
}}
|
||||
text={item.label}
|
||||
/>
|
||||
))}
|
||||
{actionMenuEntries
|
||||
.filter(
|
||||
(actionMenuEntry) => actionMenuEntry.scope === 'record-selection',
|
||||
)
|
||||
.map((actionMenuEntry, index) => (
|
||||
<MenuItem
|
||||
key={index}
|
||||
LeftIcon={actionMenuEntry.Icon}
|
||||
onClick={() => {
|
||||
closeDropdown(
|
||||
getRightDrawerActionMenuDropdownIdFromActionMenuId(
|
||||
actionMenuId,
|
||||
),
|
||||
);
|
||||
actionMenuEntry.onClick?.();
|
||||
}}
|
||||
text={actionMenuEntry.label}
|
||||
/>
|
||||
))}
|
||||
</DropdownMenuItemsContainer>
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user