Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens] revert Select line chart by default if the x-axis contains a timestamp #198555

Merged
merged 4 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ describe('xy_suggestions', () => {
expect((suggestions[0].state.layers[0] as XYDataLayerConfig).seriesType).toEqual('line');
});

test('suggests line if changeType is initial and date column is involved', () => {
test('suggests bar if changeType is initial and date column is involved', () => {
const currentState: XYState = {
legend: { isVisible: true, position: 'bottom' },
valueLabels: 'hide',
Expand Down Expand Up @@ -885,8 +885,8 @@ describe('xy_suggestions', () => {
expect(suggestions).toHaveLength(1);

expect(suggestions[0].hide).toEqual(false);
expect(suggestions[0].state.preferredSeriesType).toEqual('line');
expect((suggestions[0].state.layers[0] as XYDataLayerConfig).seriesType).toEqual('line');
expect(suggestions[0].state.preferredSeriesType).toEqual('bar_stacked');
expect((suggestions[0].state.layers[0] as XYDataLayerConfig).seriesType).toEqual('bar_stacked');
});

test('makes a visible seriesType suggestion for unchanged table without split', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,6 @@ function getSuggestionsForLayer({
allowMixed,
};

if (changeType === 'initial' && xValue?.operation.dataType === 'date') {
return buildSuggestion({ ...options, seriesType: 'line' });
}
// handles the simplest cases, acting as a chart switcher
if (!currentState && changeType === 'unchanged') {
// Chart switcher needs to include every chart type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await testSubjects.click('fieldToggle-DistanceKilometers');

const data = await lens.getCurrentChartDebugState('xyVisChart');
assertMatchesExpectedData(data, [expectedLogstashData, expectedFlightsData], 'lines');
assertMatchesExpectedData(data, [expectedLogstashData, expectedFlightsData]);
});

it('ignores global filters on layers using a data view without the filter field', async () => {
await filterBar.addFilter({ field: 'Carrier', operation: 'exists' });
const data = await lens.getCurrentChartDebugState('xyVisChart');
assertMatchesExpectedData(data, [expectedLogstashData, expectedFlightsData], 'lines');
assertMatchesExpectedData(data, [expectedLogstashData, expectedFlightsData]);
await lens.save(visTitle);
});

Expand All @@ -120,7 +120,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

await visualize.openSavedVisualization(visTitle);
const data = await lens.getCurrentChartDebugState('xyVisChart');
assertMatchesExpectedData(data, [expectedFlightsData], 'lines');
assertMatchesExpectedData(data, [expectedFlightsData]);
});
});
}