Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
ff3d983
[dashboards as code] rename lens to vis and visualization to legacy_vis
nreese Mar 27, 2026
88a51f6
rename visualization constant
nreese Mar 27, 2026
b7349ee
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Mar 27, 2026
bb4ed51
clean up
nreese Mar 27, 2026
7b090c0
fix lens vis alias
nreese Mar 27, 2026
ea82679
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Mar 27, 2026
dfed879
Merge branch 'main' into rename_lens_to_vis
nreese Mar 30, 2026
f6e0f04
fix guards
nreese Mar 30, 2026
c82821c
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Mar 30, 2026
c054a30
tslint
nreese Mar 30, 2026
b408a9a
fix add new lens panel
nreese Mar 30, 2026
9eba0ec
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Mar 30, 2026
fa86bad
fix hard coded instances of lens type in dashboard and canvas
nreese Mar 30, 2026
73b7b51
Merge branch 'main' into rename_lens_to_vis
nreese Mar 31, 2026
daacb0a
move LENS_EMBEDDABLE_TYPE to lens-common package
nreese Mar 31, 2026
3e1e051
Changes from node scripts/lint.js --fix
kibanamachine Mar 31, 2026
31a1d6f
Changes from node scripts/lint_ts_projects --fix
kibanamachine Mar 31, 2026
5664def
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Mar 31, 2026
e9ce359
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Mar 31, 2026
f055edc
fix jest tests
nreese Mar 31, 2026
6e5b5f1
Changes from node scripts/lint_ts_projects --fix
kibanamachine Mar 31, 2026
60dfe8f
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Mar 31, 2026
b78b0fa
merge with main
nreese Apr 2, 2026
cd03cdc
fix jest tests
nreese Apr 2, 2026
a72d729
canvas
nreese Apr 2, 2026
7e0ad35
merge with main
nreese Apr 2, 2026
632bb51
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Apr 2, 2026
d7f7423
fix jest test
nreese Apr 2, 2026
57dd548
more canvas jest test fixes
nreese Apr 2, 2026
fe2a2f8
apply patch
nreese Apr 3, 2026
e6a5d1e
Merge branch 'main' into rename_lens_to_vis
nickofthyme Apr 6, 2026
a9b716b
memoize cleaned attributes
nickofthyme Apr 6, 2026
1e5c271
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Apr 6, 2026
5b17d3c
tslint
nreese Apr 6, 2026
65d0f4b
fix related_dashboards_client tests
nreese Apr 6, 2026
74488a3
fix open ml case in lens action
nreese Apr 7, 2026
474bce9
Changes from node scripts/lint_ts_projects --fix
kibanamachine Apr 7, 2026
697ea6f
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Apr 7, 2026
b1d85ac
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Apr 7, 2026
05a25dc
fix lens test
nreese Apr 7, 2026
4014834
merge with main
nreese Apr 7, 2026
ab5c35b
fix dashboard moon.yml
nreese Apr 7, 2026
32a326e
Changes from node scripts/lint_ts_projects --fix
kibanamachine Apr 7, 2026
e0f5d13
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Apr 7, 2026
4fa85ec
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Apr 7, 2026
3dfb631
revert changes to x-pack/platform/plugins/private/discover_enhanced/k…
nreese Apr 7, 2026
36e3ff8
Merge branch 'main' into rename_lens_to_vis
nreese Apr 7, 2026
bb6e16f
build failure
nreese Apr 7, 2026
e98250a
remove import
nreese Apr 7, 2026
224077f
Merge branch 'main' into rename_lens_to_vis
nreese Apr 7, 2026
e57627c
Merge branch 'main' into rename_lens_to_vis
nreese Apr 7, 2026
5ac3c41
merge with main
nreese Apr 7, 2026
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
@@ -0,0 +1,10 @@
/*
* 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".
*/

