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] Parameter configurations and new dimension config flow #38863

Merged
merged 37 commits into from
Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f46855e
[lens] Dimension panel lets users select operations and fields indivi…
wylieconlon May 30, 2019
dcde41d
Merge remote-tracking branch 'origin/feature/lens' into lens/aggregat…
wylieconlon May 31, 2019
4a3ea3f
Merge remote-tracking branch 'origin/master' into lens/aggregations
wylieconlon Jun 3, 2019
30f69e3
Split files and add tests
wylieconlon Jun 3, 2019
82e2865
Merge remote-tracking branch 'origin/feature/lens' into lens/aggregat…
wylieconlon Jun 3, 2019
fe4238a
Fix dimension labeling and add clear button
wylieconlon Jun 4, 2019
4d09416
Support more aggregations, aggregation nesting, rollups, and clearing
wylieconlon Jun 5, 2019
6f81ded
Merge remote-tracking branch 'origin/feature/lens' into lens/aggregat…
wylieconlon Jun 5, 2019
3bf54d4
Fix esaggs expression
wylieconlon Jun 5, 2019
241187b
Merge remote-tracking branch 'origin/feature/lens' into lens/aggregat…
wylieconlon Jun 6, 2019
8c50598
Increase top-level test coverage of dimension panel
wylieconlon Jun 6, 2019
063715c
Merge branch 'feature/lens' into lens/aggregations
flash1293 Jun 7, 2019
8359b28
start work on param editors for operations
flash1293 Jun 7, 2019
6a3e6f8
add params for terms
flash1293 Jun 7, 2019
9cb80a8
remove unused variable
flash1293 Jun 7, 2019
4718369
Merge branch 'feature/lens' into lens/agg-configs
flash1293 Jun 11, 2019
5510db0
refactor operations
flash1293 Jun 11, 2019
404944f
move esaggs configurations to individual operation files
flash1293 Jun 11, 2019
8e0dc86
implement new edit flow
flash1293 Jun 12, 2019
520f0e7
split up dimension panel code
flash1293 Jun 12, 2019
7d6f3c9
Merge branch 'feature/lens' into lens/agg-configs
flash1293 Jun 12, 2019
cdcc822
fix some tests
flash1293 Jun 13, 2019
3e7c3b4
Merge branch 'feature/lens' into lens/agg-configs
flash1293 Jun 13, 2019
b72998d
moved stuff around and started cleaning up and adding tests
flash1293 Jun 13, 2019
41eb4d4
fix tests for dimension panel
flash1293 Jun 13, 2019
0674c2c
fix tests
flash1293 Jun 13, 2019
6d420e6
add tests and i18n
flash1293 Jun 13, 2019
2f54558
added a few more tests
flash1293 Jun 13, 2019
d3e356c
add test subj
flash1293 Jun 13, 2019
a1f55cf
remove unused import
flash1293 Jun 13, 2019
992da75
add missing i18ns
flash1293 Jun 14, 2019
087e43c
refactor and add some more tests
flash1293 Jun 14, 2019
b0a5ccf
review comments
flash1293 Jun 14, 2019
2fe0755
remove unused import
flash1293 Jun 14, 2019
6fe714c
Merge branch 'feature/lens' into lens/agg-configs
flash1293 Jun 17, 2019
77bb873
start adding date histogram aggregation restrictions
flash1293 Jun 17, 2019
620e637
basic support for aggregation restrictions in date_histogram
flash1293 Jun 17, 2019
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 @@ -20,9 +20,9 @@ export function FrameLayout(props: FrameLayoutProps) {
<RootDragDropProvider>
<EuiFlexGroup>
{/* TODO style this and add workspace prop and loading flags */}
<EuiFlexItem>{props.dataPanel}</EuiFlexItem>
<EuiFlexItem>{props.workspacePanel}</EuiFlexItem>
<EuiFlexItem>
<EuiFlexItem grow={null}>{props.dataPanel}</EuiFlexItem>
<EuiFlexItem grow={5}>{props.workspacePanel}</EuiFlexItem>
<EuiFlexItem grow={null}>
{props.configPanel}
{props.suggestionsPanel}
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('suggestion helpers', () => {
'vis1',
{}
);
expect(suggestions.length).toBe(1);
expect(suggestions).toHaveLength(1);
expect(suggestions[0].state).toBe(suggestedState);
});

Expand All @@ -57,7 +57,7 @@ describe('suggestion helpers', () => {
'vis1',
{}
);
expect(suggestions.length).toBe(3);
expect(suggestions).toHaveLength(3);
});

