Skip to content

Commit 839c018

Browse files
committed
wip
1 parent 93b842a commit 839c018

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/duration.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ describe('DurationFormatEditor', () => {
133133
const labels = component.find(EuiSwitch);
134134
expect(labels.length).toEqual(2);
135135
expect(labels.get(0).props.label.props.defaultMessage).toEqual('Use short suffix');
136+
expect(labels.get(0).props.disabled).toEqual(false);
136137
expect(labels.get(1).props.label.props.defaultMessage).toEqual(
137138
'Include space between suffix and value'
138139
);

src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/duration.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ export class DurationFormatEditor extends DefaultFormatEditor<
187187
)}
188188
<EuiFormRow>
189189
<EuiSwitch
190-
disabled={!Boolean(formatParams.showSuffix)}
190+
disabled={
191+
!Boolean(formatParams.showSuffix) && !(format as DurationFormat).isHumanPrecise()
192+
}
191193
label={
192194
<FormattedMessage
193195
id="indexPatternFieldEditor.duration.showSuffixLabel.short"

0 commit comments

Comments
 (0)