diff --git a/packages/kbn-shared-ux-components/src/empty_state/assets/index.tsx b/packages/kbn-shared-ux-components/src/empty_state/assets/index.tsx index 001efa143b1cc..e42627da6983f 100644 --- a/packages/kbn-shared-ux-components/src/empty_state/assets/index.tsx +++ b/packages/kbn-shared-ux-components/src/empty_state/assets/index.tsx @@ -8,7 +8,7 @@ import React from 'react'; -import { EuiLoadingSpinner } from '@elastic/eui'; +import { EuiPanel } from '@elastic/eui'; import { withSuspense } from '@kbn/shared-ux-utility'; @@ -20,5 +20,5 @@ export const LazyDataViewIllustration = React.lazy(() => export const DataViewIllustration = withSuspense( LazyDataViewIllustration, - + ); diff --git a/packages/kbn-shared-ux-components/src/empty_state/no_data_views/no_data_views.component.test.tsx b/packages/kbn-shared-ux-components/src/empty_state/no_data_views/no_data_views.component.test.tsx index 1d8028d4889a0..87dd68e202bc2 100644 --- a/packages/kbn-shared-ux-components/src/empty_state/no_data_views/no_data_views.component.test.tsx +++ b/packages/kbn-shared-ux-components/src/empty_state/no_data_views/no_data_views.component.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { EuiButton, EuiPanel } from '@elastic/eui'; +import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; import { NoDataViews } from './no_data_views.component'; import { DocumentationLink } from './documentation_link'; @@ -21,7 +21,7 @@ describe('', () => { dataViewsDocLink={'dummy'} /> ); - expect(component.find(EuiPanel).length).toBe(1); + expect(component.find(EuiEmptyPrompt).length).toBe(1); expect(component.find(EuiButton).length).toBe(1); expect(component.find(DocumentationLink).length).toBe(1); }); diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_card/__snapshots__/elastic_agent_card.component.test.tsx.snap b/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_card/__snapshots__/elastic_agent_card.component.test.tsx.snap index ab465d9a6c5b2..c871196b92282 100644 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_card/__snapshots__/elastic_agent_card.component.test.tsx.snap +++ b/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_card/__snapshots__/elastic_agent_card.component.test.tsx.snap @@ -4,7 +4,21 @@ exports[`ElasticAgentCardComponent props button 1`] = ` + } title="Add Elastic Agent" /> `; @@ -13,7 +27,21 @@ exports[`ElasticAgentCardComponent props href 1`] = ` + } title="Add Elastic Agent" /> `; @@ -21,7 +49,21 @@ exports[`ElasticAgentCardComponent props href 1`] = ` exports[`ElasticAgentCardComponent renders 1`] = ` + } title="Add Elastic Agent" /> `; @@ -35,7 +77,21 @@ exports[`ElasticAgentCardComponent renders with canAccessFleet false 1`] = ` This integration is not yet enabled. Your administrator has the required permissions to turn it on. } - image="test-file-stub" + image={ + + } isDisabled={true} title={ + } title="Add Elastic Agent" > } href="/app/integrations/browse" - image="test-file-stub" + image={ + + } paddingSize="l" title="Add Elastic Agent" > @@ -287,10 +315,37 @@ exports[`ElasticAgentCard renders 1`] = `
- + size="fullWidth" + style={ + Object { + "background": "aliceblue", + "height": 240, + "objectFit": "cover", + "width": "max(100%, 360px)", + } + } + url="test-file-stub" + > +
+ +
+
; + const image = ( + + ); + + return ; }; diff --git a/src/plugins/kibana_react/public/page_template/no_data_page/no_data_card/__snapshots__/elastic_agent_card.test.tsx.snap b/src/plugins/kibana_react/public/page_template/no_data_page/no_data_card/__snapshots__/elastic_agent_card.test.tsx.snap index f6dcf46b27d8c..c11c1a11e7369 100644 --- a/src/plugins/kibana_react/public/page_template/no_data_page/no_data_card/__snapshots__/elastic_agent_card.test.tsx.snap +++ b/src/plugins/kibana_react/public/page_template/no_data_page/no_data_card/__snapshots__/elastic_agent_card.test.tsx.snap @@ -27,7 +27,21 @@ exports[`ElasticAgentCard props button 1`] = ` } href="/app/integrations/browse" - image="/plugins/kibanaReact/assets/elastic_agent_card.svg" + image={ + + } paddingSize="l" title={ @@ -67,7 +81,21 @@ exports[`ElasticAgentCard props category 1`] = ` } href="/app/integrations/browse/custom" - image="/plugins/kibanaReact/assets/elastic_agent_card.svg" + image={ + + } paddingSize="l" title={ @@ -107,7 +135,21 @@ exports[`ElasticAgentCard props href 1`] = ` } href="#" - image="/plugins/kibanaReact/assets/elastic_agent_card.svg" + image={ + + } paddingSize="l" title={ @@ -147,7 +189,21 @@ exports[`ElasticAgentCard props recommended 1`] = ` } href="/app/integrations/browse" - image="/plugins/kibanaReact/assets/elastic_agent_card.svg" + image={ + + } paddingSize="l" title={ @@ -187,7 +243,21 @@ exports[`ElasticAgentCard renders 1`] = ` } href="/app/integrations/browse" - image="/plugins/kibanaReact/assets/elastic_agent_card.svg" + image={ + + } paddingSize="l" title={ diff --git a/src/plugins/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.tsx b/src/plugins/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.tsx index 2cec3045c31c1..a8701fb7b7a34 100644 --- a/src/plugins/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.tsx +++ b/src/plugins/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.tsx @@ -9,7 +9,7 @@ import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; import { CoreStart } from '@kbn/core/public'; -import { EuiButton, EuiCard, EuiTextColor, EuiScreenReaderOnly } from '@elastic/eui'; +import { EuiButton, EuiCard, EuiTextColor, EuiScreenReaderOnly, EuiImage } from '@elastic/eui'; import { useKibana } from '../../../context'; import { NoDataPageActions, NO_DATA_RECOMMENDED } from '../no_data_page'; import { RedirectAppLinks } from '../../../app_links'; @@ -35,10 +35,24 @@ export const ElasticAgentCard: FunctionComponent = ({ services: { http, application }, } = useKibana(); const addBasePath = http.basePath.prepend; - const image = addBasePath(`/plugins/kibanaReact/assets/elastic_agent_card.svg`); + const imageUrl = addBasePath(`/plugins/kibanaReact/assets/elastic_agent_card.svg`); const canAccessFleet = application.capabilities.navLinks.integrations; const hasCategory = category ? `/${category}` : ''; + const image = ( + + ); + if (!canAccessFleet) { return (