Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.12] [Fleet] Fix inactive popover tour not resetting (#176929) #177172

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
EuiText,
EuiTourStep,
useEuiTheme,
EuiLink,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
Expand Down Expand Up @@ -64,17 +65,11 @@ const LeftpaddedNotificationBadge = styled(EuiNotificationBadge)`
margin-left: 10px;
`;

const TourStepNoHeaderFooter = styled(EuiTourStep)`
.euiTourFooter {
display: none;
}
.euiTourHeader {
display: none;
}
`;

const InactiveAgentsTourStep: React.FC<{ isOpen: boolean }> = ({ children, isOpen }) => (
<TourStepNoHeaderFooter
const InactiveAgentsTourStep: React.FC<{
isOpen: boolean;
setInactiveAgentsCalloutHasBeenDismissed: (val: boolean) => void;
}> = ({ children, isOpen, setInactiveAgentsCalloutHasBeenDismissed }) => (
<EuiTourStep
content={
<EuiText size="s">
<FormattedMessage
Expand All @@ -91,9 +86,21 @@ const InactiveAgentsTourStep: React.FC<{ isOpen: boolean }> = ({ children, isOpe
onFinish={() => {}}
anchorPosition="upCenter"
maxWidth={280}
footerAction={
<EuiLink
onClick={() => {
setInactiveAgentsCalloutHasBeenDismissed(true);
}}
>
<FormattedMessage
id="xpack.fleet.addAgentHelpPopover.footActionButton"
defaultMessage="Got it"
/>
</EuiLink>
}
>
{children as React.ReactElement}
</TourStepNoHeaderFooter>
</EuiTourStep>
);

export const AgentStatusFilter: React.FC<{
Expand Down Expand Up @@ -160,6 +167,7 @@ export const AgentStatusFilter: React.FC<{
return (
<InactiveAgentsTourStep
isOpen={newlyInactiveAgentsCount > 0 && !inactiveAgentsCalloutHasBeenDismissed}
setInactiveAgentsCalloutHasBeenDismissed={setInactiveAgentsCalloutHasBeenDismissed}
>
<EuiPopover
ownFocus
Expand Down
Loading