mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Lens] Fix suffix field format leaks to index pattern management (#107139)
This commit is contained in:
parent
c048f71626
commit
1b315bb01d
2 changed files with 8 additions and 0 deletions
|
@ -31,6 +31,7 @@ export const unitSuffixesLong: Record<TimeScaleUnit, string> = {
|
|||
export function getSuffixFormatter(formatFactory: FormatFactory): FieldFormatInstanceType {
|
||||
return class SuffixFormatter extends FieldFormat {
|
||||
static id = 'suffix';
|
||||
static hidden = true; // Don't want this format to appear in index pattern editor
|
||||
static title = i18n.translate('xpack.lens.fieldFormats.suffix.title', {
|
||||
defaultMessage: 'Suffix',
|
||||
});
|
||||
|
|
|
@ -42,4 +42,11 @@ describe('suffix formatter', () => {
|
|||
|
||||
expect(result).toEqual('');
|
||||
});
|
||||
|
||||
it('should be a hidden formatter', () => {
|
||||
const convertMock = jest.fn((x) => '');
|
||||
const formatFactory = jest.fn(() => ({ convert: convertMock }));
|
||||
const SuffixFormatter = getSuffixFormatter((formatFactory as unknown) as FormatFactory);
|
||||
expect(SuffixFormatter.hidden).toBe(true);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue