-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Lens] Integrate Config Builder into APIs and transforms #235277
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
Merged
Changes from all commits
Commits
Show all changes
89 commits
Select commit
Hold shift + click to select a range
9b58b6f
cleanup api/cm schema and types
nickofthyme 10f2bd2
integrate config builder into lens api and clients
nickofthyme aad0fdf
add public and server lens embeddable transforms
nickofthyme a592cd6
add embeddable initial state transforms
nickofthyme 4e0efd1
dataview fix from peter
nickofthyme 8ce59be
Merge branch 'main' into lens-cb-integration
ppisljar 23c694c
Merge branch 'main' into lens-cb-integration
nickofthyme 47d1ff9
Merge remote-tracking branch 'origin/lens-cb-integration' into lens-c…
nickofthyme fbb59fc
:sparkles: Add id to the schema
dej611 1976f7b
:bug: Fix the background_chart and dataViews bugs
dej611 7260819
Merge remote-tracking branch 'origin/lens-cb-integration' into lens-c…
nickofthyme f20d469
Merge remote-tracking branch 'upstream/main' into lens-cb-integration
dej611 ffdfa44
Merge remote-tracking branch 'origin/lens-cb-integration' into lens-c…
nickofthyme 32e7600
Merge branch 'main' into lens-cb-integration
nickofthyme 372a2a4
update serialized types
nickofthyme 13cedfe
add transforms for by-value panels
nickofthyme f1db0ad
update lens embeddable to use/transform api format
nickofthyme 044e00f
feat: allow create with custom ids
nickofthyme 22a2611
fix: lens by-value panel refs
nickofthyme 01c1993
add feature flag to enable api transforms
nickofthyme c8ea840
Merge branch 'main' into lens-cb-integration
nickofthyme 2a2a9a4
fix type error with response item
nickofthyme cff2bc0
fix custom lens renderer, add parentApi types
nickofthyme 05b18e7
fix api attributes types
nickofthyme 7563388
Merge branch 'main' into lens-cb-integration
nickofthyme 2b5bab1
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine 7040354
[Lens] move references to server
nickofthyme 5e0138b
Merge branch 'main' into lens-server-refs
nickofthyme c1f0633
chore: cleanup transforms, handle dynamic actions, stub out api confi…
nickofthyme 61822ed
Merge branch 'main' into lens-server-refs
nickofthyme c91a92f
fix type errors
nickofthyme b72c7e6
Merge branch 'main' into lens-server-refs
nickofthyme 642db89
Merge branch 'main' into lens-server-refs
dej611 da71217
Merge remote-tracking branch 'upstream/main' into lens-server-refs
dej611 3f21b73
:label: first type pass
dej611 d7aa151
:label: More types fixed
dej611 c023bcc
:wrench: Flag package for treeshake
dej611 7319d75
:white_check_mark: Align test to lack of references
dej611 19a76e7
chore: remove `schema` on transform definition
nickofthyme 5c507da
chore: move `LensParentApi` types to `@kbn/lens-common`
nickofthyme 3385eb1
chore: revert code cleanup
nickofthyme de8412e
Merge branch 'main' into lens-server-refs
nickofthyme 4ad0c86
fix: lens api integration tests
nickofthyme 8b2a35e
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine b0ba832
Merge branch 'lens-server-refs' into lens-cb-integration
dej611 19b3d72
:wrench: fix more type issues
dej611 a761b70
:fire: Remvoe unused dep
dej611 b8317e0
:boom: untangle type explosion
nickofthyme 527bf9a
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine e8fc9db
fix add panel from library
nickofthyme 7e65eee
Merge branch 'main' into lens-server-refs
nickofthyme 7ee482f
Merge remote-tracking branch 'origin/lens-server-refs' into lens-serv…
nickofthyme 05215fe
fix: background session issue
nickofthyme 7b2483a
Merge branch 'main' into lens-server-refs
nickofthyme 897b867
Merge branch 'main' into lens-server-refs
nickofthyme 35c3697
Merge branch 'main' into lens-server-refs
nickofthyme b2b01af
chore: update cloud limits
nickofthyme 46b7b69
Merge remote-tracking branch 'origin/lens-server-refs' into lens-serv…
nickofthyme c364724
Merge branch 'main' into lens-server-refs
nickofthyme 7938cd0
Merge branch 'lens-server-refs' into lens-cb-integration
nickofthyme c8fb0da
fix: by-value loading
nickofthyme 5924a8e
Merge branch 'main' into lens-cb-integration
nickofthyme da92009
fix: numerous by-value issues with refs and transforms
nickofthyme 8dbf4e5
test: temporary type check fix
nickofthyme e1e6082
temporary reset limits
nickofthyme 8ebb77a
fix: ts cyclic type import.....why!!!!
nickofthyme 970c1c3
fix: mounter type errors
nickofthyme 3b7fd4d
fix: external attribute usage, add legacy state method
nickofthyme ddb3f55
fix: remaining type errors
nickofthyme 3708b49
ci: update empty error responses for bad schema union messages
nickofthyme e33c897
Merge branch 'main' into lens-cb-integration
nickofthyme 514f364
Changes from node scripts/capture_oas_snapshot --include-path /api/…
kibanamachine 72305a8
refactor: lazily import builder in `lens/public`, reset limits
nickofthyme ea2bf28
Merge branch 'main' into lens-cb-integration
nickofthyme 7af7c2e
Merge remote-tracking branch 'origin/lens-cb-integration' into lens-c…
nickofthyme 408e743
Changes from node scripts/generate codeowners
kibanamachine 7282b3c
fix: alert action tests
nickofthyme 5c0737a
Merge remote-tracking branch 'origin/lens-cb-integration' into lens-c…
nickofthyme 4a806e3
Merge branch 'main' into lens-cb-integration
nickofthyme 5847aca
Merge branch 'main' into lens-cb-integration
markov00 4a5b7e5
chore: rename embeddable transform helpers
nickofthyme 8022ab3
chore: cleanup naming
nickofthyme 933f246
chore: remove old metric schema `id`
nickofthyme 72a1d30
Merge branch 'main' into lens-cb-integration
markov00 5ca7844
chore: simplify async logic
nickofthyme 5d30702
chore: revert destructure order change
nickofthyme 5fb7a50
test: disable message check on empty response test
nickofthyme fb73cbb
Merge branch 'main' into lens-cb-integration
nickofthyme 8012738
chore: improve async logic in plugin
nickofthyme 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # @kbn/lens-common-2 | ||
markov00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Split off of `@kbn/lens-common` because of circular dependence issues importing LensApiSchemaType. | ||
|
|
||
| ```ts | ||
| import type { LensApiSchemaType } from '@kbn/lens-embeddable-utils'; | ||
| ``` | ||
109 changes: 109 additions & 0 deletions
109
src/platform/packages/shared/kbn-lens-common-2/index.ts
nickofthyme marked this conversation as resolved.
Show resolved
Hide resolved
|
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 |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the "Elastic License | ||
| * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
| * Public License v 1"; you may not use this file except in compliance with, at | ||
| * your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
| * License v3.0 only", or the "Server Side Public License, v 1". | ||
| */ | ||
|
|
||
| import type { | ||
| HasEditCapabilities, | ||
| HasLibraryTransforms, | ||
| HasSupportedTriggers, | ||
| PublishesBlockingError, | ||
| PublishesDataLoading, | ||
| PublishesDataViews, | ||
| PublishesDisabledActionIds, | ||
| PublishesRendered, | ||
| PublishesSavedObjectId, | ||
| PublishesUnifiedSearch, | ||
| PublishesViewMode, | ||
| PublishesWritableDescription, | ||
| PublishesWritableTitle, | ||
| } from '@kbn/presentation-publishing'; | ||
| import type { LensApiSchemaType } from '@kbn/lens-embeddable-utils'; | ||
| import type { Simplify } from '@kbn/chart-expressions-common'; | ||
| import type { | ||
| LensByValueBase, | ||
| LensSerializedSharedState, | ||
| LensByRefSerializedState, | ||
| LensInspectorAdapters, | ||
| LensRequestHandlersProps, | ||
| LensApiCallbacks, | ||
| LensHasEditPanel, | ||
| LensSerializedState, | ||
| } from '@kbn/lens-common'; | ||
| import type { PublishesSearchSession } from '@kbn/presentation-publishing/interfaces/fetch/publishes_search_session'; | ||
| import type { DefaultEmbeddableApi } from '@kbn/embeddable-plugin/public'; | ||
|
|
||
| type LensByValueAPIConfigBase = Omit<LensByValueBase, 'attributes'> & { | ||
| // Temporarily allow both old and new attributes until all are new types are supported and feature flag removed | ||
| attributes: LensApiSchemaType | LensByValueBase['attributes']; | ||
| }; | ||
|
|
||
| export type LensByValueSerializedAPIConfig = Simplify< | ||
| LensSerializedSharedState & LensByValueAPIConfigBase | ||
| >; | ||
| export type LensByRefSerializedAPIConfig = LensByRefSerializedState; | ||
|
|
||
| /** | ||
| * Combined properties of API config used in dashboard API for lens panels | ||
| * | ||
| * Includes: | ||
| * - Lens document state (for by-value) | ||
| * - Panel settings | ||
| * - other props from the embeddable | ||
| */ | ||
| export type LensSerializedAPIConfig = LensByRefSerializedAPIConfig | LensByValueSerializedAPIConfig; | ||
|
|
||
| export interface LegacyLensStateApi { | ||
| /** | ||
| * Returns legacy serialized state to avoid duplicate transformations | ||
| * | ||
| * @deprecated use `serializeState` instead | ||
| */ | ||
| getLegacySerializedState: () => LensSerializedState; | ||
| } | ||
|
|
||
| export type LensApi = Simplify< | ||
| DefaultEmbeddableApi<LensSerializedAPIConfig> & | ||
| // This is used by actions to operate the edit action | ||
| HasEditCapabilities & | ||
| // for blocking errors leverage the embeddable panel UI | ||
| PublishesBlockingError & | ||
| // This is used by dashboard/container to show filters/queries on the panel | ||
| PublishesUnifiedSearch & | ||
| // Forward the search session id | ||
| PublishesSearchSession & | ||
| // Let the container know the loading state | ||
| PublishesDataLoading & | ||
| // Let the container know when the rendering has completed rendering | ||
| PublishesRendered & | ||
| // Let the container know the used data views | ||
| PublishesDataViews & | ||
| // Let the container operate on panel title/description | ||
| PublishesWritableTitle & | ||
| PublishesWritableDescription & | ||
| // This embeddable can narrow down specific triggers usage | ||
| HasSupportedTriggers & | ||
| PublishesDisabledActionIds & | ||
| // Offers methods to operate from/on the linked saved object | ||
| HasLibraryTransforms<LensSerializedAPIConfig, LensSerializedAPIConfig> & | ||
| // Let the container know the view mode | ||
| PublishesViewMode & | ||
| // Let the container know the saved object id | ||
| PublishesSavedObjectId & | ||
| // Lens specific API methods: | ||
| // Let the container know when the data has been loaded/updated | ||
| LensInspectorAdapters & | ||
| LensRequestHandlersProps & | ||
| LensApiCallbacks & | ||
| LensHasEditPanel & | ||
| LegacyLensStateApi | ||
| >; | ||
|
|
||
| /** | ||
| * Backward compatibility types | ||
| */ | ||
| export type LensEmbeddableOutput = LensApi; |
14 changes: 14 additions & 0 deletions
14
src/platform/packages/shared/kbn-lens-common-2/jest.config.js
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 |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the "Elastic License | ||
| * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
| * Public License v 1"; you may not use this file except in compliance with, at | ||
| * your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
| * License v3.0 only", or the "Server Side Public License, v 1". | ||
| */ | ||
|
|
||
| module.exports = { | ||
| preset: '@kbn/test/jest_node', | ||
| rootDir: '../../../../..', | ||
| roots: ['<rootDir>/src/platform/packages/shared/kbn-lens-common-2'], | ||
| }; |
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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "shared-common", | ||
| "id": "@kbn/lens-common-2", | ||
| "owner": "@elastic/kibana-visualizations", | ||
| "group": "platform", | ||
| "visibility": "private" | ||
| } |
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 |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "name": "@kbn/lens-common-2", | ||
| "private": true, | ||
| "version": "1.0.0", | ||
| "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0" | ||
| } |
23 changes: 23 additions & 0 deletions
23
src/platform/packages/shared/kbn-lens-common-2/tsconfig.json
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 |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "extends": "../../../../../tsconfig.base.json", | ||
| "compilerOptions": { | ||
| "outDir": "target/types", | ||
| "types": [ | ||
| "jest", | ||
| "node" | ||
| ] | ||
| }, | ||
| "include": [ | ||
| "**/*.ts", | ||
| ], | ||
| "exclude": [ | ||
| "target/**/*" | ||
| ], | ||
| "kbn_references": [ | ||
| "@kbn/lens-common", | ||
| "@kbn/presentation-publishing", | ||
| "@kbn/lens-embeddable-utils", | ||
| "@kbn/chart-expressions-common", | ||
| "@kbn/embeddable-plugin" | ||
| ] | ||
| } |
nickofthyme marked this conversation as resolved.
Show resolved
Hide resolved
|
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
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.
Would it be best to include here all the Lens
Embeddabletypes at this point?I mean, generic Lens types at this point in
@kbn/lens-commonand embeddable types in@kbn/lens-embeddable-common. wdyt?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.
I don't know, whatever makes it easier. I don't love these types being on their own when they should be in Lens.
Especially when the only limitation is the type checking, then re-exporting many of these types from Lens.