export const LENS_EMBEDDABLE_TYPE = 'vis';
1 change: 1 addition & 0 deletions src/platform/packages/shared/kbn-lens-common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,4 @@ export {
export { DRAG_DROP_EXTRA_TARGETS_WIDTH, DRAG_DROP_EXTRA_TARGETS_PADDING } from './editor/constants';
export { LENS_DATASOURCE_ID } from './embeddable/types';
export type { LensDatasourceId } from './embeddable/types';
export { LENS_EMBEDDABLE_TYPE } from './embeddable/constants';
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
export const VISUALIZE_APP_NAME = 'visualize';
export const SAVED_OBJECTS_LIMIT_SETTING = 'savedObjects:listingLimit';
export const SAVED_OBJECTS_PER_PAGE_SETTING = 'savedObjects:perPage';
export const VISUALIZE_EMBEDDABLE_TYPE = 'visualization';
export const VISUALIZE_EMBEDDABLE_TYPE = 'legacy_vis';
export const VISUALIZE_SAVED_OBJECT_TYPE = 'visualization';

export const STATE_STORAGE_KEY = '_a';
Expand Down
1 change: 1 addition & 0 deletions src/platform/plugins/shared/dashboard/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ dependsOn:
- '@kbn/core-http-common'
- '@kbn/core-http-server-mocks'
- '@kbn/core-http-browser'
- '@kbn/lens-common'
tags:
- plugin
- prod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
} from '@kbn/lens-embeddable-utils/config_builder';
import type { LensEmbeddableInput } from '@kbn/lens-plugin/public';
import { useEffect } from 'react';
import { LENS_EMBEDDABLE_TYPE } from '@kbn/lens-common';
import type { DashboardApi } from '../../dashboard_api/types';
import { dataService, observabilityAssistantService } from '../../services/kibana_services';

