mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Passing toolbar prop into action menus
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
d074e0499f
commit
d5a5e83993
@ -57,11 +57,11 @@ export class KubeObjectMenu extends React.Component<KubeObjectMenuProps> {
|
||||
|
||||
render() {
|
||||
const { remove, update, renderRemoveMessage, isEditable, isRemovable } = this;
|
||||
const { className, object, editable, removable, ...menuProps } = this.props;
|
||||
const { className, object, editable, removable, toolbar, ...menuProps } = this.props;
|
||||
if (!object) return null;
|
||||
|
||||
const menuItems = kubeObjectMenuRegistry.getItemsForKind(object.kind, object.apiVersion).map((item, index) => {
|
||||
return <item.components.MenuItem object={object} key={`menu-item-${index}`} />
|
||||
return <item.components.MenuItem object={object} key={`menu-item-${index}`} toolbar={toolbar} />
|
||||
})
|
||||
return (
|
||||
<MenuActions
|
||||
@ -69,6 +69,7 @@ export class KubeObjectMenu extends React.Component<KubeObjectMenuProps> {
|
||||
updateAction={isEditable ? update : undefined}
|
||||
removeAction={isRemovable ? remove : undefined}
|
||||
removeConfirmationMessage={renderRemoveMessage}
|
||||
toolbar={toolbar}
|
||||
{...menuProps}
|
||||
>
|
||||
{menuItems}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user