Skip to content
Merged
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
8 changes: 1 addition & 7 deletions config/serverless.chat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ xpack.serverless.chat.enabled: true
## Cloud settings
xpack.cloud.serverless.project_type: search

## Fine-tune the search solution feature privileges. Also, refer to `serverless.yml` for the project-agnostic overrides.
xpack.features.overrides:
### Not sure if CHAT solution uses dashboard or maps
### Maps feature is hidden in Role management since it's automatically granted by Dashboard feature.
maps_v2.hidden: true

## Set the home route
uiSettings.overrides.defaultRoute: /app/workchat

Expand All @@ -29,4 +23,4 @@ xpack.wciExternalServer.enabled: true
xpack.spaces.maxSpaces: 1

## Content Connectors in stack management
xpack.contentConnectors.enabled: false
xpack.contentConnectors.enabled: false
2 changes: 0 additions & 2 deletions config/serverless.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ xpack.features.overrides:
dev_tools.category: "enterpriseSearch"
### Discover feature is moved from Analytics category to the Search one.
discover_v2.category: "enterpriseSearch"
### Maps feature is hidden in Role management since it's automatically granted by Dashboard feature.
maps_v2.hidden: true
### Machine Learning feature is moved from Analytics category to the Management one.
ml.category: "management"
### Stack Alerts feature is moved from Analytics category to the Search one renamed to simply `Alerts`.
Expand Down
2 changes: 0 additions & 2 deletions config/serverless.oblt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ xpack.features.overrides:
privileges: [ "read" ]
### Logs feature is hidden in Role management since it's automatically granted by either Infrastructure, or Applications features.
logs.hidden: true
### Maps feature is hidden in Role management since it's automatically granted by Dashboard feature.
maps_v2.hidden: true
### Machine Learning feature should be moved from Analytics category to the Observability one and renamed to `AI Ops`.
ml:
category: "observability"
Expand Down
3 changes: 0 additions & 3 deletions config/serverless.security.complete.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Security Complete tier config
xpack.features.overrides:
### The following features are hidden in Role management since they're automatically granted by SIEM feature.
maps_v2.hidden: true
4 changes: 1 addition & 3 deletions config/serverless.security.essentials.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# Security Essentials tier config
xpack.features.overrides:
### The following features are hidden in Role management since they're automatically granted by SIEM feature.
maps_v2.hidden: true

52 changes: 1 addition & 51 deletions config/serverless.security.search_ai_lake.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
# Security Search AI Lake tier config

## Disable xpack plugins
## Disable plugins
xpack.osquery.enabled: false
xpack.maps.enabled: false
xpack.ml.ad.enabled: false
xpack.ml.dfa.enabled: false
xpack.lens.enabled: false

### Disable shared plugins
visualizations.enabled: false

## Disable plugin features
xpack.alerting.maintenanceWindow.enabled: false
Expand All @@ -23,51 +18,6 @@ xpack.features.overrides:
siemV2.description: null
securitySolutionSiemMigrations.hidden: true

## Fine-tune the security solution essentials feature privileges. These feature privilege overrides are set individually for each project type. Also, refer to `serverless.yml` for the project-agnostic overrides.
dashboard:
privileges:
## We do not need to compose dashboard from maps and visualizations because these functionalities are disabled in this tier
## Setting to empty array so the values from serverless.yml or serverless.security.yml are overwritten
all.composedOf: []
read.composedOf: []
dashboard_v2:
privileges:
## Setting to empty array so the values from serverless.yml or serverless.security.yml are overwritten
## We do not need to compose dashboard from maps and visualizations because these functionalities are disabled in this tier
all.composedOf: []
read.composedOf: []
siemV2:
privileges:
all.composedOf:
## Limited values so the fields from serverless.yml or serverless.security.yml are overwritten
## We do not need to compose siemV2 from maps and visualizations because these functionalities are disabled in this tier
- feature: "discover_v2"
privileges: [ "all" ]
- feature: "dashboard_v2"
privileges: [ "all" ]
read.composedOf:
- feature: "discover_v2"
privileges: [ "read" ]
- feature: "dashboard_v2"
privileges: [ "read" ]
siem:
privileges:
all.composedOf:
## Limited values so the fields from serverless.yml or serverless.security.yml are overwritten
## We do not need to compose siemV2 from maps and visualizations because these functionalities are disabled in this tier
- feature: "discover_v2"
privileges: [ "all" ]
- feature: "dashboard_v2"
privileges: [ "all" ]
- feature: "savedQueryManagement"
privileges: [ "all" ]
read.composedOf:
- feature: "discover_v2"
privileges: [ "read" ]
- feature: "dashboard_v2"
privileges: [ "read" ]
- feature: "savedQueryManagement"
privileges: [ "read" ]
# Custom integrations/fleet settings
xpack.fleet.agentless.isDefault: true
xpack.fleet.integrationsHomeOverride: '/app/security/configurations/integrations'
Expand Down
2 changes: 2 additions & 0 deletions config/serverless.security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ xpack.features.overrides:
dashboard_v2.hidden: true
visualize.hidden: true
visualize_v2.hidden: true
maps.hidden: true
maps_v2.hidden: true
### Machine Learning feature is moved from Analytics category to the Security one as the last item.
ml:
category: "security"
Expand Down
4 changes: 3 additions & 1 deletion config/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ xpack.features.overrides:
includeIn: "read"
### Shared images feature is hidden in Role management since it's not needed.
filesSharedImage.hidden: true
### Maps feature is hidden in Role management since it's automatically granted by Dashboard feature.
maps_v2.hidden: true
### Reporting feature is supposed to give access to reporting capabilities across different features.
reporting:
privileges:
Expand Down Expand Up @@ -265,4 +267,4 @@ xpack.dataUsage.enabled: true
xpack.dataUsage.enableExperimental: ['dataUsageDisabled']

