Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
[Lens] Histogram/range operation new copy (elastic#78328)
Browse files Browse the repository at this point in the history
* 💬 New copy revision for histogram/range operation in lens

* 👌 Updated panel copy

* 👌 Change copy based on feedback
  • Loading branch information
dej611 authored Oct 1, 2020
1 parent 4d5a9df commit d793040
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand All @@ -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)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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',
})}
/>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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',
});
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit d793040

Please sign in to comment.