Skip to content

Commit

Permalink
[Maps] term join in produce help (#120238)
Browse files Browse the repository at this point in the history
* [Maps] term join in produce help

* snapshot updates

* i18n clean up

* API doc updates

* update API docs, update copy

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* i18n cleanup

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
nreese and kibanamachine authored May 16, 2022
1 parent b0388df commit ffc515b
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 41 deletions.
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
guide: `${KIBANA_DOCS}maps.html`,
importGeospatialPrivileges: `${KIBANA_DOCS}import-geospatial-data.html#import-geospatial-privileges`,
gdalTutorial: `${ELASTIC_WEBSITE_URL}blog/how-to-ingest-geospatial-data-into-elasticsearch-with-gdal`,
termJoinsExample: `${KIBANA_DOCS}terms-join.html#_example_term_join`,
},
monitoring: {
alertsKibana: `${KIBANA_DOCS}kibana-alerts.html`,
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ export interface DocLinks {
guide: string;
importGeospatialPrivileges: string;
gdalTutorial: string;
termJoinsExample: string;
}>;
readonly monitoring: Record<string, string>;
readonly reporting: Readonly<{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class ScalingForm extends Component<Props, State> {
{this._renderModal()}
<EuiTitle size="xs">
<h5>
<FormattedMessage id="xpack.maps.esSearch.scaleTitle" defaultMessage="Scaling" />
<FormattedMessage id="xpack.maps.esSearch.scaleTitle" defaultMessage="Scaling" />{' '}
<ScalingDocumenationPopover
limitOptionLabel={this._getLimitOptionLabel()}
clustersOptionLabel={this._getClustersOptionLabel()}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import React, { Fragment } from 'react';
import uuid from 'uuid/v4';

import { EuiTitle, EuiSpacer, EuiToolTip, EuiTextAlign, EuiCallOut } from '@elastic/eui';
import { EuiTitle, EuiSpacer, EuiTextAlign, EuiCallOut } from '@elastic/eui';

import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import { Join } from './resources/join';
import { JoinDocumentationPopover } from './resources/join_documentation_popover';
import { IVectorLayer } from '../../../classes/layers/vector_layer';
import { JoinDescriptor } from '../../../../common/descriptor_types';
import { SOURCE_TYPES } from '../../../../common/constants';
Expand Down Expand Up @@ -101,17 +101,11 @@ export function JoinEditor({ joins, layer, onChange, leftJoinFields, layerDispla
<div>
<EuiTitle size="xs">
<h5>
<EuiToolTip
content={i18n.translate('xpack.maps.layerPanel.joinEditor.termJoinTooltip', {
defaultMessage:
'Use term joins to augment this layer with properties for data driven styling.',
})}
>
<FormattedMessage
id="xpack.maps.layerPanel.joinEditor.termJoinsTitle"
defaultMessage="Term joins"
/>
</EuiToolTip>
<FormattedMessage
id="xpack.maps.layerPanel.joinEditor.termJoinsTitle"
defaultMessage="Term joins"
/>{' '}
<JoinDocumentationPopover />
</h5>
</EuiTitle>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* 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, { Component } from 'react';
import { EuiButtonIcon, EuiLink, EuiPopover, EuiPopoverTitle, EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { getDocLinks } from '../../../../kibana_services';

interface State {
isPopoverOpen: boolean;
}

export class JoinDocumentationPopover extends Component<{}, State> {
state: State = {
isPopoverOpen: false,
};

_togglePopover = () => {
this.setState((prevState) => ({
isPopoverOpen: !prevState.isPopoverOpen,
}));
};

_closePopover = () => {
this.setState({
isPopoverOpen: false,
});
};

_renderContent() {
return (
<div>
<EuiText grow={false}>
<p>
<FormattedMessage
id="xpack.maps.joinDocs.intro"
defaultMessage="Term joins augment layers with properties for data driven styling. Term joins work as follows:"
/>
</p>
<ul>
<li>
<FormattedMessage
id="xpack.maps.joinDocs.sharedKey"
defaultMessage="A shared key combines vector features, the left source, with the results of an Elasticsearch aggregation, the right source."
/>
</li>
<li>
<FormattedMessage
id="xpack.maps.joinDocs.termsAggregation"
defaultMessage="The terms aggregation creates a bucket for each unique shared key."
/>
</li>
<li>
<FormattedMessage
id="xpack.maps.joinDocs.metrics"
defaultMessage="Metrics are calculated for all documents in a bucket."
/>
</li>
<li>
<FormattedMessage
id="xpack.maps.joinDocs.join"
defaultMessage="The join adds metrics for each terms aggregation bucket with the corresponding shared key."
/>
</li>
</ul>
<p>
<FormattedMessage
id="xpack.maps.joinDocs.noMatches"
defaultMessage="Features that do have have a corresponding terms aggregation bucket are not visible on the map."
/>
</p>
<EuiLink href={getDocLinks().links.maps.termJoinsExample} target="_blank" external={true}>
<FormattedMessage
id="xpack.maps.joinDocs.linkLabel"
defaultMessage="Term join example"
/>
</EuiLink>
</EuiText>
</div>
);
}

render() {
return (
<EuiPopover
id="joinHelpPopover"
anchorPosition="leftCenter"
button={
<EuiButtonIcon
onClick={this._togglePopover}
iconType="documentation"
aria-label="Join documentation"
/>
}
isOpen={this.state.isPopoverOpen}
closePopover={this._closePopover}
repositionOnScroll
ownFocus
>
<EuiPopoverTitle>
<FormattedMessage
id="xpack.maps.layerPanel.joinEditor.termJoinsTitle"
defaultMessage="Term joins"
/>
</EuiPopoverTitle>
{this._renderContent()}
</EuiPopover>
);
}
}
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -16763,7 +16763,6 @@
"xpack.maps.layerPanel.join.deleteJoinAriaLabel": "Supprimer la liaison",
"xpack.maps.layerPanel.join.deleteJoinTitle": "Supprimer la liaison",
"xpack.maps.layerPanel.joinEditor.termJoinsTitle": "Liaisons de terme",
"xpack.maps.layerPanel.joinEditor.termJoinTooltip": "Utilisez les liaisons de terme pour ajouter à ce calque les propriétés de style basées sur les données.",
"xpack.maps.layerPanel.joinExpression.helpText": "Configurez la clé partagée.",
"xpack.maps.layerPanel.joinExpression.joinPopoverTitle": "Liaison",
"xpack.maps.layerPanel.joinExpression.leftFieldLabel": "Champ gauche",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -16897,7 +16897,6 @@
"xpack.maps.layerPanel.join.deleteJoinAriaLabel": "ジョブの削除",
"xpack.maps.layerPanel.join.deleteJoinTitle": "ジョブの削除",
"xpack.maps.layerPanel.joinEditor.termJoinsTitle": "用語結合",
"xpack.maps.layerPanel.joinEditor.termJoinTooltip": "用語結合を使用すると、データに基づくスタイル設定のプロパティでこのレイヤーを強化します。",
"xpack.maps.layerPanel.joinExpression.helpText": "共有キーを構成します。",
"xpack.maps.layerPanel.joinExpression.joinPopoverTitle": "結合",
"xpack.maps.layerPanel.joinExpression.leftFieldLabel": "左のフィールド",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -16923,7 +16923,6 @@
"xpack.maps.layerPanel.join.deleteJoinAriaLabel": "删除联接",
"xpack.maps.layerPanel.join.deleteJoinTitle": "删除联接",
"xpack.maps.layerPanel.joinEditor.termJoinsTitle": "词联接",
"xpack.maps.layerPanel.joinEditor.termJoinTooltip": "使用词联接及属性增强此图层,以实现数据驱动的样式。",
"xpack.maps.layerPanel.joinExpression.helpText": "配置共享密钥。",
"xpack.maps.layerPanel.joinExpression.joinPopoverTitle": "联接",
"xpack.maps.layerPanel.joinExpression.leftFieldLabel": "左字段",
Expand Down

0 comments on commit ffc515b

Please sign in to comment.