it('should rank the visualizations by score', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ describe('workspace_panel', () => {
/>
);

expect(instance.find('[data-test-subj="empty-workspace"]').length).toBe(1);
expect(instance.find(expressionRendererMock).length).toBe(0);
expect(instance.find('[data-test-subj="empty-workspace"]')).toHaveLength(1);
expect(instance.find(expressionRendererMock)).toHaveLength(0);
});

it('should render an explanatory text if the visualization does not produce an expression', () => {
Expand All @@ -76,8 +76,8 @@ describe('workspace_panel', () => {
/>
);

expect(instance.find('[data-test-subj="empty-workspace"]').length).toBe(1);
expect(instance.find(expressionRendererMock).length).toBe(0);
expect(instance.find('[data-test-subj="empty-workspace"]')).toHaveLength(1);
expect(instance.find(expressionRendererMock)).toHaveLength(0);
});

it('should render an explanatory text if the datasource does not produce an expression', () => {
Expand All @@ -96,8 +96,8 @@ describe('workspace_panel', () => {
/>
);

expect(instance.find('[data-test-subj="empty-workspace"]').length).toBe(1);
expect(instance.find(expressionRendererMock).length).toBe(0);
expect(instance.find('[data-test-subj="empty-workspace"]')).toHaveLength(1);
expect(instance.find(expressionRendererMock)).toHaveLength(0);
});

it('should render the resulting expression using the expression renderer', () => {
Expand Down Expand Up @@ -158,8 +158,8 @@ Object {
/>
);

expect(instance.find('[data-test-subj="expression-failure"]').length).toBe(1);
expect(instance.find(expressionRendererMock).length).toBe(0);
expect(instance.find('[data-test-subj="expression-failure"]')).toHaveLength(1);
expect(instance.find(expressionRendererMock)).toHaveLength(0);
});

it('should show an error message if the expression fails to render', async () => {
Expand Down Expand Up @@ -191,8 +191,8 @@ Object {

instance.update();

expect(instance.find('[data-test-subj="expression-failure"]').length).toBe(1);
expect(instance.find(expressionRendererMock).length).toBe(0);
expect(instance.find('[data-test-subj="expression-failure"]')).toHaveLength(1);
expect(instance.find(expressionRendererMock)).toHaveLength(0);
});

it('should not attempt to run the expression again if it does not change', async () => {
Expand Down Expand Up @@ -271,7 +271,7 @@ Object {

expect(expressionRendererMock).toHaveBeenCalledTimes(2);

expect(instance.find(expressionRendererMock).length).toBe(1);
expect(instance.find(expressionRendererMock)).toHaveLength(1);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
const waitForPromises = () => new Promise(resolve => setTimeout(resolve));

// mock away actual data plugin to prevent all of it being loaded
jest.mock('../../../../../src/legacy/core_plugins/data/public', () => {});
jest.mock('../../../../../src/legacy/core_plugins/data/public/setup', () => {});

describe('editor_frame plugin', () => {
let pluginInstance: EditorFramePlugin;
Expand Down
7 changes: 2 additions & 5 deletions x-pack/plugins/lens/public/editor_frame_plugin/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { I18nProvider } from '@kbn/i18n/react';
import { CoreSetup } from 'src/core/public';
import {
DataSetup,
data,
ExpressionRenderer,
} from '../../../../../src/legacy/core_plugins/data/public';
import { DataSetup, ExpressionRenderer } from '../../../../../src/legacy/core_plugins/data/public';
import { data } from '../../../../../src/legacy/core_plugins/data/public/setup';
import { Datasource, Visualization, EditorFrameSetup, EditorFrameInstance } from '../types';
import { EditorFrame } from './editor_frame';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
const actual = jest.requireActual('../operations');

jest.spyOn(actual, 'getPotentialColumns');
jest.spyOn(actual, 'getColumnOrder');
jest.spyOn(actual.operationDefinitionMap.date_histogram, 'inlineOptions');

export const {
getPotentialColumns,
Expand All @@ -16,4 +16,5 @@ export const {
getOperationDisplay,
getOperationTypesForField,
getOperationResultType,
operationDefinitionMap,
} = actual;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

const actual = jest.requireActual('../state_helpers');

jest.spyOn(actual, 'changeColumn');

export const {
getColumnOrder,
changeColumn,
deleteColumn,
updateColumnParam,
sortByField,
hasField,
} = actual;
231 changes: 0 additions & 231 deletions x-pack/plugins/lens/public/indexpattern_plugin/dimension_panel.tsx

This file was deleted.

Loading