Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into task/ingest-57952…
Browse files Browse the repository at this point in the history
…-agent-config-datasources-list-ui
  • Loading branch information
paul-tavares committed Mar 18, 2020
2 parents d64759a + 2d44870 commit 874f773
Show file tree
Hide file tree
Showing 685 changed files with 17,300 additions and 7,562 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!-- 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; [ChromeStart](./kibana-plugin-core-public.chromestart.md) &gt; [getIsCollapsed$](./kibana-plugin-core-public.chromestart.getiscollapsed_.md)
[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ChromeStart](./kibana-plugin-core-public.chromestart.md) &gt; [getIsNavDrawerLocked$](./kibana-plugin-core-public.chromestart.getisnavdrawerlocked_.md)

## ChromeStart.getIsCollapsed$() method
## ChromeStart.getIsNavDrawerLocked$() method

Get an observable of the current collapsed state of the chrome.
Get an observable of the current locked state of the nav drawer.

<b>Signature:</b>

```typescript
getIsCollapsed$(): Observable<boolean>;
getIsNavDrawerLocked$(): Observable<boolean>;
```
<b>Returns:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ core.chrome.setHelpExtension(elem => {
| [getBrand$()](./kibana-plugin-core-public.chromestart.getbrand_.md) | Get an observable of the current brand information. |
| [getBreadcrumbs$()](./kibana-plugin-core-public.chromestart.getbreadcrumbs_.md) | Get an observable of the current list of breadcrumbs |
| [getHelpExtension$()](./kibana-plugin-core-public.chromestart.gethelpextension_.md) | Get an observable of the current custom help conttent |
| [getIsCollapsed$()](./kibana-plugin-core-public.chromestart.getiscollapsed_.md) | Get an observable of the current collapsed state of the chrome. |
| [getIsNavDrawerLocked$()](./kibana-plugin-core-public.chromestart.getisnavdrawerlocked_.md) | Get an observable of the current locked state of the nav drawer. |
| [getIsVisible$()](./kibana-plugin-core-public.chromestart.getisvisible_.md) | Get an observable of the current visibility state of the chrome. |
| [removeApplicationClass(className)](./kibana-plugin-core-public.chromestart.removeapplicationclass.md) | Remove a className added with <code>addApplicationClass()</code>. If className is unknown it is ignored. |
| [setAppTitle(appTitle)](./kibana-plugin-core-public.chromestart.setapptitle.md) | Sets the current app's title |
Expand All @@ -65,6 +65,5 @@ core.chrome.setHelpExtension(elem => {
| [setBreadcrumbs(newBreadcrumbs)](./kibana-plugin-core-public.chromestart.setbreadcrumbs.md) | Override the current set of breadcrumbs |
| [setHelpExtension(helpExtension)](./kibana-plugin-core-public.chromestart.sethelpextension.md) | Override the current set of custom help content |
| [setHelpSupportUrl(url)](./kibana-plugin-core-public.chromestart.sethelpsupporturl.md) | Override the default support URL shown in the help menu |
| [setIsCollapsed(isCollapsed)](./kibana-plugin-core-public.chromestart.setiscollapsed.md) | Set the collapsed state of the chrome navigation. |
| [setIsVisible(isVisible)](./kibana-plugin-core-public.chromestart.setisvisible.md) | Set the temporary visibility for the chrome. This does nothing if the chrome is hidden by default and should be used to hide the chrome for things like full-screen modes with an exit button. |

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ esFilters: {
getPhraseFilterField: (filter: import("../common").PhraseFilter) => string;
getPhraseFilterValue: (filter: import("../common").PhraseFilter) => string | number | boolean;
getDisplayValueFromFilter: typeof getDisplayValueFromFilter;
compareFilters: (first: import("../common").Filter | import("../common").Filter[], second: import("../common").Filter | import("../common").Filter[], comparatorOptions?: import("./query/filter_manager/lib/compare_filters").FilterCompareOptions) => boolean;
COMPARE_ALL_OPTIONS: import("./query/filter_manager/lib/compare_filters").FilterCompareOptions;
compareFilters: (first: import("../common").Filter | import("../common").Filter[], second: import("../common").Filter | import("../common").Filter[], comparatorOptions?: import("../common").FilterCompareOptions) => boolean;
COMPARE_ALL_OPTIONS: import("../common").FilterCompareOptions;
generateFilters: typeof generateFilters;
onlyDisabledFiltersChanged: (newFilters?: import("../common").Filter[] | undefined, oldFilters?: import("../common").Filter[] | undefined) => boolean;
changeTimeFilter: typeof changeTimeFilter;
Expand Down

This file was deleted.

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

[Home](./index.md) &gt; [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [ISearchCancel](./kibana-plugin-plugins-data-server.isearchcancel.md)

## ISearchCancel type

<b>Signature:</b>

```typescript
export declare type ISearchCancel<T extends TStrategyTypes> = (id: string) => Promise<void>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
| Type Alias | Description |
| --- | --- |
| [FieldFormatsGetConfigFn](./kibana-plugin-plugins-data-server.fieldformatsgetconfigfn.md) | |
| [ICancel](./kibana-plugin-plugins-data-server.icancel.md) | |
| [IFieldFormatsRegistry](./kibana-plugin-plugins-data-server.ifieldformatsregistry.md) | |
| [ISearch](./kibana-plugin-plugins-data-server.isearch.md) | |
| [ISearchCancel](./kibana-plugin-plugins-data-server.isearchcancel.md) | |
| [ParsedInterval](./kibana-plugin-plugins-data-server.parsedinterval.md) | |
| [TSearchStrategyProvider](./kibana-plugin-plugins-data-server.tsearchstrategyprovider.md) | Search strategy provider creates an instance of a search strategy with the request handler context bound to it. This way every search strategy can use whatever information they require from the request context. |

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"url": "https://github.com/elastic/kibana.git"
},
"resolutions": {
"**/@types/node": "10.12.27",
"**/@types/node": ">=10.17.17 <10.20.0",
"**/@types/react": "^16.9.19",
"**/@types/react-router": "^5.1.3",
"**/@types/hapi": "^17.0.18",
Expand Down Expand Up @@ -350,7 +350,7 @@
"@types/mocha": "^5.2.7",
"@types/moment-timezone": "^0.5.12",
"@types/mustache": "^0.8.31",
"@types/node": "^10.12.27",
"@types/node": ">=10.17.17 <10.20.0",
"@types/node-forge": "^0.9.0",
"@types/normalize-path": "^3.0.0",
"@types/numeral": "^0.0.26",
Expand Down
12 changes: 8 additions & 4 deletions packages/kbn-config-schema/src/internals/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ export const internals = Joi.extend([
for (const [entryKey, entryValue] of value) {
const { value: validatedEntryKey, error: keyError } = Joi.validate(
entryKey,
params.key
params.key,
{ presence: 'required' }
);

if (keyError) {
Expand All @@ -323,7 +324,8 @@ export const internals = Joi.extend([

const { value: validatedEntryValue, error: valueError } = Joi.validate(
entryValue,
params.value
params.value,
{ presence: 'required' }
);

if (valueError) {
Expand Down Expand Up @@ -374,7 +376,8 @@ export const internals = Joi.extend([
for (const [entryKey, entryValue] of Object.entries(value)) {
const { value: validatedEntryKey, error: keyError } = Joi.validate(
entryKey,
params.key
params.key,
{ presence: 'required' }
);

if (keyError) {
Expand All @@ -383,7 +386,8 @@ export const internals = Joi.extend([

const { value: validatedEntryValue, error: valueError } = Joi.validate(
entryValue,
params.value
params.value,
{ presence: 'required' }
);

if (valueError) {
Expand Down
18 changes: 18 additions & 0 deletions packages/kbn-config-schema/src/types/map_of_type.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,24 @@ test('object within mapOf', () => {
expect(type.validate(value)).toEqual(expected);
});

test('enforces required object fields within mapOf', () => {
const type = schema.mapOf(
schema.string(),
schema.object({
bar: schema.object({
baz: schema.number(),
}),
})
);
const value = {
foo: {},
};

expect(() => type.validate(value)).toThrowErrorMatchingInlineSnapshot(
`"[foo.bar.baz]: expected value of type [number] but got [undefined]"`
);
});

test('error preserves full path', () => {
const type = schema.object({
grandParentKey: schema.object({
Expand Down
5 changes: 4 additions & 1 deletion packages/kbn-config-schema/src/types/map_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export class MapOfType<K, V> extends Type<Map<K, V>> {
path.length,
0,
// If `key` validation failed, let's stress that to make error more obvious.
type === 'map.key' ? `key("${entryKey}")` : entryKey.toString()
type === 'map.key' ? `key("${entryKey}")` : entryKey.toString(),
// Error could have happened deep inside value/key schema and error message should
// include full path.
...(reason instanceof SchemaTypeError ? reason.path : [])
);

return reason instanceof SchemaTypesError
Expand Down
18 changes: 18 additions & 0 deletions packages/kbn-config-schema/src/types/record_of_type.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,24 @@ test('object within recordOf', () => {
expect(type.validate(value)).toEqual({ foo: { bar: 123 } });
});

test('enforces required object fields within recordOf', () => {
const type = schema.recordOf(
schema.string(),
schema.object({
bar: schema.object({
baz: schema.number(),
}),
})
);
const value = {
foo: {},
};

expect(() => type.validate(value)).toThrowErrorMatchingInlineSnapshot(
`"[foo.bar.baz]: expected value of type [number] but got [undefined]"`
);
});

test('error preserves full path', () => {
const type = schema.object({
grandParentKey: schema.object({
Expand Down
5 changes: 4 additions & 1 deletion packages/kbn-config-schema/src/types/record_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export class RecordOfType<K extends string, V> extends Type<Record<K, V>> {
path.length,
0,
// If `key` validation failed, let's stress that to make error more obvious.
type === 'record.key' ? `key("${entryKey}")` : entryKey.toString()
type === 'record.key' ? `key("${entryKey}")` : entryKey.toString(),
// Error could have happened deep inside value/key schema and error message should
// include full path.
...(reason instanceof SchemaTypeError ? reason.path : [])
);

return reason instanceof SchemaTypesError
Expand Down
8 changes: 7 additions & 1 deletion packages/kbn-dev-utils/src/run/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* under the License.
*/

import { inspect } from 'util';

// @ts-ignore @types are outdated and module is super simple
import exitHook from 'exit-hook';

Expand Down Expand Up @@ -62,7 +64,11 @@ export async function run(fn: RunFn, options: Options = {}) {

process.on('unhandledRejection', error => {
log.error('UNHANDLED PROMISE REJECTION');
log.error(error);
log.error(
error instanceof Error
? error
: new Error(`non-Error type rejection value: ${inspect(error)}`)
);
process.exit(1);
});

Expand Down
5 changes: 4 additions & 1 deletion packages/kbn-pm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39806,6 +39806,7 @@ exports.isFailError = fail_1.isFailError;
*/
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = __webpack_require__(36);
const util_1 = __webpack_require__(29);
// @ts-ignore @types are outdated and module is super simple
const exit_hook_1 = tslib_1.__importDefault(__webpack_require__(348));
const tooling_log_1 = __webpack_require__(415);
Expand All @@ -39825,7 +39826,9 @@ async function run(fn, options = {}) {
});
process.on('unhandledRejection', error => {
log.error('UNHANDLED PROMISE REJECTION');
log.error(error);
log.error(error instanceof Error
? error
: new Error(`non-Error type rejection value: ${util_1.inspect(error)}`));
process.exit(1);
});
const handleErrorWithoutExit = (error) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-pm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@types/lodash.clonedeepwith": "^4.5.3",
"@types/log-symbols": "^2.0.0",
"@types/ncp": "^2.0.1",
"@types/node": "^10.12.27",
"@types/node": ">=10.17.17 <10.20.0",
"@types/ora": "^1.3.5",
"@types/read-pkg": "^4.0.0",
"@types/strip-ansi": "^3.0.0",
Expand Down
7 changes: 6 additions & 1 deletion packages/kbn-test/src/functional_test_runner/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import { resolve } from 'path';
import { inspect } from 'util';
import { run, createFlagError, Flags } from '@kbn/dev-utils';
import { FunctionalTestRunner } from './functional_test_runner';

Expand Down Expand Up @@ -86,7 +87,11 @@ export function runFtrCli() {
}
};

process.on('unhandledRejection', err => teardown(err));
process.on('unhandledRejection', err =>
teardown(
err instanceof Error ? err : new Error(`non-Error type rejection value: ${inspect(err)}`)
)
);
process.on('SIGTERM', () => teardown());
process.on('SIGINT', () => teardown());

Expand Down
5 changes: 2 additions & 3 deletions src/core/public/chrome/chrome_service.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ const createStartContractMock = () => {
getBrand$: jest.fn(),
setIsVisible: jest.fn(),
getIsVisible$: jest.fn(),
setIsCollapsed: jest.fn(),
getIsCollapsed$: jest.fn(),
addApplicationClass: jest.fn(),
removeApplicationClass: jest.fn(),
getApplicationClasses$: jest.fn(),
Expand All @@ -73,15 +71,16 @@ const createStartContractMock = () => {
getHelpExtension$: jest.fn(),
setHelpExtension: jest.fn(),
setHelpSupportUrl: jest.fn(),
getIsNavDrawerLocked$: jest.fn(),
};
startContract.navLinks.getAll.mockReturnValue([]);
startContract.getBrand$.mockReturnValue(new BehaviorSubject({} as ChromeBrand));
startContract.getIsVisible$.mockReturnValue(new BehaviorSubject(false));
startContract.getIsCollapsed$.mockReturnValue(new BehaviorSubject(false));
startContract.getApplicationClasses$.mockReturnValue(new BehaviorSubject(['class-name']));
startContract.getBadge$.mockReturnValue(new BehaviorSubject({} as ChromeBadge));
startContract.getBreadcrumbs$.mockReturnValue(new BehaviorSubject([{} as ChromeBreadcrumb]));
startContract.getHelpExtension$.mockReturnValue(new BehaviorSubject(undefined));
startContract.getIsNavDrawerLocked$.mockReturnValue(new BehaviorSubject(false));
return startContract;
};

Expand Down
Loading

0 comments on commit 874f773

Please sign in to comment.