Skip to content

Commit

Permalink
Merge branch 'master' into upgrade-elastic-charts
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Sep 9, 2020
2 parents b61875f + 2ed4b57 commit 8a50e81
Show file tree
Hide file tree
Showing 298 changed files with 9,905 additions and 4,345 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export interface SavedObjectsServiceSetup

When plugins access the Saved Objects client, a new client is created using the factory provided to `setClientFactory` and wrapped by all wrappers registered through `addClientWrapper`<!-- -->.

All the setup APIs will throw if called after the service has started, and therefor cannot be used from legacy plugin code. Legacy plugins should use the legacy savedObject service until migrated.

## Example 1


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ See the [mappings format](./kibana-plugin-core-server.savedobjectstypemappingdef
registerType: (type: SavedObjectsType) => void;
```

## Remarks

The type definition is an aggregation of the legacy savedObjects `schema`<!-- -->, `mappings` and `migration` concepts. This API is the single entry point to register saved object types in the new platform.

## Example


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Constructs a new instance of the `IndexPattern` class
<b>Signature:</b>

```typescript
constructor(id: string | undefined, { savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError, shortDotsEnable, metaFields, }: IndexPatternDeps);
constructor(id: string | undefined, { savedObjectsClient, apiClient, patternCache, fieldFormats, indexPatternsService, onNotification, onError, shortDotsEnable, metaFields, }: IndexPatternDeps);
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| id | <code>string &#124; undefined</code> | |
| { savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError, shortDotsEnable, metaFields, } | <code>IndexPatternDeps</code> | |
| { savedObjectsClient, apiClient, patternCache, fieldFormats, indexPatternsService, onNotification, onError, shortDotsEnable, metaFields, } | <code>IndexPatternDeps</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export declare class IndexPattern implements IIndexPattern
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(id, { savedObjectsClient, apiClient, patternCache, fieldFormats, onNotification, onError, shortDotsEnable, metaFields, })](./kibana-plugin-plugins-data-public.indexpattern._constructor_.md) | | Constructs a new instance of the <code>IndexPattern</code> class |
| [(constructor)(id, { savedObjectsClient, apiClient, patternCache, fieldFormats, indexPatternsService, onNotification, onError, shortDotsEnable, metaFields, })](./kibana-plugin-plugins-data-public.indexpattern._constructor_.md) | | Constructs a new instance of the <code>IndexPattern</code> class |
## Properties
Expand All @@ -29,11 +29,13 @@ export declare class IndexPattern implements IIndexPattern
| [id](./kibana-plugin-plugins-data-public.indexpattern.id.md) | | <code>string</code> | |
| [intervalName](./kibana-plugin-plugins-data-public.indexpattern.intervalname.md) | | <code>string &#124; undefined</code> | |
| [metaFields](./kibana-plugin-plugins-data-public.indexpattern.metafields.md) | | <code>string[]</code> | |
| [originalBody](./kibana-plugin-plugins-data-public.indexpattern.originalbody.md) | | <code>{</code><br/><code> [key: string]: any;</code><br/><code> }</code> | |
| [sourceFilters](./kibana-plugin-plugins-data-public.indexpattern.sourcefilters.md) | | <code>SourceFilter[]</code> | |
| [timeFieldName](./kibana-plugin-plugins-data-public.indexpattern.timefieldname.md) | | <code>string &#124; undefined</code> | |
| [title](./kibana-plugin-plugins-data-public.indexpattern.title.md) | | <code>string</code> | |
| [type](./kibana-plugin-plugins-data-public.indexpattern.type.md) | | <code>string &#124; undefined</code> | |
| [typeMeta](./kibana-plugin-plugins-data-public.indexpattern.typemeta.md) | | <code>TypeMeta</code> | |
| [version](./kibana-plugin-plugins-data-public.indexpattern.version.md) | | <code>string &#124; undefined</code> | |
## Methods
Expand All @@ -60,6 +62,5 @@ export declare class IndexPattern implements IIndexPattern
| [prepBody()](./kibana-plugin-plugins-data-public.indexpattern.prepbody.md) | | |
| [refreshFields()](./kibana-plugin-plugins-data-public.indexpattern.refreshfields.md) | | |
| [removeScriptedField(fieldName)](./kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md) | | |
| [save(saveAttempts)](./kibana-plugin-plugins-data-public.indexpattern.save.md) | | |
| [toSpec()](./kibana-plugin-plugins-data-public.indexpattern.tospec.md) | | |
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-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) &gt; [originalBody](./kibana-plugin-plugins-data-public.indexpattern.originalbody.md)

