-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[lens] Fix usage of expressions plugin #45544
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
Merged
wylieconlon
merged 5 commits into
elastic:feature/lens
from
wylieconlon:lens/use-expressions-plugin
Sep 13, 2019
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5ce79b6
[lens] Fix usage of expressions plugin
wylieconlon b697201
Merge remote-tracking branch 'origin/feature/lens' into HEAD
wylieconlon 358f428
Use updated exports from #45538
wylieconlon 698ce7a
Fix imports and mocha tests
wylieconlon 9058a8f
Use relative instead of absolute path to fix tests
wylieconlon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,16 +5,16 @@ | |
| */ | ||
|
|
||
| import React from 'react'; | ||
| import { ExpressionRendererProps } from 'src/legacy/core_plugins/data/public'; | ||
| import { ExpressionRendererProps } from 'src/legacy/core_plugins/expressions/public'; | ||
| import { setup as dataSetup } from '../../../../../../src/legacy/core_plugins/data/public/legacy'; | ||
| import { | ||
| setup as dataSetup, | ||
| start as dataStart, | ||
| } from '../../../../../../src/legacy/core_plugins/data/public/legacy'; | ||
| ExpressionsSetup, | ||
| ExpressionsStart, | ||
| } from '../../../../../../src/legacy/core_plugins/expressions/public'; | ||
| import { DatasourcePublicAPI, FramePublicAPI, Visualization, Datasource } from '../types'; | ||
| import { EditorFrameSetupPlugins, EditorFrameStartPlugins } from './plugin'; | ||
|
|
||
| type DataSetup = typeof dataSetup; | ||
| type DataStart = typeof dataStart; | ||
|
|
||
| export function createMockVisualization(): jest.Mocked<Visualization> { | ||
| return { | ||
|
|
@@ -85,11 +85,15 @@ export function createMockFramePublicAPI(): FrameMock { | |
| type Omit<T, K> = Pick<T, Exclude<keyof T, K>>; | ||
|
|
||
| export type MockedSetupDependencies = Omit<EditorFrameSetupPlugins, 'data'> & { | ||
| data: Omit<DataSetup, 'expressions'> & { expressions: jest.Mocked<DataSetup['expressions']> }; | ||
| data: Omit<DataSetup, 'expressions'> & { | ||
| expressions: jest.Mocked<ExpressionsSetup>; | ||
| }; | ||
| }; | ||
|
|
||
| export type MockedStartDependencies = Omit<EditorFrameStartPlugins, 'data'> & { | ||
| data: Omit<DataSetup, 'expressions'> & { expressions: jest.Mocked<DataStart['expressions']> }; | ||
| data: Omit<DataSetup, 'expressions'> & { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing here - export type MockedSetupDependencies = Omit<EditorFrameStartPlugins, 'expressions'> & {
expressions: jest.Mocked<ExpressionsStart>;
}; |
||
| expressions: jest.Mocked<ExpressionsStart>; | ||
| }; | ||
| }; | ||
|
|
||
| export function createExpressionRendererMock(): jest.Mock< | ||
|
|
@@ -101,11 +105,10 @@ export function createExpressionRendererMock(): jest.Mock< | |
|
|
||
| export function createMockSetupDependencies() { | ||
| return ({ | ||
| data: { | ||
| expressions: { | ||
| registerFunction: jest.fn(), | ||
| registerRenderer: jest.fn(), | ||
| }, | ||
| data: {}, | ||
| expressions: { | ||
| registerFunction: jest.fn(), | ||
| registerRenderer: jest.fn(), | ||
| }, | ||
| chrome: { | ||
| getSavedObjectsClient: () => {}, | ||
|
|
@@ -116,13 +119,13 @@ export function createMockSetupDependencies() { | |
| export function createMockStartDependencies() { | ||
| return ({ | ||
| data: { | ||
| expressions: { | ||
| ExpressionRenderer: jest.fn(() => null), | ||
| }, | ||
| indexPatterns: { | ||
| indexPatterns: {}, | ||
| }, | ||
| }, | ||
| expressions: { | ||
| ExpressionRenderer: jest.fn(() => null), | ||
| }, | ||
| embeddables: { | ||
| registerEmbeddableFactory: jest.fn(), | ||
| }, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,8 @@ | |
|
|
||
| import { Ast } from '@kbn/interpreter/common'; | ||
| import { EuiIconType } from '@elastic/eui/src/components/icon/icon'; | ||
| import { Query, KibanaDatatable } from 'src/plugins/data/common'; | ||
| import { Query } from 'src/plugins/data/common'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason why |
||
| import { KibanaDatatable } from '../../../../../src/legacy/core_plugins/interpreter/public'; | ||
| import { DragContextState } from './drag_drop'; | ||
| import { Document } from './persistence'; | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was in place to mock the expressions part of the data plugin, but as it's a separate plugin now you should be able to do this: