Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into 62624
Browse files Browse the repository at this point in the history
# Conflicts:
#	x-pack/plugins/maps/public/layers/sources/es_source/es_source.d.ts
  • Loading branch information
alexwizp committed Apr 22, 2020
2 parents 3b34339 + 939bf2a commit 26a304d
Show file tree
Hide file tree
Showing 147 changed files with 5,349 additions and 1,194 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

```typescript
actions: {
createFiltersFromEvent: typeof createFiltersFromEvent;
createFiltersFromValueClickAction: typeof createFiltersFromValueClickAction;
createFiltersFromRangeSelectAction: typeof createFiltersFromRangeSelectAction;
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface DataPublicPluginStart

| Property | Type | Description |
| --- | --- | --- |
| [actions](./kibana-plugin-plugins-data-public.datapublicpluginstart.actions.md) | <code>{</code><br/><code> createFiltersFromEvent: typeof createFiltersFromEvent;</code><br/><code> }</code> | |
| [actions](./kibana-plugin-plugins-data-public.datapublicpluginstart.actions.md) | <code>{</code><br/><code> createFiltersFromValueClickAction: typeof createFiltersFromValueClickAction;</code><br/><code> createFiltersFromRangeSelectAction: typeof createFiltersFromRangeSelectAction;</code><br/><code> }</code> | |
| [autocomplete](./kibana-plugin-plugins-data-public.datapublicpluginstart.autocomplete.md) | <code>AutocompleteStart</code> | |
| [fieldFormats](./kibana-plugin-plugins-data-public.datapublicpluginstart.fieldformats.md) | <code>FieldFormatsStart</code> | |
| [indexPatterns](./kibana-plugin-plugins-data-public.datapublicpluginstart.indexpatterns.md) | <code>IndexPatternsContract</code> | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
fieldFormats: {
FieldFormat: typeof FieldFormat;
FieldFormatsRegistry: typeof FieldFormatsRegistry;
serialize: (agg: import("./search").AggConfig) => import("../../expressions/common").SerializedFieldFormat<object>;
serialize: (agg: import("./search").AggConfig) => import("../../expressions").SerializedFieldFormat<object>;
DEFAULT_CONVERTER_COLOR: {
range: string;
regex: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
fieldFormats: {
FieldFormatsRegistry: typeof FieldFormatsRegistry;
FieldFormat: typeof FieldFormat;
serializeFieldFormat: (agg: import("../public/search").AggConfig) => import("../../expressions/common").SerializedFieldFormat<object>;
serializeFieldFormat: (agg: import("../public/search").AggConfig) => import("../../expressions").SerializedFieldFormat<object>;
BoolFormat: typeof BoolFormat;
BytesFormat: typeof BytesFormat;
ColorFormat: typeof ColorFormat;
Expand Down
7 changes: 7 additions & 0 deletions packages/kbn-storybook/storybook_config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ module.exports = async ({ config }) => {
},
});

config.module.rules.push({
test: /\.(html|md|txt|tmpl)$/,
use: {
loader: 'raw-loader',
},
});

// Handle Typescript files
config.module.rules.push({
test: /\.tsx?$/,
Expand Down
50 changes: 0 additions & 50 deletions src/core/server/config/deprecation/core_deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,56 +128,6 @@ export const coreDeprecationProvider: ConfigDeprecationProvider = ({
renameFromRoot('optimize.lazyHost', 'optimize.watchHost'),
renameFromRoot('optimize.lazyPrebuild', 'optimize.watchPrebuild'),
renameFromRoot('optimize.lazyProxyTimeout', 'optimize.watchProxyTimeout'),
// Monitoring renames
// TODO: Remove these from here once the monitoring plugin is migrated to NP
renameFromRoot('xpack.monitoring.enabled', 'monitoring.enabled'),
renameFromRoot('xpack.monitoring.ui.enabled', 'monitoring.ui.enabled'),
renameFromRoot(
'xpack.monitoring.kibana.collection.enabled',
'monitoring.kibana.collection.enabled'
),
renameFromRoot('xpack.monitoring.max_bucket_size', 'monitoring.ui.max_bucket_size'),
renameFromRoot('xpack.monitoring.min_interval_seconds', 'monitoring.ui.min_interval_seconds'),
renameFromRoot(
'xpack.monitoring.show_license_expiration',
'monitoring.ui.show_license_expiration'
),
renameFromRoot(
'xpack.monitoring.ui.container.elasticsearch.enabled',
'monitoring.ui.container.elasticsearch.enabled'
),
renameFromRoot(
'xpack.monitoring.ui.container.logstash.enabled',
'monitoring.ui.container.logstash.enabled'
),
renameFromRoot(
'xpack.monitoring.tests.cloud_detector.enabled',
'monitoring.tests.cloud_detector.enabled'
),
renameFromRoot(
'xpack.monitoring.kibana.collection.interval',
'monitoring.kibana.collection.interval'
),
renameFromRoot('xpack.monitoring.elasticsearch.hosts', 'monitoring.ui.elasticsearch.hosts'),
renameFromRoot('xpack.monitoring.elasticsearch.username', 'monitoring.ui.elasticsearch.username'),
renameFromRoot('xpack.monitoring.elasticsearch.password', 'monitoring.ui.elasticsearch.password'),
renameFromRoot(
'xpack.monitoring.xpack_api_polling_frequency_millis',
'monitoring.xpack_api_polling_frequency_millis'
),
renameFromRoot(
'xpack.monitoring.cluster_alerts.email_notifications.enabled',
'monitoring.cluster_alerts.email_notifications.enabled'
),
renameFromRoot(
'xpack.monitoring.cluster_alerts.email_notifications.email_address',
'monitoring.cluster_alerts.email_notifications.email_address'
),
renameFromRoot('xpack.monitoring.ccs.enabled', 'monitoring.ui.ccs.enabled'),
renameFromRoot(
'xpack.monitoring.elasticsearch.logFetchCount',
'monitoring.ui.elasticsearch.logFetchCount'
),
configPathDeprecation,
dataPathDeprecation,
rewriteBasePathDeprecation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ export const CleanClientModulesOnDLLTask = {
];
const discoveredLegacyCorePluginEntries = await globby([
`${baseDir}/src/legacy/core_plugins/*/index.js`,
// Small exception to load dynamically discovered functions for timelion plugin
`${baseDir}/src/legacy/core_plugins/timelion/server/*_functions/**/*.js`,
`!${baseDir}/src/legacy/core_plugins/**/public`,
]);
const discoveredPluginEntries = await globby([
`${baseDir}/src/plugins/*/server/index.js`,
// Small exception to load dynamically discovered functions for timelion plugin
`${baseDir}/src/plugins/vis_type_timelion/server/*_functions/**/*.js`,
`!${baseDir}/src/plugins/**/public`,
]);
const discoveredNewPlatformXpackPlugins = await globby([
Expand Down
5 changes: 0 additions & 5 deletions src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ export const TEMPORARILY_IGNORED_PATHS = [
'src/legacy/core_plugins/tile_map/public/__tests__/scaledCircleMarkers.png',
'src/legacy/core_plugins/tile_map/public/__tests__/shadedCircleMarkers.png',
'src/legacy/core_plugins/tile_map/public/__tests__/shadedGeohashGrid.png',
'src/legacy/core_plugins/timelion/server/lib/asSorted.js',
'src/legacy/core_plugins/timelion/server/lib/unzipPairs.js',
'src/legacy/core_plugins/timelion/server/series_functions/__tests__/fixtures/bucketList.js',
'src/legacy/core_plugins/timelion/server/series_functions/__tests__/fixtures/seriesList.js',
'src/legacy/core_plugins/timelion/server/series_functions/__tests__/fixtures/tlConfig.js',
'src/fixtures/config_upgrade_from_4.0.0_to_4.0.1-snapshot.json',
'src/legacy/core_plugins/vis_type_vislib/public/vislib/__tests__/lib/fixtures/mock_data/terms/_seriesMultiple.js',
'src/core/server/core_app/assets/favicons/android-chrome-192x192.png',
Expand Down
3 changes: 3 additions & 0 deletions src/legacy/core_plugins/kibana/public/discover/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ export class DiscoverPlugin implements Plugin<void, void> {
await this.initializeServices();
await this.initializeInnerAngular();

// make sure the index pattern list is up to date
const [, { data: dataStart }] = await core.getStartServices();
await dataStart.indexPatterns.clearCache();
const { renderApp } = await import('./np_ready/application');
const unmount = await renderApp(innerAngularName, params.element);
return () => {
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/vis_type_vislib/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ export class VisTypeVislibPlugin implements Plugin<void, void> {

public start(core: CoreStart, { data }: VisTypeVislibPluginStartDependencies) {
setFormatService(data.fieldFormats);
setDataActions({ createFiltersFromEvent: data.actions.createFiltersFromEvent });
setDataActions(data.actions);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ jest.mock('../../../legacy_imports', () => ({
}));

jest.mock('../../../services', () => ({
getDataActions: () => ({ createFiltersFromEvent: jest.fn().mockResolvedValue(['yes']) }),
getDataActions: () => ({
createFiltersFromValueClickAction: jest.fn().mockResolvedValue(['yes']),
}),
}));

const vis = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class VisLegend extends PureComponent<VisLegendProps, VisLegendState> {
return false;
}

const filters = await getDataActions().createFiltersFromEvent(item.values);
const filters = await getDataActions().createFiltersFromValueClickAction({ data: item.values });
return Boolean(filters.length);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,21 @@ export class Handler {

// memoize so that the same function is returned every time,
// allowing us to remove/re-add the same function
this.getProxyHandler = _.memoize(function(event) {
this.getProxyHandler = _.memoize(function(eventType) {
const self = this;
return function(e) {
self.vis.emit(event, e);
return function(eventPayload) {
switch (eventType) {
case 'brush':
const xRaw = _.get(eventPayload.data, 'series[0].values[0].xRaw');
if (!xRaw) return; // not sure if this is possible?
return self.vis.emit(eventType, {
table: xRaw.table,
range: eventPayload.range,
column: xRaw.column,
});
case 'click':
return self.vis.emit(eventType, eventPayload);
}
};
});

Expand Down
3 changes: 2 additions & 1 deletion src/legacy/ui/public/new_platform/new_platform.karma_mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ export const npStart = {
},
data: {
actions: {
createFiltersFromEvent: Promise.resolve(['yes']),
createFiltersFromValueClickAction: Promise.resolve(['yes']),
createFiltersFromRangeSelectAction: sinon.fake(),
},
autocomplete: {
getProvider: sinon.fake(),
Expand Down
16 changes: 1 addition & 15 deletions src/plugins/dashboard/public/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ import { EmbeddableStart } from '../../../embeddable/public';
import { NavigationPublicPluginStart as NavigationStart } from '../../../navigation/public';
import { DataPublicPluginStart } from '../../../data/public';
import { SharePluginStart } from '../../../share/public';
import {
KibanaLegacyStart,
configureAppAngularModule,
createTopNavDirective,
createTopNavHelper,
} from '../../../kibana_legacy/public';
import { KibanaLegacyStart, configureAppAngularModule } from '../../../kibana_legacy/public';
import { SavedObjectLoader } from '../../../saved_objects/public';

export interface RenderDeps {
Expand Down Expand Up @@ -114,13 +109,11 @@ function mountDashboardApp(appBasePath: string, element: HTMLElement) {

function createLocalAngularModule(core: AppMountContext['core'], navigation: NavigationStart) {
createLocalI18nModule();
createLocalTopNavModule(navigation);
createLocalIconModule();

const dashboardAngularModule = angular.module(moduleName, [
...thirdPartyAngularDependencies,
'app/dashboard/I18n',
'app/dashboard/TopNav',
'app/dashboard/icon',
]);
return dashboardAngularModule;
Expand All @@ -132,13 +125,6 @@ function createLocalIconModule() {
.directive('icon', reactDirective => reactDirective(EuiIcon));
}

function createLocalTopNavModule(navigation: NavigationStart) {
angular
.module('app/dashboard/TopNav', ['react'])
.directive('kbnTopNav', createTopNavDirective)
.directive('kbnTopNavHelper', createTopNavHelper(navigation.ui));
}

function createLocalI18nModule() {
angular
.module('app/dashboard/I18n', [])
Expand Down
47 changes: 1 addition & 46 deletions src/plugins/dashboard/public/application/dashboard_app.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,7 @@
class="app-container dshAppContainer"
ng-class="{'dshAppContainer--withMargins': model.useMargins}"
>
<!-- Local nav. -->
<kbn-top-nav
ng-show="isVisible"
app-name="'dashboard'"
config="topNavMenu"

show-search-bar="isVisible"
show-filter-bar="showFilterBar()"
show-save-query="showSaveQuery"

query="model.query"
saved-query="savedQuery"
screen-title="screenTitle"
on-query-submit="updateQueryAndFetch"
index-patterns="indexPatterns"
filters="model.filters"
on-filters-updated="onFiltersUpdated"
date-range-from="model.timeRange.from"
date-range-to="model.timeRange.to"
is-refresh-paused="model.refreshInterval.pause"
refresh-interval="model.refreshInterval.value"
on-saved="onQuerySaved"
on-saved-query-updated="onSavedQueryUpdated"
on-clear-saved-query="onClearSavedQuery"
on-refresh-change="onRefreshChange">
</kbn-top-nav>

<!--
The top nav is hidden in embed mode but the filter bar must still be present so
we show the filter bar on its own here if the chrome is not visible.
-->
<kbn-top-nav
ng-if="showFilterBar() && !isVisible"

app-name="'dashboard'"
show-search-bar="true"
show-filter-bar="true"
show-save-query="false"
show-date-picker="false"

filters="model.filters"
index-patterns="indexPatterns"
on-filters-updated="onFiltersUpdated"
>
</kbn-top-nav>

<div id="dashboardChrome"></div>
<h1 class="euiScreenReaderOnly">{{screenTitle}}</h1>
<div id="dashboardViewport"></div>

Expand Down
15 changes: 0 additions & 15 deletions src/plugins/dashboard/public/application/dashboard_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import { SavedObjectDashboard } from '../saved_dashboards';
export interface DashboardAppScope extends ng.IScope {
dash: SavedObjectDashboard;
appState: DashboardAppState;
screenTitle: string;
model: {
query: Query;
filters: Filter[];
Expand All @@ -54,21 +53,7 @@ export interface DashboardAppScope extends ng.IScope {
getShouldShowEditHelp: () => boolean;
getShouldShowViewHelp: () => boolean;
updateQueryAndFetch: ({ query, dateRange }: { query: Query; dateRange?: TimeRange }) => void;
onRefreshChange: ({
isPaused,
refreshInterval,
}: {
isPaused: boolean;
refreshInterval: any;
}) => void;
onFiltersUpdated: (filters: Filter[]) => void;
onCancelApplyFilters: () => void;
onApplyFilters: (filters: Filter[]) => void;
onQuerySaved: (savedQuery: SavedQuery) => void;
onSavedQueryUpdated: (savedQuery: SavedQuery) => void;
onClearSavedQuery: () => void;
topNavMenu: any;
showFilterBar: () => boolean;
showAddPanel: any;
showSaveQuery: boolean;
kbnTopNav: any;
Expand Down
Loading

0 comments on commit 26a304d

Please sign in to comment.