## IndexPattern.originalBody property

<b>Signature:</b>

```typescript
originalBody: {
[key: string]: any;
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<b>Signature:</b>

```typescript
removeScriptedField(fieldName: string): Promise<void | Error>;
removeScriptedField(fieldName: string): void;
```

## Parameters
Expand All @@ -18,5 +18,5 @@ removeScriptedField(fieldName: string): Promise<void | Error>;

<b>Returns:</b>

`Promise<void | Error>`
`void`

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-public](./kibana-plugin-plugins-data-public.md) &gt; [IndexPattern](./kibana-plugin-plugins-data-public.indexpattern.md) &gt; [version](./kibana-plugin-plugins-data-public.indexpattern.version.md)

## IndexPattern.version property

<b>Signature:</b>

```typescript
version: string | undefined;
```
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
| [OptionedValueProp](./kibana-plugin-plugins-data-public.optionedvalueprop.md) | |
| [Query](./kibana-plugin-plugins-data-public.query.md) | |
| [QueryState](./kibana-plugin-plugins-data-public.querystate.md) | All query state service state |
| [QueryStateChange](./kibana-plugin-plugins-data-public.querystatechange.md) | |
| [QuerySuggestionBasic](./kibana-plugin-plugins-data-public.querysuggestionbasic.md) | \* |
| [QuerySuggestionField](./kibana-plugin-plugins-data-public.querysuggestionfield.md) | \* |
| [QuerySuggestionGetFnArgs](./kibana-plugin-plugins-data-public.querysuggestiongetfnargs.md) | \* |
Expand Down
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-public](./kibana-plugin-plugins-data-public.md) &gt; [QueryStateChange](./kibana-plugin-plugins-data-public.querystatechange.md) &gt; [appFilters](./kibana-plugin-plugins-data-public.querystatechange.appfilters.md)

## QueryStateChange.appFilters property

<b>Signature:</b>

```typescript
appFilters?: boolean;
```
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-public](./kibana-plugin-plugins-data-public.md) &gt; [QueryStateChange](./kibana-plugin-plugins-data-public.querystatechange.md) &gt; [globalFilters](./kibana-plugin-plugins-data-public.querystatechange.globalfilters.md)

## QueryStateChange.globalFilters property

<b>Signature:</b>

```typescript
globalFilters?: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [QueryStateChange](./kibana-plugin-plugins-data-public.querystatechange.md)

## QueryStateChange interface

<b>Signature:</b>