Expand Down Expand Up @@ -357,7 +358,7 @@ export function useObservabilityAIAssistantContext({

return dashboardApi
.addNewPanel({
panelType: 'lens',
panelType: LENS_EMBEDDABLE_TYPE,
serializedState: {
embeddableInput,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { withSuspense } from '@kbn/shared-ux-utility';
import type { LensSerializedState } from '@kbn/lens-plugin/public';
import { getLensAttributesFromSuggestion } from '@kbn/visualization-utils';
import { AbortReason } from '@kbn/kibana-utils-plugin/common';
import { LENS_EMBEDDABLE_TYPE } from '@kbn/lens-common';
import {
coreServices,
dataService,
Expand Down Expand Up @@ -103,7 +104,7 @@ export const DashboardAppNoDataPage = ({
.navigateToWithEmbeddablePackages<LensSerializedState>('dashboards', {
state: [
{
type: 'lens',
type: LENS_EMBEDDABLE_TYPE,
serializedState: {
attributes: getLensAttributesFromSuggestion({
filters: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import { v4 as uuidv4 } from 'uuid';

import type { SavedObjectReference } from '@kbn/core/server';
import { LENS_EMBEDDABLE_TYPE } from '@kbn/lens-common';
import { isDashboardSection, prefixReferencesFromPanel } from '../../../../common';
import type {
DashboardSavedObjectAttributes,
Expand Down Expand Up @@ -84,7 +85,9 @@ function transformPanelIn(
// Temporary escape hatch for lens as code
// TODO remove when lens as code transforms are ready for production
const transformType =
panel.type === 'lens' && isDashboardAppRequest ? 'lens-dashboard-app' : panel.type;
panel.type === LENS_EMBEDDABLE_TYPE && isDashboardAppRequest
? 'lens-dashboard-app'
: panel.type;
const transforms = embeddableService?.getTransforms(transformType);

// Dashboard application routes do not validate panel.config at route level
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import type { SavedObjectReference } from '@kbn/core/server';
import { transformTimeRangeOut, transformTitlesOut } from '@kbn/presentation-publishing';
import { flow } from 'lodash';
import { LENS_EMBEDDABLE_TYPE } from '@kbn/lens-common';
import type { SavedDashboardPanel, SavedDashboardSection } from '../../../dashboard_saved_object';
import type { DashboardState, DashboardPanel, DashboardSection } from '../../types';
import { embeddableService } from '../../../kibana_services';
Expand Down Expand Up @@ -101,7 +102,8 @@ function transformPanel(

// Temporary escape hatch for lens as code
// TODO remove when lens as code transforms are ready for production
const transformType = type === 'lens' && isDashboardAppRequest ? 'lens-dashboard-app' : type;
const transformType =
type === LENS_EMBEDDABLE_TYPE && isDashboardAppRequest ? 'lens-dashboard-app' : type;
const transforms = embeddableService?.getTransforms(transformType);

const transformedPanelConfig =
Expand Down
1 change: 1 addition & 0 deletions src/platform/plugins/shared/dashboard/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
"@kbn/core-http-common",
"@kbn/core-http-server-mocks",
"@kbn/core-http-browser",
"@kbn/lens-common"
],
"exclude": ["target/**/*"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
*/

export function transformType(type: string) {
if (type === 'lens') {
return 'vis';
}

if (type === 'visualization') {
return 'legacy_vis';
}

if (type === 'DASHBOARD_MARKDOWN') {
return 'markdown';
}
Expand Down
1 change: 1 addition & 0 deletions src/platform/plugins/shared/unified_doc_viewer/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dependsOn:
- '@kbn/deeplinks-analytics'
- '@kbn/lens-embeddable-utils'
- '@kbn/restorable-state'
- '@kbn/lens-common'
tags:
- plugin
- prod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type { LensAttributes } from '@kbn/lens-embeddable-utils/config_builder';
import { EuiCallOut, EuiLoadingChart, EuiFlexGroup, EuiFlexItem, useEuiTheme } from '@elastic/eui';
import { EmbeddableRenderer } from '@kbn/embeddable-plugin/public';
import { fieldConstants } from '@kbn/discover-utils';
import { LENS_EMBEDDABLE_TYPE } from '@kbn/lens-common';
import { useDataSourcesContext } from '../../../../../hooks/use_data_sources';
import { getUnifiedDocViewerServices } from '../../../../../plugin';
import { ContentFrameworkChart } from '../../../../content_framework/chart';
Expand Down Expand Up @@ -196,9 +197,11 @@ export function SimilarErrorsOccurrencesChart({

return (
<div style={{ height: '120px', width: '100%' }}>
{/* TODO update the string with LENS_EMBEDDABLE_TYPE once is moved to @kbn/lens-common
https://github.com/elastic/kibana/issues/245192 */}
<EmbeddableRenderer type={'lens'} getParentApi={getParentApi} hidePanelChrome />
<EmbeddableRenderer
type={LENS_EMBEDDABLE_TYPE}
getParentApi={getParentApi}
hidePanelChrome
/>
</div>
);
}, [getParentApi, lensAttributes]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe('SimilarErrorsOccurrencesChart', () => {
expect(screen.getByTestId('lensEmbeddableSimilarErrorsChart')).toBeInTheDocument();
});

expect(screen.getByText('Lens Chart (type: lens)')).toBeInTheDocument();
expect(screen.getByText('Lens Chart (type: vis)')).toBeInTheDocument();
});

it('shows error message when build fails', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@kbn/deeplinks-analytics",
"@kbn/lens-embeddable-utils",
"@kbn/restorable-state",
"@kbn/lens-common",
],
"exclude": ["target/**/*"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ import {
apiHasVisualizeConfig,
type HasVisualizeConfig,
} from '../embeddable/interfaces/has_visualize_config';
import type { HasExpressionVariables } from '../embeddable/interfaces/has_expression_variables';
import { apiHasExpressionVariables } from '../embeddable/interfaces/has_expression_variables';
import {
getApplication,
getCapabilities,
Expand Down Expand Up @@ -65,7 +63,7 @@ const MenuItem: React.FC = () => {
type EditInLensActionApi = HasUniqueId &
HasVisualizeConfig &
CanAccessViewMode &
Partial<PublishesUnifiedSearch & HasExpressionVariables & PublishesTitle & PublishesDescription>;
Partial<PublishesUnifiedSearch & PublishesTitle & PublishesDescription>;

const compatibilityCheck = (api: EmbeddableApiContext['embeddable']): api is EditInLensActionApi =>
apiHasUniqueId(api) && apiCanAccessViewMode(api) && apiHasVisualizeConfig(api);
Expand Down Expand Up @@ -150,10 +148,7 @@ export class EditInLensAction implements Action<EmbeddableApiContext> {
}

// determine whether navigation to lens is available
if (
apiHasExpressionVariables(embeddable) &&
embeddable.getExpressionVariables()?.canNavigateToLens
) {
if (embeddable.getExpressionVariables?.()?.canNavigateToLens) {
Comment thread
nickofthyme marked this conversation as resolved.
return true;
}
return Boolean(await vis.type.navigateToLens?.(vis, this.timefilter));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
*/

export { getTransformOut } from '../../common/embeddable/transforms/get_transform_out';
export { getVisualizeEmbeddableFactory } from './visualize_embeddable';
export { visualizeEmbeddableFactory } from './visualize_embeddable';

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@
*/

import type { HasType } from '@kbn/presentation-publishing';
import { VISUALIZE_EMBEDDABLE_TYPE } from '@kbn/visualizations-common';
import type { VisParams } from '../../types';
import type Vis from '../../vis';

export type HasVisualizeConfig = HasType<'visualization'> & {
export type HasVisualizeConfig = HasType<typeof VISUALIZE_EMBEDDABLE_TYPE> & {
getVis: () => Vis<VisParams>;
getExpressionVariables?: () => Record<string, unknown> | undefined;
};

export const apiHasVisualizeConfig = (api: unknown): api is HasVisualizeConfig => {
return Boolean(
api &&
(api as HasType)?.type === 'visualization' &&
(api as HasType)?.type === VISUALIZE_EMBEDDABLE_TYPE &&
typeof (api as HasVisualizeConfig).getVis === 'function'
);
};
Loading
Loading