Skip to content

Commit

Permalink
Merge branch 'main' of github.com:elastic/kibana into exp-annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed May 30, 2022
2 parents f64a417 + 76d6715 commit 3db5890
Show file tree
Hide file tree
Showing 291 changed files with 2,980 additions and 2,622 deletions.
2 changes: 2 additions & 0 deletions .buildkite/pull_requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"skip_ci_labels": ["skip-ci", "jenkins-ci"],
"skip_target_branches": ["6.8", "7.11", "7.12"],
"skip_ci_on_only_changed": [
"^dev_docs/",
"^docs/",
"^rfcs/",
"^.ci/.+\\.yml$",
Expand All @@ -26,6 +27,7 @@
"^.ci/Jenkinsfile_[^/]+$",
"^\\.github/",
"\\.md$",
"\\.mdx$",
"^\\.backportrc\\.json$",
"^nav-kibana-dev\\.docnav\\.json$",
"^src/dev/prs/kibana_qa_pr_list\\.json$",
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/functional/synthetics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ source .buildkite/scripts/common/util.sh

export JOB=kibana-uptime-playwright

echo "--- Uptime @elastic/synthetics Tests"
echo "--- synthetics @elastic/synthetics Tests"

cd "$XPACK_DIR"

checks-reporter-with-killswitch "Uptime @elastic/synthetics Tests" \
checks-reporter-with-killswitch "synthetics @elastic/synthetics Tests" \
node plugins/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" --grep "MonitorManagement-monitor*"
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/functional/uptime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ source .buildkite/scripts/common/util.sh

export JOB=kibana-uptime-playwright

echo "--- Uptime @elastic/synthetics Tests"
echo "--- synthetics @elastic/synthetics Tests"

cd "$XPACK_DIR"

checks-reporter-with-killswitch "uptime plugin @elastic/synthetics Tests" \
checks-reporter-with-killswitch "synthetics plugin @elastic/synthetics Tests" \
node plugins/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Custom content to occur below the list of links
<b>Signature:</b>

```typescript
content?: (element: HTMLDivElement) => () => void;
content?: (element: HTMLDivElement, menuActions: ChromeHelpMenuActions) => () => void;
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export interface ChromeHelpExtension
| Property | Type | Description |
| --- | --- | --- |
| [appName](./kibana-plugin-core-public.chromehelpextension.appname.md) | string | Provide your plugin's name to create a header for separation |
| [content?](./kibana-plugin-core-public.chromehelpextension.content.md) | (element: HTMLDivElement) =&gt; () =&gt; void | <i>(Optional)</i> Custom content to occur below the list of links |
| [content?](./kibana-plugin-core-public.chromehelpextension.content.md) | (element: HTMLDivElement, menuActions: ChromeHelpMenuActions) =&gt; () =&gt; void | <i>(Optional)</i> Custom content to occur below the list of links |
| [links?](./kibana-plugin-core-public.chromehelpextension.links.md) | ChromeHelpExtensionMenuLink\[\] | <i>(Optional)</i> Creates unified links for sending users to documentation, GitHub, Discuss, or a custom link/button |

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ChromeHelpMenuActions](./kibana-plugin-core-public.chromehelpmenuactions.md) &gt; [hideHelpMenu](./kibana-plugin-core-public.chromehelpmenuactions.hidehelpmenu.md)

## ChromeHelpMenuActions.hideHelpMenu property

The action provides the capability to hide the help menu from within the help extension content components.

<b>Signature:</b>

```typescript
hideHelpMenu: () => void;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ChromeHelpMenuActions](./kibana-plugin-core-public.chromehelpmenuactions.md)

## ChromeHelpMenuActions interface

<b>Signature:</b>