```typescript
export interface QueryStateChange extends QueryStateChangePartial
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [appFilters](./kibana-plugin-plugins-data-public.querystatechange.appfilters.md) | <code>boolean</code> | |
| [globalFilters](./kibana-plugin-plugins-data-public.querystatechange.globalfilters.md) | <code>boolean</code> | |
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
QueryStringInput: React.FC<Pick<Props, "query" | "prepend" | "size" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "onChangeQueryInputFocus">>
QueryStringInput: React.FC<Pick<Props, "query" | "prepend" | "size" | "className" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "onChangeQueryInputFocus">>
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<b>Signature:</b>

```typescript
SearchBar: React.ComponentClass<Pick<Pick<SearchBarProps, "query" | "isLoading" | "filters" | "onRefresh" | "onRefreshChange" | "refreshInterval" | "intl" | "indexPatterns" | "dataTestSubj" | "customSubmitButton" | "screenTitle" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "indicateNoData" | "timeHistory" | "onFiltersUpdated">, "query" | "isLoading" | "filters" | "onRefresh" | "onRefreshChange" | "refreshInterval" | "indexPatterns" | "dataTestSubj" | "customSubmitButton" | "screenTitle" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "indicateNoData" | "timeHistory" | "onFiltersUpdated">, any> & {
WrappedComponent: React.ComponentType<Pick<SearchBarProps, "query" | "isLoading" | "filters" | "onRefresh" | "onRefreshChange" | "refreshInterval" | "intl" | "indexPatterns" | "dataTestSubj" | "customSubmitButton" | "screenTitle" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "indicateNoData" | "timeHistory" | "onFiltersUpdated"> & ReactIntl.InjectedIntlProps>;
SearchBar: React.ComponentClass<Pick<Pick<SearchBarProps, "query" | "isLoading" | "filters" | "onRefresh" | "onRefreshChange" | "refreshInterval" | "intl" | "indexPatterns" | "dataTestSubj" | "timeHistory" | "customSubmitButton" | "screenTitle" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "indicateNoData" | "onFiltersUpdated">, "query" | "isLoading" | "filters" | "onRefresh" | "onRefreshChange" | "refreshInterval" | "indexPatterns" | "dataTestSubj" | "timeHistory" | "customSubmitButton" | "screenTitle" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "indicateNoData" | "onFiltersUpdated">, any> & {
WrappedComponent: React.ComponentType<Pick<SearchBarProps, "query" | "isLoading" | "filters" | "onRefresh" | "onRefreshChange" | "refreshInterval" | "intl" | "indexPatterns" | "dataTestSubj" | "timeHistory" | "customSubmitButton" | "screenTitle" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "indicateNoData" | "onFiltersUpdated"> & ReactIntl.InjectedIntlProps>;
}
```
2 changes: 0 additions & 2 deletions kibana.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ export namespace Legacy {
export type KibanaConfig = LegacyKibanaServer.KibanaConfig;
export type Request = LegacyKibanaServer.Request;
export type ResponseToolkit = LegacyKibanaServer.ResponseToolkit;
export type SavedObjectsClient = LegacyKibanaServer.SavedObjectsClient;
export type SavedObjectsService = LegacyKibanaServer.SavedObjectsLegacyService;
export type Server = LegacyKibanaServer.Server;

export type InitPluginFunction = LegacyKibanaPluginSpec.InitPluginFunction;
Expand Down
20 changes: 4 additions & 16 deletions packages/kbn-ui-shared-deps/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,10 @@ exports.getWebpackConfig = ({ dev = false } = {}) => ({
mode: dev ? 'development' : 'production',
entry: {
'kbn-ui-shared-deps': './entry.js',
'kbn-ui-shared-deps.v7.dark': [
'@elastic/eui/dist/eui_theme_dark.css',
'@elastic/charts/dist/theme_only_dark.css',
],
'kbn-ui-shared-deps.v7.light': [
'@elastic/eui/dist/eui_theme_light.css',
'@elastic/charts/dist/theme_only_light.css',
],
'kbn-ui-shared-deps.v8.dark': [
'@elastic/eui/dist/eui_theme_amsterdam_dark.css',
'@elastic/charts/dist/theme_only_dark.css',
],
'kbn-ui-shared-deps.v8.light': [
'@elastic/eui/dist/eui_theme_amsterdam_light.css',
'@elastic/charts/dist/theme_only_light.css',
],
'kbn-ui-shared-deps.v7.dark': ['@elastic/eui/dist/eui_theme_dark.css'],
'kbn-ui-shared-deps.v7.light': ['@elastic/eui/dist/eui_theme_light.css'],
'kbn-ui-shared-deps.v8.dark': ['@elastic/eui/dist/eui_theme_amsterdam_dark.css'],
'kbn-ui-shared-deps.v8.light': ['@elastic/eui/dist/eui_theme_amsterdam_light.css'],
},
context: __dirname,
devtool: dev ? '#cheap-source-map' : false,
Expand Down
5 changes: 1 addition & 4 deletions src/core/public/core_app/styles/_globals_v7dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// prepended to all .scss imports (from JS, when v7dark theme selected)

@import '@elastic/eui/src/themes/eui/eui_colors_dark';

@import '@elastic/eui/src/global_styling/functions/index';
@import '@elastic/eui/src/global_styling/variables/index';
@import '@elastic/eui/src/global_styling/mixins/index';
@import '@elastic/eui/src/themes/eui/eui_globals';

@import './mixins';
5 changes: 1 addition & 4 deletions src/core/public/core_app/styles/_globals_v7light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// prepended to all .scss imports (from JS, when v7light theme selected)

@import '@elastic/eui/src/themes/eui/eui_colors_light';

@import '@elastic/eui/src/global_styling/functions/index';
@import '@elastic/eui/src/global_styling/variables/index';
@import '@elastic/eui/src/global_styling/mixins/index';
@import '@elastic/eui/src/themes/eui/eui_globals';

@import './mixins';
10 changes: 1 addition & 9 deletions src/core/public/core_app/styles/_globals_v8dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
// prepended to all .scss imports (from JS, when v8dark theme selected)

@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_colors_dark';

@import '@elastic/eui/src/global_styling/functions/index';
@import '@elastic/eui/src/themes/eui-amsterdam/global_styling/functions/index';

@import '@elastic/eui/src/global_styling/variables/index';
@import '@elastic/eui/src/themes/eui-amsterdam/global_styling/variables/index';

@import '@elastic/eui/src/global_styling/mixins/index';
@import '@elastic/eui/src/themes/eui-amsterdam/global_styling/mixins/index';
@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_globals';

@import './mixins';
10 changes: 1 addition & 9 deletions src/core/public/core_app/styles/_globals_v8light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
// prepended to all .scss imports (from JS, when v8light theme selected)

@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_colors_light';

@import '@elastic/eui/src/global_styling/functions/index';
@import '@elastic/eui/src/themes/eui-amsterdam/global_styling/functions/index';

@import '@elastic/eui/src/global_styling/variables/index';
@import '@elastic/eui/src/themes/eui-amsterdam/global_styling/variables/index';

@import '@elastic/eui/src/global_styling/mixins/index';
@import '@elastic/eui/src/themes/eui-amsterdam/global_styling/mixins/index';
@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_globals';

@import './mixins';
6 changes: 6 additions & 0 deletions src/core/public/styles/_base.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// Charts themes available app-wide
@import '@elastic/charts/dist/theme';
@import '@elastic/eui/src/themes/charts/theme';

// Grab some nav-specific EUI vars
@import '@elastic/eui/src/components/collapsible_nav/variables';

// Application Layout

// chrome-context
Expand Down
2 changes: 0 additions & 2 deletions src/core/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,7 @@ export {
SavedObjectUnsanitizedDoc,
SavedObjectsRepositoryFactory,
SavedObjectsResolveImportErrorsOptions,
SavedObjectsSchema,
SavedObjectsSerializer,
SavedObjectsLegacyService,
SavedObjectsUpdateOptions,
SavedObjectsUpdateResponse,
SavedObjectsAddToNamespacesOptions,
Expand Down
8 changes: 1 addition & 7 deletions src/core/server/legacy/legacy_service.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ type LegacyServiceMock = jest.Mocked<PublicMethodsOf<LegacyService> & { legacyId

const createDiscoverPluginsMock = (): LegacyServiceDiscoverPlugins => ({
pluginSpecs: [],
uiExports: {
savedObjectSchemas: {},
savedObjectMappings: [],
savedObjectMigrations: {},
savedObjectValidations: {},
savedObjectsManagement: {},
},
uiExports: {},
navLinks: [],
pluginExtendedConfig: {
get: jest.fn(),
Expand Down
2 changes: 0 additions & 2 deletions src/core/server/legacy/legacy_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,9 @@ export class LegacyService implements CoreService {
registerStaticDir: setupDeps.core.http.registerStaticDir,
},
hapiServer: setupDeps.core.http.server,
kibanaMigrator: startDeps.core.savedObjects.migrator,
uiPlugins: setupDeps.uiPlugins,
elasticsearch: setupDeps.core.elasticsearch,
rendering: setupDeps.core.rendering,
savedObjectsClientProvider: startDeps.core.savedObjects.clientProvider,
legacy: this.legacyInternals,
},
logger: this.coreContext.logger,
Expand Down
5 changes: 2 additions & 3 deletions src/core/server/legacy/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { KibanaRequest, LegacyRequest } from '../http';
import { InternalCoreSetup, InternalCoreStart } from '../internal_types';
import { PluginsServiceSetup, PluginsServiceStart, UiPlugins } from '../plugins';
import { InternalRenderingServiceSetup } from '../rendering';
import { SavedObjectsLegacyUiExports } from '../types';

/**
* @internal
Expand Down Expand Up @@ -128,13 +127,13 @@ export type LegacyNavLink = Omit<ChromeNavLink, 'baseUrl' | 'legacy' | 'order' |
* @internal
* @deprecated
*/
export type LegacyUiExports = SavedObjectsLegacyUiExports & {
export interface LegacyUiExports {
defaultInjectedVarProviders?: VarsProvider[];
injectedVarsReplacers?: VarsReplacer[];
navLinkSpecs?: LegacyNavLinkSpec[] | null;
uiAppSpecs?: Array<LegacyAppSpec | undefined>;
unknown?: [{ pluginSpec: LegacyPluginSpec; type: unknown }];
};
}

/**
* @public
Expand Down
Loading

0 comments on commit 8a50e81

Please sign in to comment.