[Fleet] Fix add agent in the package policy table (#104749)
This commit is contained in:
parent
e92892a174
commit
29020c1200
|
@ -28,6 +28,7 @@ export const PackagePolicyActionsMenu: React.FunctionComponent<{
|
||||||
const { getHref } = useLink();
|
const { getHref } = useLink();
|
||||||
const hasWriteCapabilities = useCapabilities().write;
|
const hasWriteCapabilities = useCapabilities().write;
|
||||||
const refreshAgentPolicy = useAgentPolicyRefresh();
|
const refreshAgentPolicy = useAgentPolicyRefresh();
|
||||||
|
const [isActionsMenuOpen, setIsActionsMenuOpen] = useState(false);
|
||||||
|
|
||||||
const onEnrollmentFlyoutClose = useMemo(() => {
|
const onEnrollmentFlyoutClose = useMemo(() => {
|
||||||
return () => setIsEnrollmentFlyoutOpen(false);
|
return () => setIsEnrollmentFlyoutOpen(false);
|
||||||
|
@ -48,7 +49,10 @@ export const PackagePolicyActionsMenu: React.FunctionComponent<{
|
||||||
// </EuiContextMenuItem>,
|
// </EuiContextMenuItem>,
|
||||||
<EuiContextMenuItem
|
<EuiContextMenuItem
|
||||||
icon="plusInCircle"
|
icon="plusInCircle"
|
||||||
onClick={() => setIsEnrollmentFlyoutOpen(true)}
|
onClick={() => {
|
||||||
|
setIsActionsMenuOpen(false);
|
||||||
|
setIsEnrollmentFlyoutOpen(true);
|
||||||
|
}}
|
||||||
key="addAgent"
|
key="addAgent"
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
|
@ -112,7 +116,11 @@ export const PackagePolicyActionsMenu: React.FunctionComponent<{
|
||||||
/>
|
/>
|
||||||
</EuiPortal>
|
</EuiPortal>
|
||||||
)}
|
)}
|
||||||
<ContextMenuActions items={menuItems} />
|
<ContextMenuActions
|
||||||
|
isOpen={isActionsMenuOpen}
|
||||||
|
items={menuItems}
|
||||||
|
onChange={(isOpen) => setIsActionsMenuOpen(isOpen)}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue