mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[data views] Allow selection of timestamp when some index pattern segments are unmet (#189336)
Currently, if you attempt to create a data view with a index pattern where some of the segments aren't matched, you can't select a timestamp field. This is a common use case for security and observability. This PR allows a timestamp selection as expected. Closes https://github.com/elastic/kibana/issues/189024
This commit is contained in:
parent
3f7d1f226f
commit
afa4313289
3 changed files with 10 additions and 3 deletions
|
@ -350,6 +350,7 @@ export class DataViewEditorService {
|
|||
const getFieldsOptions: GetFieldsOptions = {
|
||||
pattern: this.indexPattern,
|
||||
allowHidden: this.allowHidden,
|
||||
allowNoIndex: true,
|
||||
};
|
||||
if (this.type === INDEX_PATTERN_TYPE.ROLLUP) {
|
||||
getFieldsOptions.type = INDEX_PATTERN_TYPE.ROLLUP;
|
||||
|
|
|
@ -93,9 +93,7 @@ export class IndexPatternsFetcher {
|
|||
fieldTypes,
|
||||
includeEmptyFields,
|
||||
} = options;
|
||||
const allowNoIndices = fieldCapsOptions
|
||||
? fieldCapsOptions.allow_no_indices
|
||||
: this.allowNoIndices;
|
||||
const allowNoIndices = fieldCapsOptions?.allow_no_indices || this.allowNoIndices;
|
||||
|
||||
const expandWildcards = allowHidden ? 'all' : 'open';
|
||||
|
||||
|
|
|
@ -147,10 +147,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
return Promise.all(comparedHeaders);
|
||||
});
|
||||
});
|
||||
|
||||
it('should support unmatched index pattern segments', async function () {
|
||||
await PageObjects.settings.createIndexPattern('l*,z*', '@timestamp');
|
||||
const patternName = await PageObjects.settings.getIndexPageHeading();
|
||||
expect(patternName).to.be('l*,z*');
|
||||
await PageObjects.settings.removeIndexPattern();
|
||||
});
|
||||
});
|
||||
|
||||
describe('edit index pattern', () => {
|
||||
it('on edit click', async () => {
|
||||
await testSubjects.click('detail-link-logstash-*');
|
||||
await PageObjects.settings.editIndexPattern('logstash-*', '@timestamp', 'Logstash Star');
|
||||
|
||||
await retry.try(async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue