Skip to content

Commit

Permalink
Merge branch 'main' into fix-case-flyout-z-index
Browse files Browse the repository at this point in the history
  • Loading branch information
patrykkopycinski authored May 2, 2023
2 parents 97495de + 5e1055c commit 4f289f8
Show file tree
Hide file tree
Showing 113 changed files with 2,156 additions and 1,708 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ x-pack/plugins/serverless @elastic/appex-sharedux
x-pack/plugins/serverless_observability @elastic/appex-sharedux
packages/serverless/project_switcher @elastic/appex-sharedux
x-pack/plugins/serverless_search @elastic/appex-sharedux
x-pack/plugins/serverless_security @elastic/appex-sharedux
packages/serverless/storybook/config @elastic/appex-sharedux
packages/serverless/types @elastic/appex-sharedux
test/plugin_functional/plugins/session_notifications @elastic/kibana-core
Expand Down
14 changes: 14 additions & 0 deletions config/serverless.security.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# Security Project config

## Disable plugins
enterpriseSearch.enabled: false
xpack.apm.enabled: false
xpack.observability.enabled: false
xpack.uptime.enabled: false

## Enable the Serverless Security plugin
xpack.serverless.security.enabled: true

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

## Set the dev project switcher current type
xpack.serverless.plugin.developer.projectSwitcher.currentType: 'security'
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,10 @@ Kibana.
|This plugin contains configuration and code used to create a Serverless Search project. It leverages universal configuration and other APIs in the serverless plugin to configure Kibana.
|{kib-repo}blob/{branch}/x-pack/plugins/serverless_security/README.mdx[serverlessSecurity]
|This plugin contains configuration and code used to create a Serverless Security project. It leverages universal configuration and other APIs in the serverless plugin to configure Kibana.
|{kib-repo}blob/{branch}/x-pack/plugins/session_view/README.md[sessionView]
|Session View is meant to provide a visualization into what is going on in a particular Linux environment where the agent is running. It looks likes a terminal emulator; however, it is a tool for introspecting process activity and understanding user and service behaviour in your Linux servers and infrastructure. It is a time-ordered series of process executions displayed in a tree over time.
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@
"@kbn/serverless-observability": "link:x-pack/plugins/serverless_observability",
"@kbn/serverless-project-switcher": "link:packages/serverless/project_switcher",
"@kbn/serverless-search": "link:x-pack/plugins/serverless_search",
"@kbn/serverless-security": "link:x-pack/plugins/serverless_security",
"@kbn/serverless-types": "link:packages/serverless/types",
"@kbn/session-notifications-plugin": "link:test/plugin_functional/plugins/session_notifications",
"@kbn/session-view-plugin": "link:x-pack/plugins/session_view",
Expand Down Expand Up @@ -1349,14 +1350,14 @@
"cssnano": "^5.1.12",
"cssnano-preset-default": "^5.2.12",
"csstype": "^3.0.2",
"cypress": "^12.6.0",
"cypress-axe": "^1.3.0",
"cypress": "^12.10.0",
"cypress-axe": "^1.4.0",
"cypress-file-upload": "^5.0.8",
"cypress-multi-reporters": "^1.6.2",
"cypress-multi-reporters": "^1.6.3",
"cypress-pipe": "^2.0.0",
"cypress-react-selector": "^3.0.0",
"cypress-real-events": "^1.7.6",
"cypress-recurse": "^1.27.0",
"cypress-recurse": "^1.31.2",
"date-fns": "^2.29.3",
"debug": "^2.6.9",
"delete-empty": "^2.0.0",
Expand All @@ -1370,7 +1371,7 @@
"eslint-config-prettier": "^8.5.0",
"eslint-module-utils": "^2.6.2",
"eslint-plugin-ban": "^1.5.2",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-cypress": "^2.13.2",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^24.5.0",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ pageLoadAssetSize:
serverless: 16573
serverlessObservability: 16582
serverlessSearch: 17548
serverlessSecurity: 41807
sessionView: 77750
share: 71239
snapshotRestore: 79032
Expand Down
11 changes: 1 addition & 10 deletions src/plugins/management/public/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ export const renderApp = async (
{ history, appBasePath, element, theme$ }: AppMountParameters,
dependencies: ManagementAppDependencies
) => {
ReactDOM.render(
<ManagementApp
dependencies={dependencies}
appBasePath={appBasePath}
history={history}
theme$={theme$}
/>,
element
);

ReactDOM.render(<ManagementApp {...{ history, appBasePath, theme$, dependencies }} />, element);
return () => ReactDOM.unmountComponentAtNode(element);
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
import './management_app.scss';

import React, { useState, useEffect, useCallback } from 'react';
import { BehaviorSubject } from 'rxjs';

import { I18nProvider } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import { AppMountParameters, ChromeBreadcrumb, ScopedHistory } from '@kbn/core/public';

import { reactRouterNavigate, KibanaThemeProvider } from '@kbn/kibana-react-plugin/public';
import { KibanaPageTemplate, KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template';
import useObservable from 'react-use/lib/useObservable';
import {
ManagementSection,
MANAGEMENT_BREADCRUMB,
Expand All @@ -34,12 +37,14 @@ export interface ManagementAppDependencies {
sections: SectionsServiceStart;
kibanaVersion: string;
setBreadcrumbs: (newBreadcrumbs: ChromeBreadcrumb[]) => void;
isSidebarEnabled$: BehaviorSubject<boolean>;
}

export const ManagementApp = ({ dependencies, history, theme$ }: ManagementAppProps) => {
const { setBreadcrumbs } = dependencies;
const { setBreadcrumbs, isSidebarEnabled$ } = dependencies;
const [selectedId, setSelectedId] = useState<string>('');
const [sections, setSections] = useState<ManagementSection[]>();
const isSidebarEnabled = useObservable(isSidebarEnabled$);

const onAppMounted = useCallback((id: string) => {
setSelectedId(id);
Expand Down Expand Up @@ -75,18 +80,20 @@ export const ManagementApp = ({ dependencies, history, theme$ }: ManagementAppPr
return null;
}

const solution: KibanaPageTemplateProps['solutionNav'] = {
name: i18n.translate('management.nav.label', {
defaultMessage: 'Management',
}),
icon: 'managementApp',
'data-test-subj': 'mgtSideBarNav',
items: managementSidebarNav({
selectedId,
sections,
history,
}),
};
const solution: KibanaPageTemplateProps['solutionNav'] | undefined = isSidebarEnabled
? {
name: i18n.translate('management.nav.label', {
defaultMessage: 'Management',
}),
icon: 'managementApp',
'data-test-subj': 'mgtSideBarNav',
items: managementSidebarNav({
selectedId,
sections,
history,
}),
}
: undefined;

return (
<I18nProvider>
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/management/public/mocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const createSetupContract = (): ManagementSetup => ({
});

const createStartContract = (): ManagementStart => ({
sections: {},
setIsSidebarEnabled: jest.fn(),
});

export const managementPluginMock = {
Expand Down
11 changes: 9 additions & 2 deletions src/plugins/management/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ export class ManagementPlugin

private hasAnyEnabledApps = true;

private isSidebarEnabled$ = new BehaviorSubject<boolean>(true);

constructor(private initializerContext: PluginInitializerContext) {}

public setup(core: CoreSetup, { home, share }: ManagementSetupDependencies) {
const kibanaVersion = this.initializerContext.env.packageInfo.version;
const locator = share.url.locators.create(new ManagementAppLocatorDefinition());
const managementPlugin = this;

if (home) {
home.featureCatalogue.register({
Expand Down Expand Up @@ -111,6 +114,7 @@ export class ManagementPlugin
sections: getSectionsServiceStartPrivate(),
kibanaVersion,
setBreadcrumbs: coreStart.chrome.setBreadcrumbs,
isSidebarEnabled$: managementPlugin.isSidebarEnabled$,
});
},
});
Expand All @@ -121,7 +125,7 @@ export class ManagementPlugin
};
}

public start(core: CoreStart, plugins: ManagementStartDependencies) {
public start(core: CoreStart, _plugins: ManagementStartDependencies): ManagementStart {
this.managementSections.start({ capabilities: core.application.capabilities });
this.hasAnyEnabledApps = getSectionsServiceStartPrivate()
.getSectionsEnabled()
Expand All @@ -136,6 +140,9 @@ export class ManagementPlugin
});
}

return {};
return {
setIsSidebarEnabled: (isSidebarEnabled: boolean) =>
this.isSidebarEnabled$.next(isSidebarEnabled),
};
}
}
5 changes: 3 additions & 2 deletions src/plugins/management/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ export interface DefinedSections {
stack: ManagementSection;
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface ManagementStart {}
export interface ManagementStart {
setIsSidebarEnabled: (enabled: boolean) => void;
}

export interface ManagementSectionsStartPrivate {
getSectionsEnabled: () => ManagementSection[];
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,8 @@
"@kbn/serverless-project-switcher/*": ["packages/serverless/project_switcher/*"],
"@kbn/serverless-search": ["x-pack/plugins/serverless_search"],
"@kbn/serverless-search/*": ["x-pack/plugins/serverless_search/*"],
"@kbn/serverless-security": ["x-pack/plugins/serverless_security"],
"@kbn/serverless-security/*": ["x-pack/plugins/serverless_security/*"],
"@kbn/serverless-storybook-config": ["packages/serverless/storybook/config"],
"@kbn/serverless-storybook-config/*": ["packages/serverless/storybook/config/*"],
"@kbn/serverless-types": ["packages/serverless/types"],
Expand Down
26 changes: 0 additions & 26 deletions x-pack/plugins/event_log/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,19 @@ import {
Plugin as CorePlugin,
PluginInitializerContext,
IClusterClient,
IContextProvider,
} from '@kbn/core/server';
import { SpacesPluginStart } from '@kbn/spaces-plugin/server';

import type {
EventLogRequestHandlerContext,
IEventLogConfig,
IEventLogService,
IEventLogger,
IEventLogClientService,
} from './types';
import { findRoute } from './routes';
import { EventLogService } from './event_log_service';
import { createEsContext, EsContext } from './es';
import { EventLogClientService } from './event_log_start_service';
import { SavedObjectProviderRegistry } from './saved_object_provider_registry';
import { findByIdsRoute } from './routes/find_by_ids';

export type PluginClusterClient = Pick<IClusterClient, 'asInternalUser'>;

Expand Down Expand Up @@ -88,17 +84,6 @@ export class Plugin implements CorePlugin<IEventLogService, IEventLogClientServi
event: { provider: PROVIDER },
});

core.http.registerRouteHandlerContext<EventLogRequestHandlerContext, 'eventLog'>(
'eventLog',
this.createRouteHandlerContext()
);

// Routes
const router = core.http.createRouter<EventLogRequestHandlerContext>();
// Register routes
findRoute(router, this.systemLogger);
findByIdsRoute(router, this.systemLogger);

return this.eventLogService;
}

Expand Down Expand Up @@ -161,15 +146,4 @@ export class Plugin implements CorePlugin<IEventLogService, IEventLogClientServi
await this.esContext?.shutdown();
this.systemLogger.debug('shutdown: finished');
}

private createRouteHandlerContext = (): IContextProvider<
EventLogRequestHandlerContext,
'eventLog'
> => {
return async (context, request) => {
return {
getEventLogClient: () => this.eventLogClientService!.getClient(request),
};
};
};
}
73 changes: 0 additions & 73 deletions x-pack/plugins/event_log/server/routes/_mock_handler_arguments.ts

This file was deleted.

Loading

0 comments on commit 4f289f8

Please sign in to comment.