Skip to content

Commit

Permalink
Merge branch 'main' into 156645-update-shards-error-modal
Browse files Browse the repository at this point in the history
  • Loading branch information
jughosta committed Jul 25, 2023
2 parents 9c22251 + 1ea9d40 commit 93466d6
Show file tree
Hide file tree
Showing 21 changed files with 441 additions and 471 deletions.
Expand Up @@ -30,7 +30,13 @@ export const AddAnalyticsCollection: React.FC<AddAnalyticsCollectionProps> = ({
{render ? (
render(showModal)
) : (
<EuiButton fill iconType="plusInCircle" onClick={showModal} disabled={disabled}>
<EuiButton
fill
iconType="plusInCircle"
onClick={showModal}
disabled={disabled}
data-test-subj="create-analytics-collection-btn"
>
{i18n.translate('xpack.enterpriseSearch.analytics.collections.create.buttonTitle', {
defaultMessage: 'Create collection',
})}
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -22,6 +22,7 @@ import {
EuiText,
EuiTitle,
IconType,
IconSize,
} from '@elastic/eui';

import { i18n } from '@kbn/i18n';
Expand All @@ -37,23 +38,29 @@ interface ProductResourceLink {
}

export interface ProductCardProps {
cta: string;
cta?: string;
description: string;
emptyCta?: boolean;
features: string[];
hasBorder?: boolean;
hasShadow?: boolean;
icon: IconType;
iconSize?: IconSize;
name: string;
productId: string;
resourceLinks: ProductResourceLink[];
url: string;
url?: string;
}

export const ProductCard: React.FC<ProductCardProps> = ({
cta,
description,
emptyCta = false,
features,
hasBorder,
hasShadow,
icon,
iconSize,
productId,
name,
resourceLinks,
Expand All @@ -63,14 +70,15 @@ export const ProductCard: React.FC<ProductCardProps> = ({

return (
<EuiPanel
hasBorder
hasBorder={hasBorder ?? true}
hasShadow={hasShadow ?? true}
paddingSize="l"
data-test-subj={`${productId}ProductCard`}
className="productCard"
>
<EuiFlexGroup>
<EuiFlexItem grow={false} data-test-subj="productCard-icon">
<EuiIcon size="xl" type={icon} />
<EuiIcon size={iconSize ?? 'xl'} type={icon} />
</EuiFlexItem>
<EuiFlexItem data-test-subj="productCard-details">
<EuiTitle size="s">
Expand All @@ -81,36 +89,38 @@ export const ProductCard: React.FC<ProductCardProps> = ({
{description}
</EuiText>
<EuiSpacer />
<div>
{emptyCta ? (
<EuiButtonTo
to={url}
shouldNotCreateHref
onClick={() =>
sendEnterpriseSearchTelemetry({
action: 'clicked',
metric: snakeCase(productId),
})
}
>
{cta}
</EuiButtonTo>
) : (
<EuiButtonEmptyTo
flush="both"
to={url}
shouldNotCreateHref
onClick={() =>
sendEnterpriseSearchTelemetry({
action: 'clicked',
metric: snakeCase(productId),
})
}
>
{cta}
</EuiButtonEmptyTo>
)}
</div>
{cta && url && (
<div>
{emptyCta ? (
<EuiButtonTo
to={url}
shouldNotCreateHref
onClick={() =>
sendEnterpriseSearchTelemetry({
action: 'clicked',
metric: snakeCase(productId),
})
}
>
{cta}
</EuiButtonTo>
) : (
<EuiButtonEmptyTo
flush="both"
to={url}
shouldNotCreateHref
onClick={() =>
sendEnterpriseSearchTelemetry({
action: 'clicked',
metric: snakeCase(productId),
})
}
>
{cta}
</EuiButtonEmptyTo>
)}
</div>
)}
</EuiFlexItem>
<EuiFlexItem data-test-subj="productCard-features">
<EuiListGroup flush className="productCard-features">
Expand Down
@@ -0,0 +1,55 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React from 'react';

import { i18n } from '@kbn/i18n';

import { ANALYTICS_PLUGIN } from '../../../../../common/constants';
import { docLinks } from '../../../shared/doc_links';
import baLogo from '../../assets/behavioral_analytics_logo.svg';
import { ProductCard } from '../product_card';

export const BehavioralAnalyticsProductCard = () => (
<ProductCard
cta={i18n.translate('xpack.enterpriseSearch.behavioralAnalytics.productCardCTA', {
defaultMessage: 'Explore Behavioral Analytics',
})}
description={i18n.translate('xpack.enterpriseSearch.behavioralAnalytics.description', {
defaultMessage:
'Dashboards and tools for visualizing end-user behavior and measuring the performance of your search applications',
})}
emptyCta
features={[
i18n.translate('xpack.enterpriseSearch.behavioralAnalytics.features.tracking', {
defaultMessage: "Track users' searching and clicking behavior",
}),
i18n.translate('xpack.enterpriseSearch.behavioralAnalytics.features.dashboard', {
defaultMessage: 'Search management dashboards',
}),
i18n.translate('xpack.enterpriseSearch.behavioralAnalytics.features.contentGaps', {
defaultMessage: 'Identify gaps in your content',
}),
]}
icon={baLogo}
iconSize="l"
name={ANALYTICS_PLUGIN.NAME}
productId={ANALYTICS_PLUGIN.ID}
resourceLinks={[
{
label: i18n.translate(
'xpack.enterpriseSearch.behavioralAnalytics.resources.gettingStartedLabel',
{
defaultMessage: 'Getting started with Behavioral Analytics',
}
),
to: docLinks.behavioralAnalytics,
},
]}
url={ANALYTICS_PLUGIN.URL}
/>
);
@@ -0,0 +1,97 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React from 'react';

import { useValues } from 'kea';

import { i18n } from '@kbn/i18n';

import { ELASTICSEARCH_PLUGIN, SEARCH_EXPERIENCES_PLUGIN } from '../../../../../common/constants';
import { docLinks } from '../../../shared/doc_links';
import { HttpLogic } from '../../../shared/http';
import { ProductCard } from '../product_card';

export const ElasticsearchProductCard = () => {
const { http } = useValues(HttpLogic);
return (
<ProductCard
data-test-subj="productCard-elasticsearch"
description={i18n.translate('xpack.enterpriseSearch.elasticsearch.productCardDescription', {
defaultMessage:
'Ideal for bespoke applications, Elasticsearch helps you build highly customizable search and offers many different ingestion methods.',
})}
features={[
i18n.translate('xpack.enterpriseSearch.elasticsearch.features.integrate', {
defaultMessage: 'Integrate with databases, websites, and more',
}),
i18n.translate('xpack.enterpriseSearch.elasticsearch.features.buildTooling', {
defaultMessage: 'Build custom tooling',
}),
i18n.translate('xpack.enterpriseSearch.elasticsearch.features.buildSearchExperiences', {
defaultMessage: 'Build custom search experiences',
}),
i18n.translate('xpack.enterpriseSearch.elasticsearch.features.esre', {
defaultMessage: 'The Elasticsearch Relevance Engine™ (ESRE)',
}),
]}
icon="logoElasticsearch"
name={ELASTICSEARCH_PLUGIN.NAME}
productId={ELASTICSEARCH_PLUGIN.ID}
resourceLinks={[
{
label: i18n.translate(
'xpack.enterpriseSearch.elasticsearch.resources.gettingStartedLabel',
{
defaultMessage: 'Getting started with Elasticsearch',
}
),
to: docLinks.start,
},
{
label: i18n.translate(
'xpack.enterpriseSearch.elasticsearch.resources.createNewIndexLabel',
{
defaultMessage: 'Create a new index',
}
),
to: docLinks.start,
},
{
label: i18n.translate(
'xpack.enterpriseSearch.elasticsearch.resources.languageClientLabel',
{
defaultMessage: 'Set up a language client',
}
),
to: docLinks.languageClients,
},
{
label: i18n.translate('xpack.enterpriseSearch.elasticsearch.resources.searchUILabel', {
defaultMessage: 'Search UI for Elasticsearch',
}),
to: docLinks.searchUIElasticsearch,
},
{
label: i18n.translate('xpack.enterpriseSearch.elasticsearch.resources.elserLabel', {
defaultMessage: 'ELSER text expansion',
}),
to: docLinks.elser,
},
{
label: i18n.translate(
'xpack.enterpriseSearch.elasticsearch.resources.searchExperiencesLabel',
{
defaultMessage: 'Search Experiences',
}
),
to: http.basePath.prepend(SEARCH_EXPERIENCES_PLUGIN.URL),
},
]}
/>
);
};

0 comments on commit 93466d6

Please sign in to comment.