```typescript
export interface ChromeHelpMenuActions
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [hideHelpMenu](./kibana-plugin-core-public.chromehelpmenuactions.hidehelpmenu.md) | () =&gt; void | |
1 change: 1 addition & 0 deletions docs/development/core/public/kibana-plugin-core-public.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [ChromeHelpExtensionMenuDiscussLink](./kibana-plugin-core-public.chromehelpextensionmenudiscusslink.md) | |
| [ChromeHelpExtensionMenuDocumentationLink](./kibana-plugin-core-public.chromehelpextensionmenudocumentationlink.md) | |
| [ChromeHelpExtensionMenuGitHubLink](./kibana-plugin-core-public.chromehelpextensionmenugithublink.md) | |
| [ChromeHelpMenuActions](./kibana-plugin-core-public.chromehelpmenuactions.md) | List of actions in order to manipulate with the help menu from the help extensions content components. |
| [ChromeNavControl](./kibana-plugin-core-public.chromenavcontrol.md) | |
| [ChromeNavControls](./kibana-plugin-core-public.chromenavcontrols.md) | [APIs](./kibana-plugin-core-public.chromenavcontrols.md) for registering new controls to be displayed in the navigation bar. |
| [ChromeNavLink](./kibana-plugin-core-public.chromenavlink.md) | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Set of helpers used to create `KibanaResponse` to form HTTP response on an incom

```typescript
kibanaResponseFactory: {
custom: <T extends string | Record<string, any> | Error | Buffer | Stream | {
custom: <T extends string | Record<string, any> | Error | Buffer | {
message: string | Error;
attributes?: ResponseErrorAttributes | undefined;
} | undefined>(options: CustomHttpResponseOptions<T>) => KibanaResponse<T>;
} | Stream | undefined>(options: CustomHttpResponseOptions<T>) => KibanaResponse<T>;
badRequest: (options?: ErrorHttpResponseOptions) => KibanaResponse<string | Error | {
message: string | Error;
attributes?: ResponseErrorAttributes | undefined;
Expand All @@ -34,10 +34,10 @@ kibanaResponseFactory: {
message: string | Error;
attributes?: ResponseErrorAttributes | undefined;
}>;
customError: (options: CustomHttpResponseOptions<ResponseError | Buffer | Stream>) => KibanaResponse<string | Error | Buffer | Stream | {
customError: (options: CustomHttpResponseOptions<ResponseError | Buffer | Stream>) => KibanaResponse<string | Error | Buffer | {
message: string | Error;
attributes?: ResponseErrorAttributes | undefined;
}>;
} | Stream>;
redirected: (options: RedirectResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
ok: (options?: HttpResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
accepted: (options?: HttpResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
"deep-freeze-strict": "^1.1.1",
"deepmerge": "^4.2.2",
"del": "^5.1.0",
"elastic-apm-node": "^3.33.0",
"elastic-apm-node": "^3.34.0",
"email-addresses": "^5.0.0",
"execa": "^4.0.2",
"exit-hook": "^2.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ it('produces the right watch and ignore list', () => {
<absolute path>/x-pack/plugins/lists/server/scripts,
<absolute path>/x-pack/plugins/security_solution/scripts,
<absolute path>/x-pack/plugins/security_solution/server/lib/detection_engine/scripts,
<absolute path>/x-pack/plugins/uptime/e2e,
<absolute path>/x-pack/plugins/synthetics/e2e,
]
`);
});
2 changes: 1 addition & 1 deletion packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function getServerWatchPaths({ pluginPaths, pluginScanDirs }: Options) {
fromRoot('x-pack/plugins/lists/server/scripts'),
fromRoot('x-pack/plugins/security_solution/scripts'),
fromRoot('x-pack/plugins/security_solution/server/lib/detection_engine/scripts'),
fromRoot('x-pack/plugins/uptime/e2e'),
fromRoot('x-pack/plugins/synthetics/e2e'),
];

return {
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
apiKeysLearnMore: `${KIBANA_DOCS}api-keys.html`,
onPremRegistry: `${FLEET_DOCS}air-gapped.html`,
secureLogstash: `${FLEET_DOCS}secure-logstash-connections.html`,
agentPolicy: `${FLEET_DOCS}agent-policy.html`,
},
ecs: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/ecs/current/index.html`,
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ export interface DocLinks {
apiKeysLearnMore: string;
onPremRegistry: string;
secureLogstash: string;
agentPolicy: string;
}>;
readonly ecs: {
readonly guide: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { useCallback, useEffect, useRef, useReducer } from 'react';
import { useCallback, useEffect, useRef, useReducer, Reducer } from 'react';
import { Observable, Subscription } from 'rxjs';

import { useIsMounted } from '../use_is_mounted';
Expand All @@ -23,18 +23,16 @@ export type Action<T> =
| { type: 'setError'; error: unknown }
| { type: 'load' };

const createReducer =
<T>() =>
(state: State<T>, action: Action<T>) => {
switch (action.type) {
case 'setResult':
return { ...state, result: action.result, loading: false };
case 'setError':
return { ...state, error: action.error, loading: false };
case 'load':
return { loading: true, result: undefined, error: undefined };
}
};
function reducer<T>(state: State<T>, action: Action<T>) {
switch (action.type) {
case 'setResult':
return { ...state, result: action.result, loading: false };
case 'setError':
return { ...state, error: action.error, loading: false };
case 'load':
return { loading: true, result: undefined, error: undefined };
}
}

/**
*
Expand All @@ -47,8 +45,7 @@ export const useObservable = <Args extends unknown[], Result>(
): Task<Args, Result> => {
const isMounted = useIsMounted();
const subRef = useRef<Subscription | undefined>();
const reducer = createReducer<Result>();
const [state, dispatch] = useReducer(reducer, {
const [state, dispatch] = useReducer<Reducer<State<Result>, Action<Result>>>(reducer, {
loading: false,
error: undefined,
result: undefined,
Expand Down
1 change: 1 addition & 0 deletions src/core/public/chrome/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export type {
InternalChromeStart,
ChromeStart,
ChromeHelpExtension,
ChromeHelpMenuActions,
ChromeBreadcrumbsAppendExtension,
ChromeBreadcrumb,
ChromeBadge,
Expand Down
7 changes: 6 additions & 1 deletion src/core/public/chrome/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export interface ChromeUserBanner {
content: MountPoint<HTMLDivElement>;
}

/** @public */
export interface ChromeHelpMenuActions {
hideHelpMenu: () => void;
}

/** @public */
export interface ChromeHelpExtension {
/**
Expand All @@ -48,7 +53,7 @@ export interface ChromeHelpExtension {
/**
* Custom content to occur below the list of links
*/
content?: (element: HTMLDivElement) => () => void;
content?: (element: HTMLDivElement, menuActions: ChromeHelpMenuActions) => () => void;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/core/public/chrome/ui/header/header_help_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@ export class HeaderHelpMenu extends Component<Props, State> {
{content && (
<>
{customLinks && <EuiSpacer size="xs" />}
<HeaderExtension extension={content} />
<HeaderExtension
extension={(domNode) => content(domNode, { hideHelpMenu: this.closeMenu })}
/>
</>
)}
</>
Expand Down
2 changes: 2 additions & 0 deletions src/core/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
ChromeRecentlyAccessedHistoryItem,
ChromeUserBanner,
NavType,
ChromeHelpMenuActions,
} from './chrome';
import { FatalErrorsSetup, FatalErrorsStart, FatalErrorInfo } from './fatal_errors';
import { HttpSetup, HttpStart } from './http';
Expand Down Expand Up @@ -324,6 +325,7 @@ export type {
ChromeBadge,
ChromeBreadcrumb,
ChromeHelpExtension,
ChromeHelpMenuActions,
ChromeHelpExtensionMenuLink,
ChromeHelpExtensionLinkBase,
ChromeHelpExtensionMenuCustomLink,
Expand Down
8 changes: 7 additions & 1 deletion src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export interface ChromeDocTitle {
// @public (undocumented)
export interface ChromeHelpExtension {
appName: string;
content?: (element: HTMLDivElement) => () => void;
content?: (element: HTMLDivElement, menuActions: ChromeHelpMenuActions) => () => void;
links?: ChromeHelpExtensionMenuLink[];
}

Expand Down Expand Up @@ -284,6 +284,12 @@ export interface ChromeHelpExtensionMenuGitHubLink extends ChromeHelpExtensionLi
// @public (undocumented)
export type ChromeHelpExtensionMenuLink = ChromeHelpExtensionMenuGitHubLink | ChromeHelpExtensionMenuDiscussLink | ChromeHelpExtensionMenuDocumentationLink | ChromeHelpExtensionMenuCustomLink;

// @public (undocumented)
export interface ChromeHelpMenuActions {
// (undocumented)
hideHelpMenu: () => void;
}

// @public (undocumented)
export interface ChromeNavControl {
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/capabilities/capabilities_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* Side Public License, v 1.
*/

import { Logger } from '@kbn/logging';
import { Capabilities, CapabilitiesProvider, CapabilitiesSwitcher } from './types';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
import { InternalHttpServicePreboot, InternalHttpServiceSetup, KibanaRequest } from '../http';
import { mergeCapabilities } from './merge_capabilities';
import { getCapabilitiesResolver, CapabilitiesResolver } from './resolve_capabilities';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/core_app/core_app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import { stringify } from 'querystring';
import { Env } from '@kbn/config';
import { schema } from '@kbn/config-schema';
import { fromRoot } from '@kbn/utils';
import { Logger } from '@kbn/logging';

import { IRouter, IBasePath, IKibanaResponse, KibanaResponseFactory, KibanaRequest } from '../http';
import { HttpResources, HttpResourcesServiceToolkit } from '../http_resources';
import { InternalCorePreboot, InternalCoreSetup } from '../internal_types';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
import { registerBundleRoutes } from './bundle_routes';
import { UiPlugins } from '../plugins';

Expand Down
2 changes: 1 addition & 1 deletion src/core/server/core_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* Side Public License, v 1.
*/

import { LoggerFactory } from '@kbn/logging';
import { IConfigService, Env } from './config';
import { LoggerFactory } from './logging';

/** @internal */
export type CoreId = symbol;
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/deprecations/deprecations_factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import type { GetDeprecationsContext } from './types';
import { DeprecationsFactory, DeprecationsFactoryConfig } from './deprecations_factory';
import { loggerMock } from '../logging/logger.mock';
import { loggerMock } from '@kbn/logging-mocks';
import { DeprecationsDetails } from './types';

describe('DeprecationsFactory', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/deprecations/deprecations_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/

import { i18n } from '@kbn/i18n';
import type { Logger } from '@kbn/logging';
import { DeprecationsRegistry } from './deprecations_registry';
import type { Logger } from '../logging';
import type {
DomainDeprecationDetails,
DeprecationsDetails,
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/deprecations/deprecations_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import { firstValueFrom } from 'rxjs';

import type { Logger } from '@kbn/logging';
import { DeprecationsFactory } from './deprecations_factory';
import { DomainDeprecationDetails, RegisterDeprecationsConfig } from './types';
import { registerRoutes } from './routes';
Expand All @@ -16,7 +17,6 @@ import { CoreContext } from '../core_context';
import { IConfigService } from '../config';
import { CoreService } from '../../types';
import { InternalHttpServiceSetup } from '../http';
import { Logger } from '../logging';
import { IScopedClusterClient } from '../elasticsearch/client';
import { SavedObjectsClientContract } from '../saved_objects/types';

Expand Down
2 changes: 1 addition & 1 deletion src/core/server/elasticsearch/client/cluster_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import type { Client } from '@elastic/elasticsearch';
import { Logger } from '../../logging';
import type { Logger } from '@kbn/logging';
import { IAuthHeadersStorage, Headers, isKibanaRequest, isRealRequest } from '../../http';
import { ensureRawRequest, filterHeaders } from '../../http/router';
import { ScopeableRequest } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/elasticsearch/client/configure_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { Client, HttpConnection } from '@elastic/elasticsearch';
import { Logger } from '../../logging';
import type { Logger } from '@kbn/logging';
import { parseClientOptions, ElasticsearchClientConfig } from './client_config';
import { instrumentEsQueryAndDeprecationLogger } from './log_query_and_deprecation';
import { createTransport } from './create_transport';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { Buffer } from 'buffer';
import { stringify } from 'querystring';
import { errors, DiagnosticResult, RequestBody, Client } from '@elastic/elasticsearch';
import numeral from '@elastic/numeral';
import type { Logger } from '@kbn/logging';
import type { ElasticsearchErrorDetails } from './types';
import { getEcsResponseLog } from './get_ecs_response_log';
import { Logger } from '../../logging';

const convertQueryString = (qs: string | Record<string, any> | undefined): string => {
if (qs === undefined || typeof qs === 'string') {
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/elasticsearch/client/retry_call_cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { defer, throwError, iif, timer } from 'rxjs';
import { concatMap, retryWhen } from 'rxjs/operators';
import { Logger } from '../../logging';
import type { Logger } from '@kbn/logging';

const retryResponseStatuses = [
503, // ServiceUnavailable
Expand Down
Loading

0 comments on commit 3db5890

Please sign in to comment.