[8.x] [AVC Banner] Updates the AVC Banner for 2025 (#205467) (#205820)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[AVC Banner] Updates the AVC Banner for 2025
(#205467)](https://github.com/elastic/kibana/pull/205467)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Candace
Park","email":"56409205+parkiino@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-01-07T18:30:27Z","message":"[AVC
Banner] Updates the AVC Banner for 2025 (#205467)\n\n## Summary\r\n\r\n-
[x] Updates the AVC banner title and blog link\r\n- [x] Banner will
remain visible until EOY 2025 \r\n- [x] Confirm that the original AVC
banner code (not the part that hides\r\nit EOY of 2024) is present in
8.16, 8.17 and 8.x branches\r\n\r\n#
Screenshots\r\n\r\n![image](https://github.com/user-attachments/assets/c2ec37fc-4d42-45f9-aaa1-47b5a6cc715a)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"08535f54a0d9b172f8cd695a5330bcd87f896d7c","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","Team:Defend
Workflows","backport:prev-major","v8.17.0","v8.18.0","v8.16.3","v8.17.1"],"number":205467,"url":"https://github.com/elastic/kibana/pull/205467","mergeCommit":{"message":"[AVC
Banner] Updates the AVC Banner for 2025 (#205467)\n\n## Summary\r\n\r\n-
[x] Updates the AVC banner title and blog link\r\n- [x] Banner will
remain visible until EOY 2025 \r\n- [x] Confirm that the original AVC
banner code (not the part that hides\r\nit EOY of 2024) is present in
8.16, 8.17 and 8.x branches\r\n\r\n#
Screenshots\r\n\r\n![image](https://github.com/user-attachments/assets/c2ec37fc-4d42-45f9-aaa1-47b5a6cc715a)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"08535f54a0d9b172f8cd695a5330bcd87f896d7c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205467","number":205467,"mergeCommit":{"message":"[AVC
Banner] Updates the AVC Banner for 2025 (#205467)\n\n## Summary\r\n\r\n-
[x] Updates the AVC banner title and blog link\r\n- [x] Banner will
remain visible until EOY 2025 \r\n- [x] Confirm that the original AVC
banner code (not the part that hides\r\nit EOY of 2024) is present in
8.16, 8.17 and 8.x branches\r\n\r\n#
Screenshots\r\n\r\n![image](https://github.com/user-attachments/assets/c2ec37fc-4d42-45f9-aaa1-47b5a6cc715a)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"08535f54a0d9b172f8cd695a5330bcd87f896d7c"}},{"branch":"8.17","label":"v8.17.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/205816","number":205816,"state":"OPEN"},{"branch":"8.x","label":"v8.18.0","labelRegex":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/205819","number":205819,"state":"OPEN"}]}]
BACKPORT-->
This commit is contained in:
Candace Park 2025-01-08 11:11:46 -05:00 committed by GitHub
parent 8822613dc6
commit afcddd6f0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 18 additions and 18 deletions

View file

@ -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"
@ -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": [],
@ -75,4 +75,4 @@
"misc": [],
"objects": []
}
}
}

View file

@ -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({

View file

@ -480,7 +480,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`,

View file

@ -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,
@ -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" />
</>
)}

View file

@ -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';