Skip to content

Commit 64b7726

Browse files
authored
[data.indexPatterns] Fix broken rollup index pattern creation (#76593)
1 parent 2db7895 commit 64b7726

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ export class IndexPattern implements IIndexPattern {
481481
fields: this.mapping.fields._serialize!(this.fields),
482482
fieldFormatMap: this.mapping.fieldFormatMap._serialize!(this.fieldFormatMap),
483483
type: this.type,
484-
typeMeta: this.mapping.typeMeta._serialize!(this.mapping),
484+
typeMeta: this.mapping.typeMeta._serialize!(this.typeMeta),
485485
};
486486
}
487487

test/functional/page_objects/settings_page.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,15 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
282282
await PageObjects.header.waitUntilLoadingHasFinished();
283283
}
284284

285-
async clickIndexPatternLogstash() {
286-
const indexLink = await find.byXPath(`//a[descendant::*[text()='logstash-*']]`);
285+
async clickIndexPatternByName(name: string) {
286+
const indexLink = await find.byXPath(`//a[descendant::*[text()='${name}']]`);
287287
await indexLink.click();
288288
}
289289

290+
async clickIndexPatternLogstash() {
291+
await this.clickIndexPatternByName('logstash-*');
292+
}
293+
290294
async getIndexPatternList() {
291295
await testSubjects.existOrFail('indexPatternTable', { timeout: 5000 });
292296
return await find.allByCssSelector(

x-pack/test/functional/apps/rollup_job/hybrid_index_pattern.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import mockRolledUpData, { mockIndices } from './hybrid_index_helper';
1111
export default function ({ getService, getPageObjects }) {
1212
const es = getService('legacyEs');
1313
const esArchiver = getService('esArchiver');
14+
const find = getService('find');
1415
const retry = getService('retry');
1516
const PageObjects = getPageObjects(['common', 'settings']);
1617

@@ -88,6 +89,15 @@ export default function ({ getService, getPageObjects }) {
8889
(i) => i.includes(rollupIndexPatternName) && i.includes('Rollup')
8990
);
9091
expect(filteredIndexPatternNames.length).to.be(1);
92+
93+
// make sure there are no toasts which might be showing unexpected errors
94+
const toastShown = await find.existsByCssSelector('.euiToast');
95+
expect(toastShown).to.be(false);
96+
97+
// ensure all fields are available
98+
await PageObjects.settings.clickIndexPatternByName(rollupIndexPatternName);
99+
const fields = await PageObjects.settings.getFieldNames();
100+
expect(fields).to.eql(['_source', '_id', '_type', '_index', '_score', '@timestamp']);
91101
});
92102

93103
after(async () => {

0 commit comments

Comments
 (0)