Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions src/platform/plugins/shared/discover/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ export const METRICS_EXPERIENCE_PRODUCT_FEATURE_ID = 'discover:metrics-experienc
* When disabled, panel state is stored and loaded as-is (pre-transform behavior).
*/
export const EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_KEY = 'discover.embeddableTransforms';

/** Default when the flag is unset (e.g. fresh install). Explicit `false` still disables. */
export const EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_DEFAULT = true;
6 changes: 5 additions & 1 deletion src/platform/plugins/shared/discover/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
export const PLUGIN_ID = 'discover';
export const APP_ICON = 'discoverApp';

export { APP_STATE_URL_KEY, EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_KEY } from './constants';
export {
APP_STATE_URL_KEY,
EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_DEFAULT,
EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_KEY,
} from './constants';
export { DISCOVER_APP_LOCATOR } from './app_locator';
export type {
DiscoverAppLocator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export function createDiscoverServicesMock(): DiscoverServices {
discoverFeatureFlags: {
getCascadeLayoutEnabled: jest.fn(() => false),
getIsEsqlDefault: jest.fn(() => false),
getEmbeddableTransformsEnabled: jest.fn(() => false),
getEmbeddableTransformsEnabled: jest.fn(() => true),
},
embeddableEditor: {
isByValueEditor: jest.fn(() => false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import type { ProfilesManager } from './context_awareness';
import type { DiscoverEBTManager } from './ebt_manager';
import {
CASCADE_LAYOUT_ENABLED_FEATURE_FLAG_KEY,
EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_DEFAULT,
EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_KEY,
IS_ESQL_DEFAULT_FEATURE_FLAG_KEY,
} from './constants';
Expand Down Expand Up @@ -212,7 +213,10 @@ export const buildServices = ({
getIsEsqlDefault: () =>
core.featureFlags.getBooleanValue(IS_ESQL_DEFAULT_FEATURE_FLAG_KEY, false),
getEmbeddableTransformsEnabled: () =>
core.featureFlags.getBooleanValue(EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_KEY, false),
core.featureFlags.getBooleanValue(
EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_KEY,
EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_DEFAULT
),
},
docLinks: core.docLinks,
embeddable: plugins.embeddable,
Expand Down
5 changes: 4 additions & 1 deletion src/platform/plugins/shared/discover/public/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export const SEARCH_SESSION_ID_QUERY_PARAM = 'searchSessionId';

export const CASCADE_LAYOUT_ENABLED_FEATURE_FLAG_KEY = 'discover.cascadeLayoutEnabled';

export { EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_KEY } from '../common';
export {
EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_DEFAULT,
EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_KEY,
} from '../common';

export { IS_ESQL_DEFAULT_FEATURE_FLAG_KEY } from '@kbn/discover-utils';
3 changes: 2 additions & 1 deletion src/platform/plugins/shared/discover/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { getUiSettings } from './ui_settings';
import type { ConfigSchema } from './config';
import { appLocatorGetLocationCommon } from '../common/app_locator_get_location';
import {
EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_DEFAULT,
EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_KEY,
METRICS_EXPERIENCE_PRODUCT_FEATURE_ID,
TRACES_PRODUCT_FEATURE_ID,
Expand All @@ -38,7 +39,7 @@ export class DiscoverServerPlugin
{
private readonly config: ConfigSchema;
private subscriptions: Subscription[] = [];
private embeddableTransformsEnabled = false;
private embeddableTransformsEnabled = EMBEDDABLE_TRANSFORMS_FEATURE_FLAG_DEFAULT;

constructor(initializerContext: PluginInitializerContext<ConfigSchema>) {
this.config = initializerContext.config.get();
Expand Down
Loading