Skip to content

Commit

Permalink
Merge branch 'main' of github.com:elastic/kibana into feature-fleet-m…
Browse files Browse the repository at this point in the history
…ultiple-output-ui
  • Loading branch information
nchaulet committed Nov 22, 2021
2 parents 842143b + 25ddd37 commit ebbaa96
Show file tree
Hide file tree
Showing 151 changed files with 618 additions and 170 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
/src/plugins/data_view_field_editor @elastic/kibana-app-services
/src/plugins/screenshot_mode @elastic/kibana-app-services
/src/plugins/bfetch/ @elastic/kibana-app-services
/src/plugins/index_pattern_management/ @elastic/kibana-app-services
/src/plugins/data_view_management/ @elastic/kibana-app-services
/src/plugins/inspector/ @elastic/kibana-app-services
/x-pack/examples/ui_actions_enhanced_examples/ @elastic/kibana-app-services
/x-pack/plugins/data_enhanced/ @elastic/kibana-app-services
Expand Down
2 changes: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"presentationUtil": "src/plugins/presentation_util",
"indexPatternEditor": "src/plugins/index_pattern_editor",
"indexPatternFieldEditor": "src/plugins/data_view_field_editor",
"indexPatternManagement": "src/plugins/index_pattern_management",
"indexPatternManagement": "src/plugins/data_view_management",
"interactiveSetup": "src/plugins/interactive_setup",
"advancedSettings": "src/plugins/advanced_settings",
"kibana_legacy": "src/plugins/kibana_legacy",
Expand Down
8 changes: 4 additions & 4 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ as uiSettings within the code.
|The reusable field editor across Kibana!
|{kib-repo}blob/{branch}/src/plugins/data_view_management[dataViewManagement]
|WARNING: Missing README.
|{kib-repo}blob/{branch}/src/plugins/data_views/README.mdx[dataViews]
|The data views API provides a consistent method of structuring and formatting documents
and field lists across the various Kibana apps. Its typically used in conjunction with
Expand Down Expand Up @@ -145,10 +149,6 @@ for use in their own application.
|Create index patterns from within Kibana apps.
|{kib-repo}blob/{branch}/src/plugins/index_pattern_management[indexPatternManagement]
|WARNING: Missing README.
|{kib-repo}blob/{branch}/src/plugins/input_control_vis/README.md[inputControlVis]
|Contains the input control visualization allowing to place custom filter controls on a dashboard.
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,5 @@ pageLoadAssetSize:
urlDrilldown: 30063
indexPatternEditor: 19123
dataViewFieldEditor: 20000
indexPatternManagement: 19165
dataViewManagement: 5000
reporting: 57003
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../../..',
roots: ['<rootDir>/src/plugins/index_pattern_management'],
roots: ['<rootDir>/src/plugins/data_view_management'],
testRunner: 'jasmine2',
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/src/plugins/index_pattern_management',
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/src/plugins/data_view_management',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/src/plugins/index_pattern_management/{public,server}/**/*.{ts,tsx}',
],
collectCoverageFrom: ['<rootDir>/src/plugins/data_view_management/{public,server}/**/*.{ts,tsx}'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "indexPatternManagement",
"id": "dataViewManagement",
"version": "kibana",
"server": true,
"ui": true,
Expand All @@ -9,5 +9,5 @@
"name": "App Services",
"githubTeam": "kibana-app-services"
},
"description": "Index pattern management app"
"description": "Data view management app"
}
2 changes: 0 additions & 2 deletions test/functional/apps/visualize/_tsvb_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
]);

describe('visual builder', function describeIndexTests() {
this.tags('includeFirefox');

before(async () => {
await visualize.initTests();
});
Expand Down
238 changes: 124 additions & 114 deletions test/functional/apps/visualize/_tsvb_time_series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,147 +49,157 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await visualBuilder.clickDataTab('timeSeries');
});

