Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
5fba245
[dashboards as code] drilldown schemas
nreese Jan 16, 2026
7b437b5
tslint
nreese Jan 16, 2026
55fd3b8
Merge branch 'main' into embeddable_drilldowns
elasticmachine Jan 20, 2026
e55b763
merge with main
nreese Jan 20, 2026
3b0d47e
fix merge conflicts
nreese Jan 20, 2026
8c32a56
register dashboard drilldown
nreese Jan 20, 2026
9389798
tslint
nreese Jan 20, 2026
7e2cc8e
transformDashboardDrilldown
nreese Jan 20, 2026
b119cc3
eslint
nreese Jan 20, 2026
d5870ca
convertToDrilldowns
nreese Jan 20, 2026
84a8f72
register url_drilldown
nreese Jan 21, 2026
cc6eab5
convert url drilldowns
nreese Jan 21, 2026
1121680
discover drilldown schema
nreese Jan 21, 2026
56727a3
drilldown transforms
nreese Jan 21, 2026
3df9a2a
getTransforms
nreese Jan 21, 2026
234a47f
Changes from node scripts/lint_ts_projects --fix
kibanamachine Jan 21, 2026
9231f1d
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Jan 21, 2026
8f02998
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Jan 21, 2026
eb2b6fc
tslint image embeddable
nreese Jan 21, 2026
4939a6a
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Jan 21, 2026
8a9aab6
update drilldown transforms to return all state
nreese Jan 22, 2026
70388c4
Merge branch 'main' into embeddable_drilldowns
elasticmachine Jan 22, 2026
4192464
drilldowns to enhancements
nreese Jan 22, 2026
70b7310
serializeEnhancements back into drilldowns
nreese Jan 22, 2026
c6e1ccf
clean up
nreese Jan 22, 2026
7c10b86
tslint visualizations plugin
nreese Jan 23, 2026
cb25e40
tslint lens
nreese Jan 23, 2026
5cb5cf4
merge with main
nreese Jan 23, 2026
e69a643
tslint dashboard
nreese Jan 23, 2026
df8f1b4
clean up lens
nreese Jan 23, 2026
e7eb55d
convert drilldown registry to function instead of class
nreese Jan 23, 2026
9254ee1
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Jan 23, 2026
0177441
Merge branch 'main' into embeddable_drilldowns
elasticmachine Jan 26, 2026
581bb6f
tslint
nreese Jan 26, 2026
65bbd35
clean up
nreese Jan 26, 2026
0b5ddfe
tranforms registry
nreese Jan 26, 2026
52f376f
better abstraction
nreese Jan 26, 2026
a7faafc
spelling
nreese Jan 26, 2026
61c2ebd
make config fields required
nreese Jan 26, 2026
af6dfa2
async_module
nreese Jan 26, 2026
5b5a2b1
Merge branch 'main' into embeddable_drilldowns
elasticmachine Jan 27, 2026
a7fe15c
flatten schema
nreese Jan 27, 2026
bb5b7cd
fix unsaved changes
nreese Jan 27, 2026
bd9582c
merge with main
nreese Jan 28, 2026
c394e6e
add type to drilldown schema
nreese Jan 28, 2026
937bc1a
merge with main
nreese Jan 28, 2026
00410cf
transforms cleanuo round 1
nreese Jan 28, 2026
021bed7
tslint discover plugin
nreese Jan 28, 2026
e6c7709
tslint getTransforms round 2
nreese Jan 28, 2026
faa2ee2
maps tslint
nreese Jan 28, 2026
7f1f288
slo plugin
nreese Jan 28, 2026
4fd050f
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Jan 28, 2026
1cc4e79
Merge remote-tracking branch 'upstream/main' into embeddable_drilldowns
nreese Jan 28, 2026
dae668c
temp fix for image-common problem
nreese Jan 28, 2026
864d0ac
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Jan 28, 2026
ab47bee
fix broken main
nreese Jan 28, 2026
afbbb38
Changes from node scripts/lint_ts_projects --fix
kibanamachine Jan 28, 2026
4b47710
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Jan 28, 2026
c4ec6cc
clean up
nreese Jan 29, 2026
6924a64
Changes from node scripts/lint_ts_projects --fix
kibanamachine Jan 29, 2026
14f588d
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Jan 29, 2026
1d6bc14
fix reset
nreese Jan 29, 2026
47fd02a
clean up
nreese Jan 29, 2026
504574b
add comma
nreese Jan 29, 2026
90d9437
change include order
nreese Jan 29, 2026
8da8774
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Jan 29, 2026
379e3c9
add tests for getSchemas
nreese Jan 29, 2026
31cde42
update limits
nreese Jan 29, 2026
bf468c6
revert adding common to dashboard public dirs
nreese Jan 29, 2026
0cddc29
update embeddableEnhanced limits
nreese Jan 29, 2026
4d7f846
fix jest tests
nreese Jan 29, 2026
de5c615
fix discover scout test
nreese Jan 29, 2026
babdd89
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Jan 29, 2026
a1c58b6
fix lens test
nreese Jan 30, 2026
96088db
Merge branch 'main' into embeddable_drilldowns
elasticmachine Jan 30, 2026
fa55dd9
remove reference injection in transformPanelsOut
nreese Jan 30, 2026
459843b
tslint
nreese Jan 30, 2026
e12c72a
update jest expects
nreese Jan 30, 2026
aea3e61
Merge branch 'main' into embeddable_drilldowns
elasticmachine Feb 2, 2026
8e9ff35
merge with main
nreese Feb 3, 2026
8862ac0
remove enhancements from image schema
nreese Feb 3, 2026
3bf0105
typo
nreese Feb 3, 2026
ba4f13c
typo
nreese Feb 3, 2026
f9644e1
convert triggers from array to just string
nreese Feb 3, 2026
e5b0fac
make transformIn generic
nreese Feb 3, 2026
e228db3
add maxSize for number of drilldowns
nreese Feb 3, 2026
0a7cf50
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Feb 3, 2026
6eac902
import ROW_CLICK_TRIGGER from @kbn/ui-actions-browser
nreese Feb 3, 2026
ab7bb02
Changes from node scripts/lint_ts_projects --fix
kibanamachine Feb 3, 2026
00cb665
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Feb 3, 2026
54ed201
fix jest tests
nreese Feb 3, 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
4 changes: 3 additions & 1 deletion examples/embeddable_examples/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export class EmbeddableExamplesPlugin implements Plugin<void, void, SetupDeps, S
},
});

