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.17] [AVC Banner] Updates the AVC Banner for 2025 (#205467) #205816

Merged
merged 5 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions api_docs/kbn_avc_banner.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"functions": [
{
"parentPluginId": "@kbn/avc-banner",
"id": "def-public.AVCResultsBanner2024",
"id": "def-public.AVCResultsBanner",
"type": "Function",
"tags": [],
"label": "AVCResultsBanner2024",
"label": "AVCResultsBanner",
"description": [],
"signature": [
"({ onDismiss }: React.PropsWithChildren<{ onDismiss: () => void; }>) => JSX.Element"
Expand All @@ -19,8 +19,8 @@
"children": [
{
"parentPluginId": "@kbn/avc-banner",
"id": "def-public.AVCResultsBanner2024.$1",
"type": "CompoundType",
"id": "def-public.AVCResultsBanner.$1",
"type": "Object",
"tags": [],
"label": "{ onDismiss }",
"description": [],
Expand Down Expand Up @@ -75,4 +75,4 @@
"misc": [],
"objects": []
}
}
}
10 changes: 5 additions & 5 deletions packages/kbn-avc-banner/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ import { FormattedMessage } from '@kbn/i18n-react';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import avcBannerBackground from './avc_banner_background.svg';

// Logic to hide banner at EOY 2024
export const useIsStillYear2024: () => boolean = () => {
// Logic to hide banner at EOY 2025
export const useIsStillYear2025: () => boolean = () => {
return useMemo(() => {
return new Date().getFullYear() === 2024;
return new Date().getFullYear() === 2025;
}, []);
};

export const AVCResultsBanner2024: React.FC<{ onDismiss: () => void }> = ({ onDismiss }) => {
export const AVCResultsBanner: React.FC<{ onDismiss: () => void }> = ({ onDismiss }) => {
const { docLinks } = useKibana().services;
const { euiTheme } = useEuiTheme();
const bannerTitle = i18n.translate('avcBanner.title', {
defaultMessage: '100% protection with zero false positives.',
defaultMessage: 'Proven defense with zero false positives',
});

const calloutStyles = css({
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
},
securitySolution: {
artifactControl: `${SECURITY_SOLUTION_DOCS}artifact-control.html`,
avcResults: `${ELASTIC_WEBSITE_URL}blog/elastic-av-comparatives-business-security-test`,
avcResults: `${ELASTIC_WEBSITE_URL}blog/elastic-security-av-comparatives-business-test`,
bidirectionalIntegrations: `${SECURITY_SOLUTION_DOCS}third-party-actions.html`,
trustedApps: `${SECURITY_SOLUTION_DOCS}trusted-apps-ov.html`,
eventFilters: `${SECURITY_SOLUTION_DOCS}event-filters.html`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { FormattedMessage } from '@kbn/i18n-react';

import { useKibana } from '@kbn/kibana-react-plugin/public';

import { AVCResultsBanner2024, useIsStillYear2024 } from '@kbn/avc-banner';
import { AVCResultsBanner, useIsStillYear2025 } from '@kbn/avc-banner';

import {
isIntegrationPolicyTemplate,
Expand Down Expand Up @@ -336,9 +336,9 @@ export const OverviewPage: React.FC<Props> = memo(
</SideBar>
<EuiFlexItem grow={9} className="eui-textBreakWord">
{isUnverified && <UnverifiedCallout />}
{useIsStillYear2024() && isElasticDefend && showAVCBanner && (
{useIsStillYear2025() && isElasticDefend && showAVCBanner && (
<>
<AVCResultsBanner2024 onDismiss={onAVCBannerDismiss} />
<AVCResultsBanner onDismiss={onAVCBannerDismiss} />
<EuiSpacer size="s" />
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@

import React, { useCallback } from 'react';

import { AVCResultsBanner2024, useIsStillYear2024 } from '@kbn/avc-banner';
import { AVCResultsBanner, useIsStillYear2025 } from '@kbn/avc-banner';
import { useStoredIsAVCBannerDismissed } from '../../hooks/use_stored_state';

export const OnboardingBanner = React.memo(() => {
const [isAVCBannerDismissed, setIsAVCBannerDismissed] = useStoredIsAVCBannerDismissed();
const isStillYear2024 = useIsStillYear2024();
const isStillYear2025 = useIsStillYear2025();

const dismissAVCBanner = useCallback(() => {
setIsAVCBannerDismissed(true);
}, [setIsAVCBannerDismissed]);

if (isAVCBannerDismissed || !isStillYear2024) {
if (isAVCBannerDismissed || !isStillYear2025) {
return null;
}

return <AVCResultsBanner2024 onDismiss={dismissAVCBanner} />;
return <AVCResultsBanner onDismiss={dismissAVCBanner} />;
});
OnboardingBanner.displayName = 'OnboardingBanner';
Loading