diff --git a/src/plugins/unified_histogram/public/services/lens_vis_service.ts b/src/plugins/unified_histogram/public/services/lens_vis_service.ts index 5342ef4723b13..52968693ed650 100644 --- a/src/plugins/unified_histogram/public/services/lens_vis_service.ts +++ b/src/plugins/unified_histogram/public/services/lens_vis_service.ts @@ -329,8 +329,13 @@ export class LensVisService { queryParams: QueryParams; timeInterval: string | undefined; breakdownField: DataViewField | undefined; - }): Suggestion => { + }): Suggestion | undefined => { const { dataView } = queryParams; + + if (!dataView.isTimeBased() || !dataView.timeFieldName) { + return undefined; + } + const showBreakdown = breakdownField && fieldSupportsBreakdown(breakdownField); let columnOrder = ['date_column', 'count_column']; @@ -343,7 +348,7 @@ export class LensVisService { date_column: { dataType: 'date', isBucketed: true, - label: dataView.timeFieldName ?? '', + label: dataView.timeFieldName, operationType: 'date_histogram', scale: 'interval', sourceField: dataView.timeFieldName, diff --git a/test/functional/apps/management/data_views/_handle_alias.ts b/test/functional/apps/management/data_views/_handle_alias.ts index a3b8a0266dae4..ca9f2b1f8cfea 100644 --- a/test/functional/apps/management/data_views/_handle_alias.ts +++ b/test/functional/apps/management/data_views/_handle_alias.ts @@ -18,8 +18,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['common', 'home', 'settings', 'discover', 'timePicker']); const kibanaServer = getService('kibanaServer'); - // Failing: See https://github.com/elastic/kibana/issues/201744 - describe.skip('Index patterns on aliases', function () { + describe('Index patterns on aliases', function () { before(async function () { await kibanaServer.savedObjects.cleanStandardList(); await security.testUser.setRoles(['kibana_admin', 'test_alias_reader']);