embeddable.registerTransforms(BOOK_EMBEDDABLE_TYPE, bookTransforms);
embeddable.registerTransforms(BOOK_EMBEDDABLE_TYPE, {
getTransforms: () => bookTransforms,
});

return {};
}
Expand Down
8 changes: 4 additions & 4 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pageLoadAssetSize:
cps: 5918
crossClusterReplication: 12662
customIntegrations: 11715
dashboard: 19000
dashboard: 19957
dashboardEnhanced: 12159
dashboardMarkdown: 4994
data: 500179
Expand All @@ -50,9 +50,9 @@ pageLoadAssetSize:
discoverShared: 2322
elasticAssistant: 338870
elasticAssistantSharedState: 4881
embeddable: 18432
embeddable: 17521
embeddableAlertsTable: 6524
embeddableEnhanced: 7912
embeddableEnhanced: 4488
enterpriseSearch: 40244
entityStore: 1755
esql: 18224
Expand Down Expand Up @@ -83,7 +83,7 @@ pageLoadAssetSize:
graph: 9924
grokdebugger: 5484
home: 13560
imageEmbeddable: 6000
imageEmbeddable: 6727
indexLifecycleManagement: 29818
indexManagement: 35522
inference: 10368
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@

export const IMAGE_EMBEDDABLE_TYPE = 'image';
export const ADD_IMAGE_EMBEDDABLE_ACTION_ID = 'create_image_embeddable';
export const IMAGE_CLICK_TRIGGER = 'IMAGE_CLICK_TRIGGER';
export const IMAGE_EMBEDDABLE_SUPPORTED_TRIGGERS = [IMAGE_CLICK_TRIGGER];
10 changes: 10 additions & 0 deletions src/platform/plugins/private/image_embeddable/common/index.ts
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 { IMAGE_CLICK_TRIGGER, IMAGE_EMBEDDABLE_SUPPORTED_TRIGGERS } from './constants';
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,22 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import type { Reference } from '@kbn/content-management-utils';
import type {
TransformEnhancementsIn,
TransformEnhancementsOut,
} from '@kbn/embeddable-plugin/common';
import type { DrilldownTransforms } from '@kbn/embeddable-plugin/common';
import { transformTitlesOut } from '@kbn/presentation-publishing';
import { flow } from 'lodash';
import type { ImageEmbeddableState } from '../server';