## Content Connectors in stack management
xpack.contentConnectors.enabled: true
xpack.contentConnectors.enabled: true
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { offeringBasedSchema, schema, TypeOf } from '@kbn/config-schema';

export const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),

readOnly: offeringBasedSchema({
serverless: schema.boolean({ defaultValue: false }),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const createVisEmbeddableFromObject =
}

const capabilities = {
visualizeSave: Boolean(getCapabilities().visualize_v2?.save),
visualizeSave: Boolean(getCapabilities().visualize_v2.save),
dashboardSave: Boolean(getCapabilities().dashboard_v2?.showWriteControls),
visualizeOpen: Boolean(getCapabilities().visualize_v2?.show),
};
Expand Down
14 changes: 0 additions & 14 deletions src/platform/plugins/shared/visualizations/server/config.ts

This file was deleted.

10 changes: 1 addition & 9 deletions src/platform/plugins/shared/visualizations/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,11 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server';
import { configSchema } from './config';
import { PluginInitializerContext } from '@kbn/core/server';

// This exports static code and TypeScript types,
// as well as, Kibana Platform `plugin()` initializer.

export const config: PluginConfigDescriptor<any> = {
schema: configSchema,
exposeToBrowser: {
visualize_v2: { enabled: true },
},
};

export async function plugin(initializerContext: PluginInitializerContext) {
const { VisualizationsPlugin } = await import('./plugin');
return new VisualizationsPlugin(initializerContext);
Expand Down
6 changes: 3 additions & 3 deletions x-pack/platform/plugins/shared/aiops/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"requiredPlugins": [
"charts",
"data",
"lens",
"licensing",
"uiActions",
"embeddable",
Expand All @@ -26,8 +27,7 @@
"optionalPlugins": [
"cases",
"observabilityAIAssistant",
"usageCollection",
"lens"
"usageCollection"
],
"requiredBundles": [
"dataViews",
Expand All @@ -38,4 +38,4 @@
"cases"
]
}
}
}
9 changes: 4 additions & 5 deletions x-pack/platform/plugins/shared/cases/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"actions",
"data",
"embeddable",
"lens",
"licensing",
"features",
"triggersActionsUi",
Expand All @@ -38,18 +39,16 @@
"taskManager",
"usageCollection",
"spaces",
"serverless",
"lens"
"serverless"
],
"requiredBundles": [
"esUiShared",
"kibanaReact",
"kibanaUtils",
"savedObjectsFinder",
"lens"
"savedObjectsFinder"
],
"extraPublicDirs": [
"common"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ interface StartServiceArgs {
license?: ILicense | null;
}

type StartServicesWithRequiredLens = StartServices & Required<Pick<StartServices, 'lens'>>;

export const createStartServicesMock = ({
license,
}: StartServiceArgs = {}): StartServicesWithRequiredLens => {
export const createStartServicesMock = ({ license }: StartServiceArgs = {}): StartServices => {
const licensingPluginMock = licensingMock.createStart();
const triggersActionsUi = triggersActionsUiMock.createStart();

Expand All @@ -52,7 +48,7 @@ export const createStartServicesMock = ({
license != null
? { ...licensingPluginMock, license$: new BehaviorSubject(license) }
: licensingPluginMock,
} as unknown as StartServicesWithRequiredLens;
} as unknown as StartServices;

services.application.currentAppId$ = new BehaviorSubject<string>('testAppId');
services.application.applications$ = new BehaviorSubject<Map<string, PublicAppInfo>>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { CasesUiConfigType } from '../../../../common/ui/types';
import type { CasesPublicStartDependencies } from '../../../types';

type GlobalServices = Pick<CoreStart, 'application' | 'http' | 'theme' | 'userProfile'> &
Pick<CasesPublicStartDependencies, 'serverless' | 'lens'>;
Pick<CasesPublicStartDependencies, 'serverless'>;

export class KibanaServices {
private static kibanaVersion?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ export const useLensOpenVisualization = ({ comment }: { comment: string }) => {
const parsedComment = parseCommentString(comment);
const lensVisualization = getLensVisualizations(parsedComment?.children ?? []);

const { lens } = useKibana().services;
const hasLensPermissions = lens?.canUseEditor();
const {
lens: { navigateToPrefilledEditor, canUseEditor },
} = useKibana().services;

const hasLensPermissions = canUseEditor();

const handleClick = useCallback(() => {
lens?.navigateToPrefilledEditor(
navigateToPrefilledEditor(
{
id: '',
timeRange: lensVisualization[0].timeRange,
Expand All @@ -36,7 +39,7 @@ export const useLensOpenVisualization = ({ comment }: { comment: string }) => {
openInNewTab: true,
}
);
}, [lens, lensVisualization]);
}, [lensVisualization, navigateToPrefilledEditor]);

if (!lensVisualization.length || lensVisualization?.[0]?.attributes == null) {
return { canUseEditor: hasLensPermissions, actionConfig: null };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ import {
import { useMemo } from 'react';
import { useTimelineContext } from '../timeline_context/use_timeline_context';
import type { TemporaryProcessingPluginsType } from './types';
import { KibanaServices, useApplicationCapabilities, useKibana } from '../../common/lib/kibana';
import { KibanaServices, useApplicationCapabilities } from '../../common/lib/kibana';
import * as lensMarkdownPlugin from './plugins/lens';
import { ID as LensPluginId } from './plugins/lens/constants';

export const usePlugins = (disabledPlugins?: string[]) => {
const kibanaConfig = KibanaServices.getConfig();
const { services } = useKibana();
const timelinePlugins = useTimelineContext()?.editor_plugins;
const appCapabilities = useApplicationCapabilities();

Expand All @@ -39,7 +38,6 @@ export const usePlugins = (disabledPlugins?: string[]) => {
}

if (
services.lens !== undefined &&
kibanaConfig?.markdownPlugins?.lens &&
!disabledPlugins?.includes(LensPluginId) &&
appCapabilities?.visualize.crud
Expand All @@ -60,7 +58,6 @@ export const usePlugins = (disabledPlugins?: string[]) => {
appCapabilities?.visualize.crud,
disabledPlugins,
kibanaConfig?.markdownPlugins?.lens,
services.lens,
timelinePlugins,
]);
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ import type { LensProps } from './types';
const LENS_VISUALIZATION_HEIGHT = 200;

const LensRendererComponent: React.FC<LensProps> = ({ attributes, timeRange, metadata }) => {
const { lens } = useKibana().services;
const {
lens: { EmbeddableComponent },
} = useKibana().services;
const { euiTheme } = useEuiTheme();

if (!lens) {
return null;
}
const { EmbeddableComponent } = lens;

if (!attributes) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ import type { LensProps } from './types';
type Props = LensProps & { attachmentId: string };

const OpenLensButtonComponent: React.FC<Props> = ({ attachmentId, attributes, timeRange }) => {
const { lens } = useKibana().services;
const {
lens: { navigateToPrefilledEditor, canUseEditor },
} = useKibana().services;

const onClick = useCallback(() => {
lens?.navigateToPrefilledEditor(
navigateToPrefilledEditor(
{
id: attachmentId,
timeRange,
Expand All @@ -28,9 +30,9 @@ const OpenLensButtonComponent: React.FC<Props> = ({ attachmentId, attributes, ti
openInNewTab: true,
}
);
}, [attachmentId, attributes, lens, timeRange]);
}, [attachmentId, attributes, navigateToPrefilledEditor, timeRange]);

const hasLensPermissions = lens?.canUseEditor();
const hasLensPermissions = canUseEditor();
const isESQLQuery = isOfAggregateQueryType(attributes.state.query);

if (!hasLensPermissions || isESQLQuery) {
Expand Down
5 changes: 1 addition & 4 deletions x-pack/platform/plugins/shared/cases/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ export interface CasesPublicStartDependencies {
embeddable: EmbeddableStart;
features: FeaturesPluginStart;
files: FilesStart;
/**
* Lens is not supported in all serverless tiers
*/
lens?: LensPublicStart;
lens: LensPublicStart;
/**
* Cases in used by other plugins. Plugins pass the
* service to their KibanaContext. ML does not pass
Expand Down
Loading