mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
TSVB needs to display better UX message when default index pattern is non-time based (#124341)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
a248af003d
commit
c299aabcb3
2 changed files with 16 additions and 1 deletions
|
@ -58,6 +58,16 @@ export class AggNotSupportedError extends UIError {
|
|||
}
|
||||
}
|
||||
|
||||
export class TimeFieldNotSpecifiedError extends UIError {
|
||||
constructor() {
|
||||
super(
|
||||
i18n.translate('visTypeTimeseries.errors.timeFieldNotSpecifiedError', {
|
||||
defaultMessage: 'Time field is required to visualize the data',
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const filterCannotBeAppliedErrorMessage = i18n.translate(
|
||||
'visTypeTimeseries.filterCannotBeAppliedError',
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@ import moment from 'moment';
|
|||
import { AUTO_INTERVAL } from '../../../common/constants';
|
||||
import { validateField } from '../../../common/fields_utils';
|
||||
import { validateInterval } from '../../../common/validate_interval';
|
||||
import { TimeFieldNotSpecifiedError } from '../../../common/errors';
|
||||
|
||||
import type { FetchedIndexPattern, Panel, Series } from '../../../common/types';
|
||||
|
||||
|
@ -34,7 +35,11 @@ export function getIntervalAndTimefield(
|
|||
}
|
||||
|
||||
if (panel.use_kibana_indexes) {
|
||||
validateField(timeField!, index);
|
||||
if (timeField) {
|
||||
validateField(timeField, index);
|
||||
} else {
|
||||
throw new TimeFieldNotSpecifiedError();
|
||||
}
|
||||
}
|
||||
|
||||
let interval = panel.interval;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue