mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Indexed fields type filter (#10708)
* Add a dropdown to filter indexed fields by type Added tests and test subjects for index pattern filters Use UI Framework components Change index field filter to use kuiFieldGroup, move filters below tabs * Dynamically load indexed type filter based on existing field types * Iterate over fields once to get types / languages * Only check scripted flag for checking scripted lang fields, all other fields should have their type added to type filter
This commit is contained in:
parent
1914d159a5
commit
b4c18e4aa4
9 changed files with 246 additions and 17 deletions
59
test/functional/apps/management/_index_pattern_filter.js
Normal file
59
test/functional/apps/management/_index_pattern_filter.js
Normal file
|
@ -0,0 +1,59 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
defaultTimeout,
|
||||
scenarioManager,
|
||||
esClient
|
||||
} from '../../../support';
|
||||
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('index pattern filter', function describeIndexTests() {
|
||||
bdd.before(function () {
|
||||
// delete .kibana index and then wait for Kibana to re-create it
|
||||
return esClient.deleteAndUpdateConfigDoc()
|
||||
.then(function () {
|
||||
return PageObjects.settings.navigateTo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.settings.clickKibanaIndicies();
|
||||
});
|
||||
});
|
||||
|
||||
bdd.beforeEach(function () {
|
||||
return PageObjects.settings.createIndexPattern();
|
||||
});
|
||||
|
||||
bdd.afterEach(function () {
|
||||
return PageObjects.settings.removeIndexPattern();
|
||||
});
|
||||
|
||||
bdd.it('should filter indexed fields', async function () {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndicies();
|
||||
const fieldTypesBefore = await PageObjects.settings.getFieldTypes();
|
||||
|
||||
|
||||
await PageObjects.settings.setFieldTypeFilter('string');
|
||||
|
||||
await PageObjects.common.try(async function() {
|
||||
const fieldTypes = await PageObjects.settings.getFieldTypes();
|
||||
expect(fieldTypes.length).to.be.above(0);
|
||||
for (const fieldType of fieldTypes) {
|
||||
expect(fieldType).to.be('string');
|
||||
}
|
||||
});
|
||||
|
||||
await PageObjects.settings.setFieldTypeFilter('number');
|
||||
|
||||
await PageObjects.common.try(async function() {
|
||||
const fieldTypes = await PageObjects.settings.getFieldTypes();
|
||||
expect(fieldTypes.length).to.be.above(0);
|
||||
for (const fieldType of fieldTypes) {
|
||||
expect(fieldType).to.be('number');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
70
test/functional/apps/management/_scripted_fields_filter.js
Normal file
70
test/functional/apps/management/_scripted_fields_filter.js
Normal file
|
@ -0,0 +1,70 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
scenarioManager,
|
||||
esClient
|
||||
} from '../../../support';
|
||||
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
|
||||
bdd.describe('filter scripted fields', function describeIndexTests() {
|
||||
|
||||
bdd.beforeEach(async function () {
|
||||
await PageObjects.remote.setWindowSize(1200,800);
|
||||
// delete .kibana index and then wait for Kibana to re-create it
|
||||
await esClient.deleteAndUpdateConfigDoc({ 'dateFormat:tz':'UTC' });
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndicies();
|
||||
await PageObjects.settings.createIndexPattern();
|
||||
await esClient.updateConfigDoc({ 'dateFormat:tz':'UTC' });
|
||||
});
|
||||
|
||||
const scriptedExpressionFieldName = 'ram_expr1';
|
||||
const scriptedPainlessFieldName = 'ram_pain1';
|
||||
|
||||
bdd.it('should filter scripted fields', async function () {
|
||||
await PageObjects.settings.navigateTo();
|
||||
await PageObjects.settings.clickKibanaIndicies();
|
||||
await PageObjects.settings.clickScriptedFieldsTab();
|
||||
const scriptedFieldLangsBefore = await PageObjects.settings.getScriptedFieldLangs();
|
||||
await PageObjects.common.debug('add scripted field');
|
||||
await PageObjects.settings
|
||||
.addScriptedField(scriptedExpressionFieldName,
|
||||
'expression', 'number', null, '1', 'doc[\'machine.ram\'].value / (1024 * 1024 * 1024)'
|
||||
);
|
||||
await PageObjects.settings
|
||||
.addScriptedField(scriptedPainlessFieldName,
|
||||
'painless', 'number', null, '1', 'doc[\'machine.ram\'].value / (1024 * 1024 * 1024)'
|
||||
);
|
||||
|
||||
// confirm two additional scripted fields were created
|
||||
await PageObjects.common.try(async function() {
|
||||
const scriptedFieldLangs = await PageObjects.settings.getScriptedFieldLangs();
|
||||
expect(scriptedFieldLangs.length).to.be(scriptedFieldLangsBefore.length + 2);
|
||||
});
|
||||
|
||||
await PageObjects.settings.setScriptedFieldLanguageFilter('painless');
|
||||
|
||||
await PageObjects.common.try(async function() {
|
||||
const scriptedFieldLangs = await PageObjects.settings.getScriptedFieldLangs();
|
||||
expect(scriptedFieldLangs.length).to.be.above(0);
|
||||
for (const lang of scriptedFieldLangs) {
|
||||
expect(lang).to.be('painless');
|
||||
}
|
||||
});
|
||||
|
||||
await PageObjects.settings.setScriptedFieldLanguageFilter('expression');
|
||||
|
||||
await PageObjects.common.try(async function() {
|
||||
const scriptedFieldLangs = await PageObjects.settings.getScriptedFieldLangs();
|
||||
expect(scriptedFieldLangs.length).to.be.above(0);
|
||||
for (const lang of scriptedFieldLangs) {
|
||||
expect(lang).to.be('expression');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
|
@ -22,4 +22,6 @@ bdd.describe('settings app', function () {
|
|||
require('./_index_pattern_popularity');
|
||||
require('./_kibana_settings');
|
||||
require('./_scripted_fields');
|
||||
require('./_index_pattern_filter');
|
||||
require('./_scripted_fields_filter');
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue