[Lens] Histogram/range operation new copy (#78328)

* 💬 New copy revision for histogram/range operation in lens

* 👌 Updated panel copy

* 👌 Change copy based on feedback
This commit is contained in:
Marco Liberati 2020-10-01 14:25:59 +02:00 committed by GitHub
parent 4d5a9df76c
commit d793040082
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 14 deletions

View file

@ -257,7 +257,7 @@ export function DimensionEditor(props: DimensionEditorProps) {
<div className="lnsIndexPatternDimensionEditor__section lnsIndexPatternDimensionEditor__section--shaded">
<EuiFormLabel>
{i18n.translate('xpack.lens.indexPattern.functionsLabel', {
defaultMessage: 'Choose a function',
defaultMessage: 'Select a function',
})}
</EuiFormLabel>
<EuiSpacer size="s" />
@ -277,7 +277,7 @@ export function DimensionEditor(props: DimensionEditorProps) {
<EuiFormRow
data-test-subj="indexPattern-field-selection-row"
label={i18n.translate('xpack.lens.indexPattern.chooseField', {
defaultMessage: 'Choose a field',
defaultMessage: 'Select a field',
})}
fullWidth
isInvalid={Boolean(incompatibleSelectedOperationType || currentFieldIsInvalid)}

View file

@ -208,15 +208,15 @@ export const AdvancedRangeEditor = ({
return (
<EuiFormRow
label={i18n.translate('xpack.lens.indexPattern.ranges.intervals', {
defaultMessage: 'Intervals',
label={i18n.translate('xpack.lens.indexPattern.ranges.customRanges', {
defaultMessage: 'Ranges',
})}
labelAppend={
<EuiText size="xs">
<EuiLink color="danger" onClick={onToggleEditor}>
<EuiIcon size="s" type="cross" color="danger" />{' '}
{i18n.translate('xpack.lens.indexPattern.ranges.customIntervalsRemoval', {
defaultMessage: 'Remove custom intervals',
{i18n.translate('xpack.lens.indexPattern.ranges.customRangesRemoval', {
defaultMessage: 'Remove custom ranges',
})}
</EuiLink>
</EuiText>
@ -286,8 +286,8 @@ export const AdvancedRangeEditor = ({
addNewRange();
setIsOpenByCreation(true);
}}
label={i18n.translate('xpack.lens.indexPattern.ranges.addInterval', {
defaultMessage: 'Add interval',
label={i18n.translate('xpack.lens.indexPattern.ranges.addRange', {
defaultMessage: 'Add range',
})}
/>
</>

View file

@ -15,6 +15,7 @@ import {
EuiFlexGroup,
EuiButtonIcon,
EuiToolTip,
EuiIconTip,
} from '@elastic/eui';
import { IFieldFormat } from 'src/plugins/data/public';
import { RangeColumnParams, UpdateParamsFnType, MODES_TYPES } from './ranges';
@ -45,8 +46,14 @@ const BaseRangeEditor = ({
);
const granularityLabel = i18n.translate('xpack.lens.indexPattern.ranges.granularity', {
defaultMessage: 'Granularity',
defaultMessage: 'Intervals granularity',
});
const granularityLabelDescription = i18n.translate(
'xpack.lens.indexPattern.ranges.granularityDescription',
{
defaultMessage: 'Divides the field into evenly spaced intervals.',
}
);
const decreaseButtonLabel = i18n.translate('xpack.lens.indexPattern.ranges.decreaseButtonLabel', {
defaultMessage: 'Decrease granularity',
});
@ -57,7 +64,17 @@ const BaseRangeEditor = ({
return (
<>
<EuiFormRow
label={granularityLabel}
label={
<>
{granularityLabel}{' '}
<EuiIconTip
position="right"
content={granularityLabelDescription}
type="questionInCircle"
color="subdued"
/>
</>
}
data-test-subj="indexPattern-ranges-section-label"
labelType="legend"
fullWidth
@ -91,7 +108,7 @@ const BaseRangeEditor = ({
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiToolTip content={decreaseButtonLabel} delay="long">
<EuiToolTip content={increaseButtonLabel} delay="long">
<EuiButtonIcon
iconType="plusInCircle"
color="text"
@ -108,7 +125,7 @@ const BaseRangeEditor = ({
<EuiButtonEmpty size="xs" iconType="controlsHorizontal" onClick={() => onToggleEditor()}>
{i18n.translate('xpack.lens.indexPattern.ranges.customIntervalsToggle', {
defaultMessage: 'Create custom intervals',
defaultMessage: 'Create custom ranges',
})}
</EuiButtonEmpty>
</>

View file

@ -78,8 +78,8 @@ function getEsAggsParams({ sourceField, params }: RangeIndexPatternColumn) {
export const rangeOperation: OperationDefinition<RangeIndexPatternColumn, 'field'> = {
type: 'range',
displayName: i18n.translate('xpack.lens.indexPattern.ranges', {
defaultMessage: 'Ranges',
displayName: i18n.translate('xpack.lens.indexPattern.intervals', {
defaultMessage: 'Intervals',
}),
priority: 4, // Higher than terms, so numbers get histogram
input: 'field',