it('should render all necessary components', async () => {
await visualBuilder.checkTimeSeriesChartIsPresent();
await visualBuilder.checkTimeSeriesLegendIsPresent();
});
describe('basics', () => {
this.tags('includeFirefox');

it('should show the correct count in the legend', async () => {
await retry.try(async () => {
const actualCount = await visualBuilder.getRhythmChartLegendValue();
expect(actualCount).to.be('156');
it('should render all necessary components', async () => {
await visualBuilder.checkTimeSeriesChartIsPresent();
await visualBuilder.checkTimeSeriesLegendIsPresent();
});
});

it('should show the correct count in the legend with 2h offset', async () => {
await visualBuilder.clickSeriesOption();
await visualBuilder.enterOffsetSeries('2h');
const actualCount = await visualBuilder.getRhythmChartLegendValue();
expect(actualCount).to.be('293');
});

it('should show the correct count in the legend with -2h offset', async () => {
await visualBuilder.clickSeriesOption();
await visualBuilder.enterOffsetSeries('-2h');
const actualCount = await visualBuilder.getRhythmChartLegendValue();
expect(actualCount).to.be('53');
});

it('should open color picker, deactivate panel and clone series', async () => {
await visualBuilder.clickColorPicker();
await visualBuilder.checkColorPickerPopUpIsPresent();
await visualBuilder.clickColorPicker();

await visualBuilder.changePanelPreview();
await visualBuilder.checkPreviewIsDisabled();
await visualBuilder.changePanelPreview();

await visualBuilder.cloneSeries();
const legend = await visualBuilder.getLegendItems();
const series = await visualBuilder.getSeries();
expect(legend.length).to.be(2);
expect(series.length).to.be(2);
});

it('should show the correct count in the legend with custom numeric formatter', async () => {
const expectedLegendValue = '$ 156';
it('should show the correct count in the legend', async () => {
await retry.try(async () => {
const actualCount = await visualBuilder.getRhythmChartLegendValue();
expect(actualCount).to.be('156');
});
});

await visualBuilder.clickSeriesOption();
await visualBuilder.changeDataFormatter('number');
await visualBuilder.enterSeriesTemplate('$ {{value}}');
await retry.try(async () => {
it('should show the correct count in the legend with 2h offset', async () => {
await visualBuilder.clickSeriesOption();
await visualBuilder.enterOffsetSeries('2h');
const actualCount = await visualBuilder.getRhythmChartLegendValue();
expect(actualCount).to.be(expectedLegendValue);
expect(actualCount).to.be('293');
});
});

it('should show the correct count in the legend with percent formatter', async () => {
const expectedLegendValue = '15,600%';
it('should show the correct count in the legend with -2h offset', async () => {
await visualBuilder.clickSeriesOption();
await visualBuilder.enterOffsetSeries('-2h');
const actualCount = await visualBuilder.getRhythmChartLegendValue();
expect(actualCount).to.be('53');
});

await visualBuilder.clickSeriesOption();
await visualBuilder.changeDataFormatter('percent');
const actualCount = await visualBuilder.getRhythmChartLegendValue();
expect(actualCount).to.be(expectedLegendValue);
});
it('should open color picker, deactivate panel and clone series', async () => {
await visualBuilder.clickColorPicker();
await visualBuilder.checkColorPickerPopUpIsPresent();
await visualBuilder.clickColorPicker();

it('should show the correct count in the legend with bytes formatter', async () => {
const expectedLegendValue = '156B';
await visualBuilder.changePanelPreview();
await visualBuilder.checkPreviewIsDisabled();
await visualBuilder.changePanelPreview();

await visualBuilder.clickSeriesOption();
await visualBuilder.changeDataFormatter('bytes');
const actualCount = await visualBuilder.getRhythmChartLegendValue();
expect(actualCount).to.be(expectedLegendValue);
});
await visualBuilder.cloneSeries();
const legend = await visualBuilder.getLegendItems();
const series = await visualBuilder.getSeries();
expect(legend.length).to.be(2);
expect(series.length).to.be(2);
});

it('should show the correct count in the legend with "Human readable" duration formatter', async () => {
await visualBuilder.clickSeriesOption();
await visualBuilder.changeDataFormatter('duration');
await visualBuilder.setDurationFormatterSettings({ to: 'Human readable' });
const actualCountDefault = await visualBuilder.getRhythmChartLegendValue();
expect(actualCountDefault).to.be('a few seconds');

log.debug(`to: 'Human readable', from: 'Seconds'`);
await visualBuilder.setDurationFormatterSettings({ to: 'Human readable', from: 'Seconds' });
const actualCountSec = await visualBuilder.getRhythmChartLegendValue();
expect(actualCountSec).to.be('3 minutes');

log.debug(`to: 'Human readable', from: 'Minutes'`);
await visualBuilder.setDurationFormatterSettings({ to: 'Human readable', from: 'Minutes' });
const actualCountMin = await visualBuilder.getRhythmChartLegendValue();
expect(actualCountMin).to.be('3 hours');
});
it('should show the correct count in the legend with custom numeric formatter', async () => {
const expectedLegendValue = '$ 156';

describe('Dark mode', () => {
before(async () => {
await kibanaServer.uiSettings.update({
'theme:darkMode': true,
await visualBuilder.clickSeriesOption();
await visualBuilder.changeDataFormatter('number');
await visualBuilder.enterSeriesTemplate('$ {{value}}');
await retry.try(async () => {
const actualCount = await visualBuilder.getRhythmChartLegendValue();
expect(actualCount).to.be(expectedLegendValue);
});
});

it(`viz should have light class when background color is white`, async () => {
await visualBuilder.clickPanelOptions('timeSeries');
await visualBuilder.setBackgroundColor('#FFFFFF');
it('should show the correct count in the legend with percent formatter', async () => {
const expectedLegendValue = '15,600%';

expect(await visualBuilder.checkTimeSeriesIsLight()).to.be(true);
await visualBuilder.clickSeriesOption();
await visualBuilder.changeDataFormatter('percent');
const actualCount = await visualBuilder.getRhythmChartLegendValue();
expect(actualCount).to.be(expectedLegendValue);
});

after(async () => {
await kibanaServer.uiSettings.update({
'theme:darkMode': false,
});
it('should show the correct count in the legend with bytes formatter', async () => {
const expectedLegendValue = '156B';

await visualBuilder.clickSeriesOption();
await visualBuilder.changeDataFormatter('bytes');
const actualCount = await visualBuilder.getRhythmChartLegendValue();
expect(actualCount).to.be(expectedLegendValue);
});
});

describe('Clicking on the chart', () => {
it(`should create a filter`, async () => {
await visualBuilder.setMetricsGroupByTerms('machine.os.raw', {
include: 'win 7',
exclude: 'ios',
});
it('should show the correct count in the legend with "Human readable" duration formatter', async () => {
await visualBuilder.clickSeriesOption();
await testSubjects.click('visualizeSaveButton');
await visualBuilder.changeDataFormatter('duration');
await visualBuilder.setDurationFormatterSettings({ to: 'Human readable' });
const actualCountDefault = await visualBuilder.getRhythmChartLegendValue();
expect(actualCountDefault).to.be('a few seconds');

log.debug(`to: 'Human readable', from: 'Seconds'`);
await visualBuilder.setDurationFormatterSettings({
to: 'Human readable',
from: 'Seconds',
});
const actualCountSec = await visualBuilder.getRhythmChartLegendValue();
expect(actualCountSec).to.be('3 minutes');

await timeToVisualize.saveFromModal('My TSVB viz 1', {
addToDashboard: 'new',
saveToLibrary: false,
log.debug(`to: 'Human readable', from: 'Minutes'`);
await visualBuilder.setDurationFormatterSettings({
to: 'Human readable',
from: 'Minutes',
});
const actualCountMin = await visualBuilder.getRhythmChartLegendValue();
expect(actualCountMin).to.be('3 hours');
});

await dashboard.waitForRenderComplete();
const el = await elasticChart.getCanvas();
// click on specific coordinates
await browser
.getActions()
.move({ x: 105, y: 115, origin: el._webElement })
.click()
.perform();
describe('Dark mode', () => {
before(async () => {
await kibanaServer.uiSettings.update({
'theme:darkMode': true,
});
});

await retry.try(async () => {
await testSubjects.click('applyFiltersPopoverButton');
await testSubjects.missingOrFail('applyFiltersPopoverButton');
it(`viz should have light class when background color is white`, async () => {
await visualBuilder.clickPanelOptions('timeSeries');
await visualBuilder.setBackgroundColor('#FFFFFF');

expect(await visualBuilder.checkTimeSeriesIsLight()).to.be(true);
});

after(async () => {
await kibanaServer.uiSettings.update({
'theme:darkMode': false,
});
});
});

const hasMachineRawFilter = await filterBar.hasFilter('machine.os.raw', 'win 7');
expect(hasMachineRawFilter).to.be(true);
describe('Clicking on the chart', () => {
it(`should create a filter`, async () => {
await visualBuilder.setMetricsGroupByTerms('machine.os.raw', {
include: 'win 7',
exclude: 'ios',
});
await visualBuilder.clickSeriesOption();
await testSubjects.click('visualizeSaveButton');

await timeToVisualize.saveFromModal('My TSVB viz 1', {
addToDashboard: 'new',
saveToLibrary: false,
});

await dashboard.waitForRenderComplete();
const el = await elasticChart.getCanvas();
// click on specific coordinates
await browser
.getActions()
.move({ x: 105, y: 115, origin: el._webElement })
.click()
.perform();

await retry.try(async () => {
await testSubjects.click('applyFiltersPopoverButton');
await testSubjects.missingOrFail('applyFiltersPopoverButton');
});

const hasMachineRawFilter = await filterBar.hasFilter('machine.os.raw', 'win 7');
expect(hasMachineRawFilter).to.be(true);
});
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
{ "path": "../src/plugins/ui_actions/tsconfig.json" },
{ "path": "../src/plugins/url_forwarding/tsconfig.json" },
{ "path": "../src/plugins/usage_collection/tsconfig.json" },
{ "path": "../src/plugins/index_pattern_management/tsconfig.json" },
{ "path": "../src/plugins/data_view_management/tsconfig.json" },
{ "path": "../src/plugins/visualize/tsconfig.json" },
{ "path": "interactive_setup_api_integration/fixtures/test_endpoints/tsconfig.json" },
{ "path": "plugin_functional/plugins/core_app_status/tsconfig.json" },
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/apm/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
{ "path": "../../../src/plugins/data/tsconfig.json" },
{ "path": "../../../src/plugins/embeddable/tsconfig.json" },
{ "path": "../../../src/plugins/home/tsconfig.json" },
{ "path": "../../../src/plugins/index_pattern_management/tsconfig.json" },
{ "path": "../../../src/plugins/inspector/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_utils/tsconfig.json" },
Expand Down
Loading

0 comments on commit ebbaa96

Please sign in to comment.