export function getTransforms(
transformEnhancementsIn: TransformEnhancementsIn,
transformEnhancementsOut: TransformEnhancementsOut
) {
export function getTransforms(drilldownTransforms: DrilldownTransforms) {
return {
transformIn: (state: ImageEmbeddableState) => {
const enhancementResult = state.enhancements
? transformEnhancementsIn(state.enhancements)
: { state: undefined, references: [] };

return {
state: {
...state,
...(enhancementResult.state ? { enhancements: enhancementResult.state } : {}),
},
references: enhancementResult.references,
};
return drilldownTransforms.transformIn(state);
},
transformOut: (storedState: ImageEmbeddableState, references?: Reference[]) => {
const state = transformTitlesOut(storedState);
const enhancementsState = state.enhancements
? transformEnhancementsOut(state.enhancements, references ?? [])
: undefined;

return {
...state,
...(enhancementsState ? { enhancements: enhancementsState } : {}),
};
const transformsFlow = flow(
transformTitlesOut<ImageEmbeddableState>,
(state: ImageEmbeddableState) => drilldownTransforms.transformOut(state, references)
);
return transformsFlow(storedState);
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"screenshotMode",
"embeddableEnhanced"
],
"requiredBundles": []
"requiredBundles": [],
"extraPublicDirs": ["common"]
}
}
2 changes: 1 addition & 1 deletion src/platform/plugins/private/image_embeddable/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ tags:
- jest-unit-tests
fileGroups:
src:
- public/**/*
- common/**/*
- public/**/*
- server/**/*
- '!target/**/*'
tasks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

import { i18n } from '@kbn/i18n';
import type { Trigger } from '@kbn/ui-actions-plugin/public';

export const IMAGE_CLICK_TRIGGER = 'IMAGE_CLICK_TRIGGER';
import { IMAGE_CLICK_TRIGGER } from '../../common';

export const imageClickTrigger: Trigger = {
id: IMAGE_CLICK_TRIGGER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export * from './image_click_trigger';
export { imageClickTrigger } from './image_click_trigger';
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ import { openLazyFlyout } from '@kbn/presentation-util';
import { initializeTitleManager, titleComparators } from '@kbn/presentation-publishing';

import type { ImageEmbeddableState } from '../../server';
import { IMAGE_CLICK_TRIGGER } from '../actions';
import { ImageEmbeddable as ImageEmbeddableComponent } from '../components/image_embeddable';
import type { FileImageMetadata } from '../imports';
import { coreServices, filesService } from '../services/kibana_services';
import { IMAGE_EMBEDDABLE_TYPE } from '../../common/constants';
import { IMAGE_EMBEDDABLE_SUPPORTED_TRIGGERS, IMAGE_EMBEDDABLE_TYPE } from '../../common/constants';
import type { ImageConfig, ImageEmbeddableApi } from '../types';

export const getImageEmbeddableFactory = ({
Expand All @@ -35,7 +34,7 @@ export const getImageEmbeddableFactory = ({
buildEmbeddable: async ({ initialState, finalizeApi, uuid, parentApi }) => {
const titleManager = initializeTitleManager(initialState);

const dynamicActionsManager = embeddableEnhanced?.initializeEmbeddableDynamicActions(
const dynamicActionsManager = await embeddableEnhanced?.initializeEmbeddableDynamicActions(
uuid,
() => titleManager.api.title$.getValue(),
initialState
Expand Down Expand Up @@ -66,7 +65,7 @@ export const getImageEmbeddableFactory = ({
),
getComparators: () => {
return {
...(dynamicActionsManager?.comparators ?? { enhancements: 'skip' }),
...(dynamicActionsManager?.comparators ?? { enhancements: 'skip', drilldowns: 'skip' }),
Comment thread
nreese marked this conversation as resolved.
...titleComparators,
imageConfig: 'deepEquality',
};
Expand All @@ -83,7 +82,7 @@ export const getImageEmbeddableFactory = ({
...(dynamicActionsManager?.api ?? {}),
...unsavedChangesApi,
dataLoading$,
supportedTriggers: () => [IMAGE_CLICK_TRIGGER],
supportedTriggers: () => IMAGE_EMBEDDABLE_SUPPORTED_TRIGGERS,

onEdit: async () => {
openLazyFlyout({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { ImageEmbeddablePlugin } from './plugin';

export { IMAGE_CLICK_TRIGGER } from './actions';
export { IMAGE_CLICK_TRIGGER } from '../common';

export function plugin() {
return new ImageEmbeddablePlugin();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ import type { SetupDeps, StartDeps } from './types';
export class ImageEmbeddablePlugin implements Plugin<void, void, SetupDeps, StartDeps> {
setup(core: CoreSetup<StartDeps>, plugins: SetupDeps) {
plugins.embeddable.registerTransforms(IMAGE_EMBEDDABLE_TYPE, {
...getTransforms(
plugins.embeddable.transformEnhancementsIn,
plugins.embeddable.transformEnhancementsOut
),
getTransforms,
// TODO register schema when its ready to be public
});
}
Expand Down
34 changes: 19 additions & 15 deletions src/platform/plugins/private/image_embeddable/server/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

import type { TypeOf } from '@kbn/config-schema';
import { schema } from '@kbn/config-schema';
import type { GetDrilldownsSchemaFnType } from '@kbn/embeddable-plugin/server';
import { serializedTitlesSchema } from '@kbn/presentation-publishing-schemas';
import { IMAGE_EMBEDDABLE_SUPPORTED_TRIGGERS } from '../common';

const imageFileSrcSchema = schema.object({
type: schema.literal('file'),
Expand Down Expand Up @@ -55,23 +57,25 @@ const imageConfigSchema = schema.object({
backgroundColor: schema.maybe(schema.string()),
});

export const imageEmbeddableSchema = schema.allOf(
[
schema.object({
imageConfig: imageConfigSchema,
enhancements: schema.maybe(schema.any()),
}),
serializedTitlesSchema,
],
{
meta: {
description: 'Image embeddable schema',
},
}
);
export function getImageEmbeddableSchema(getDrilldownsSchemas: GetDrilldownsSchemaFnType) {
return schema.allOf(
[
getDrilldownsSchemas(IMAGE_EMBEDDABLE_SUPPORTED_TRIGGERS),
schema.object({
imageConfig: imageConfigSchema,
}),
serializedTitlesSchema,
],
{
meta: {
description: 'Image embeddable schema',
},
}
);
}

// TODO - snake_caseify all of these schemas

export type ImageConfig = TypeOf<typeof imageConfigSchema>;
export type ImageConfigState = TypeOf<typeof imageConfigSchema>;
export type ImageEmbeddableState = TypeOf<typeof imageEmbeddableSchema>;
export type ImageEmbeddableState = TypeOf<ReturnType<typeof getImageEmbeddableSchema>>;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"outDir": "target/types"
},
"include": ["public/**/*", "common/**/*", "server/**/*"],
"include": ["common/**/*", "public/**/*", "server/**/*"],
"kbn_references": [
"@kbn/core",
"@kbn/embeddable-plugin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function getOptions(type: LinkType, options: LinkOptions) {
'boolean' && {
use_time_range: (dashboardOptions as { useCurrentDateRange?: boolean }).useCurrentDateRange,
}),
};
} as DashboardLink['options'];
}

const urlOptions = options as Required<ExternalLink>['options'];
Expand Down
2 changes: 1 addition & 1 deletion src/platform/plugins/private/links/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class LinksServerPlugin implements Plugin<object, object> {
core.savedObjects.registerType<LinksState>(linksSavedObjectType);

plugins.embeddable.registerTransforms(LINKS_EMBEDDABLE_TYPE, {
...transforms,
getTransforms: () => transforms,
// TODO register schema when its ready to be public
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ export const registerDataControlTransforms = (
legacyRefNames: string[]
) => {
embeddable.registerTransforms(type, {
transformIn: (state) => extractReferences(state, refName),
transformOut: (state, panelReferences, containerReferences, id) =>
injectReferences(id, state, legacyRefNames, panelReferences, containerReferences),
getTransforms: () => ({
transformIn: (state) => extractReferences(state, refName),
transformOut: (state, panelReferences, containerReferences, id) =>
injectReferences(id, state, legacyRefNames, panelReferences, containerReferences),
}),
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ export const DEFAULT_DASHBOARD_NAVIGATION_OPTIONS = {
use_time_range: true,
use_filters: true,
};

// Do not change constant value - part of dashboard REST API
export const DASHBOARD_DRILLDOWN_TYPE = 'dashboard_drilldown';
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 @@ -113,6 +113,7 @@ dependsOn:
- '@kbn/core-chrome-app-menu-components'
- '@kbn/core-chrome-app-menu'
- '@kbn/test-jest-helpers'
- '@kbn/image-embeddable-plugin'
tags:
- plugin
- prod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export const panelGridSchema = schema.object({
export function getPanelSchema() {
return schema.object({
config: schema.oneOf([
...((embeddableService ? embeddableService.getEmbeddableSchemas() : []) as [ObjectType<{}>]),
...((embeddableService ? embeddableService.getAllEmbeddableSchemas() : []) as [
Comment thread
nreese marked this conversation as resolved.
ObjectType<{}>
]),
schema.object(
{},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ describe('stripUnmappedKeys', () => {
it('should not drop mapped panel types', () => {
mockGetTransforms.mockImplementation(() => {
return {
getSchema: () =>
schema.object({
foo: schema.string(),
}),
schema: schema.object({
foo: schema.string(),
}),
};
});
const dashboardState = {
Expand Down Expand Up @@ -110,7 +109,7 @@ describe('stripUnmappedKeys', () => {
it('should drop unmapped panel types when throwOnUnmappedPanel throws', () => {
mockGetTransforms.mockImplementation(() => {
return {
getSchema: () => schema.any(),
schema: schema.any(),
throwOnUnmappedPanel: () => {
throw new Error('Unmapped panel type');
},
Expand Down Expand Up @@ -150,10 +149,9 @@ describe('stripUnmappedKeys', () => {
it('should drop panel enhancements', () => {
mockGetTransforms.mockImplementation(() => {
return {
getSchema: () =>
schema.object({
foo: schema.string(),
}),
schema: schema.object({
foo: schema.string(),
}),
};
});
const dashboardState = {
Expand Down Expand Up @@ -274,10 +272,9 @@ describe('throwOnUnmappedKeys', () => {
it('should not throw when there are no unmapped keys', () => {
mockGetTransforms.mockImplementation(() => {
return {
getSchema: () =>
schema.object({
foo: schema.string(),
}),
schema: schema.object({
foo: schema.string(),
}),
};
});
const dashboardState = {
Expand Down Expand Up @@ -324,7 +321,7 @@ describe('throwOnUnmappedKeys', () => {
it('should throw when dashboard contains a panel with enhancements', () => {
mockGetTransforms.mockImplementation(() => {
return {
getSchema: () => schema.object({}),
schema: schema.object({}),
};
});
const dashboardState = {
Expand Down
Loading
Loading