Skip to content

Commit

Permalink
Merge branch 'master' into siem-optimize-tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Mar 25, 2020
2 parents 57a538e + a16968d commit 55dedae
Show file tree
Hide file tree
Showing 46 changed files with 542 additions and 280 deletions.
2 changes: 1 addition & 1 deletion src/plugins/data/public/search/search_interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class SearchInterceptor {
}),
},
{
toastLifeTimeMs: Infinity,
toastLifeTimeMs: 1000000,
}
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export function getTelemetryAllowChangingOptInStatus({
return configTelemetryAllowChangingOptInStatus;
}

if (typeof telemetrySavedObject.telemetryAllowChangingOptInStatus === 'undefined') {
if (typeof telemetrySavedObject.allowChangingOptInStatus === 'undefined') {
return configTelemetryAllowChangingOptInStatus;
}

return telemetrySavedObject.telemetryAllowChangingOptInStatus;
return telemetrySavedObject.allowChangingOptInStatus;
}
2 changes: 1 addition & 1 deletion src/plugins/telemetry/common/telemetry_config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface TelemetrySavedObjectAttributes {
lastVersionChecked?: string;
sendUsageFrom?: 'browser' | 'server';
lastReported?: number;
telemetryAllowChangingOptInStatus?: boolean;
allowChangingOptInStatus?: boolean;
userHasSeenNotice?: boolean;
reportFailureCount?: number;
reportFailureVersion?: string;
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/telemetry/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ export class TelemetryPlugin implements Plugin {
reportFailureVersion: {
type: 'keyword',
},
allowChangingOptInStatus: {
type: 'boolean',
},
},
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class ExportApp extends React.PureComponent {
const { workpad, selectedPageId } = this.props;
const { pages, height, width } = workpad;
const activePage = pages.find(page => page.id === selectedPageId);
const pageElementCount = activePage.elements.length;

return (
<div className="canvasExport">
Expand All @@ -39,7 +40,7 @@ export class ExportApp extends React.PureComponent {
</div>
{Style.it(
workpad.css,
<div className="canvasExport__stageContent">
<div className="canvasExport__stageContent" data-shared-items-count={pageElementCount}>
<WorkpadPage
isSelected
key={activePage.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,15 @@ export class ElementShareContainer extends React.PureComponent {
};

render() {
const shouldTrackComplete = this.props.functionName !== 'embeddable';

// NOTE: the data-shared-item and data-render-complete attributes are used for reporting
// Embeddables should be setting data-shared-item and data-render-complete on themselves
// so we should not be tracking them here.
return (
<div
data-shared-item
data-render-complete={this.state.renderComplete}
data-shared-item={shouldTrackComplete ? this.state.renderComplete : undefined}
data-render-complete={shouldTrackComplete ? this.state.renderComplete : undefined}
className={this.props.className}
ref={ref => (this.sharedItemRef = ref)}
>
Expand Down
19 changes: 1 addition & 18 deletions x-pack/legacy/plugins/lens/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
import * as Joi from 'joi';
import { resolve } from 'path';
import { LegacyPluginInitializer } from 'src/legacy/types';
import mappings from './mappings.json';
import {
PLUGIN_ID,
getEditPath,
NOT_INTERNATIONALIZED_PRODUCT_NAME,
} from '../../../plugins/lens/common';
import { PLUGIN_ID, NOT_INTERNATIONALIZED_PRODUCT_NAME } from '../../../plugins/lens/common';

export const lens: LegacyPluginInitializer = kibana => {
return new kibana.Plugin({
Expand All @@ -32,18 +27,6 @@ export const lens: LegacyPluginInitializer = kibana => {
visualize: [`plugins/${PLUGIN_ID}/legacy`],
embeddableFactories: [`plugins/${PLUGIN_ID}/legacy`],
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
mappings,
savedObjectsManagement: {
lens: {
defaultSearchField: 'title',
isImportableAndExportable: true,
getTitle: (obj: { attributes: { title: string } }) => obj.attributes.title,
getInAppUrl: (obj: { id: string }) => ({
path: getEditPath(obj.id),
uiCapabilitiesPath: 'lens.show',
}),
},
},
},

config: () => {
Expand Down
35 changes: 0 additions & 35 deletions x-pack/legacy/plugins/lens/mappings.json

This file was deleted.

8 changes: 8 additions & 0 deletions x-pack/legacy/plugins/maps/common/descriptor_types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

// eslint-disable-next-line @kbn/eslint/no-restricted-paths
export * from '../../../../plugins/maps/common/descriptor_types';
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/maps/public/actions/map_actions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions */

import { LAYER_TYPE } from '../../common/constants';
import { DataMeta, MapFilters } from '../../common/data_request_descriptor_types';
import { DataMeta, MapFilters } from '../../common/descriptor_types';

export type SyncContext = {
startLoading(dataId: string, requestToken: symbol, meta: DataMeta): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
VectorStyleDescriptor,
SizeDynamicOptions,
DynamicStylePropertyOptions,
} from '../../common/style_property_descriptor_types';
} from '../../common/descriptor_types';

const ACTIVE_COUNT_DATA_ID = 'ACTIVE_COUNT_DATA_ID';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { AbstractVectorSource } from './vector_source';
import { IVectorSource } from './vector_source';
import { IndexPattern, SearchSource } from '../../../../../../../src/plugins/data/public';
import { VectorSourceRequestMeta } from '../../../common/data_request_descriptor_types';
import { VectorSourceRequestMeta } from '../../../common/descriptor_types';

export interface IESSource extends IVectorSource {
getId(): string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { FeatureCollection } from 'geojson';
import { AbstractSource, ISource } from './source';
import { IField } from '../fields/field';
import { ESSearchSourceResponseMeta } from '../../../common/data_request_descriptor_types';
import { ESSearchSourceResponseMeta } from '../../../common/descriptor_types';

export type GeoJsonFetchMeta = ESSearchSourceResponseMeta;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { EuiFormRow, EuiSwitch, EuiSwitchEvent } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FieldMetaPopover } from './field_meta_popover';
import { IDynamicStyleProperty } from '../../properties/dynamic_style_property';
import { FieldMetaOptions } from '../../../../../../common/style_property_descriptor_types';
import { FieldMetaOptions } from '../../../../../../common/descriptor_types';

type Props = {
styleProperty: IDynamicStyleProperty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { i18n } from '@kbn/i18n';
import { DEFAULT_SIGMA } from '../../vector_style_defaults';
import { FieldMetaPopover } from './field_meta_popover';
import { IDynamicStyleProperty } from '../../properties/dynamic_style_property';
import { FieldMetaOptions } from '../../../../../../common/style_property_descriptor_types';
import { FieldMetaOptions } from '../../../../../../common/descriptor_types';
import { VECTOR_STYLES } from '../../../../../../common/constants';

function getIsEnableToggleLabel(styleName: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
import { IStyleProperty } from './style_property';
import { FIELD_ORIGIN } from '../../../../../common/constants';
import {
FieldMetaOptions,
CategoryFieldMeta,
DynamicStylePropertyOptions,
} from '../../../../../common/style_property_descriptor_types';
FieldMetaOptions,
RangeFieldMeta,
} from '../../../../../common/descriptor_types';
import { IField } from '../../../fields/field';
import { CategoryFieldMeta, RangeFieldMeta } from '../../../../../common/descriptor_types';

export interface IDynamicStyleProperty extends IStyleProperty {
getOptions(): DynamicStylePropertyOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
import { ReactElement } from 'react';
// @ts-ignore
import { getVectorStyleLabel } from '../components/get_vector_style_label';
import {
FieldMetaOptions,
StylePropertyOptions,
} from '../../../../../common/style_property_descriptor_types';
import { FieldMetaOptions, StylePropertyOptions } from '../../../../../common/descriptor_types';
import { VECTOR_STYLES } from '../../../../../common/constants';

type LegendProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IStyleProperty } from './properties/style_property';
import { IDynamicStyleProperty } from './properties/dynamic_style_property';
import { IVectorLayer } from '../../vector_layer';
import { IVectorSource } from '../../sources/vector_source';
import { VectorStyleDescriptor } from '../../../../common/style_property_descriptor_types';
import { VectorStyleDescriptor } from '../../../../common/descriptor_types';

export interface IVectorStyle {
getAllStyleProperties(): IStyleProperty[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
DEFAULT_LINE_COLORS,
// @ts-ignore
} from '../color_utils';
import { VectorStylePropertiesDescriptor } from '../../../../common/style_property_descriptor_types';
import { VectorStylePropertiesDescriptor } from '../../../../common/descriptor_types';
// @ts-ignore
import { getUiSettings } from '../../../kibana_services';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import turf from 'turf';
import turfBooleanContains from '@turf/boolean-contains';
import { isRefreshOnlyQuery } from './is_refresh_only_query';
import { ISource } from '../sources/source';
import { DataMeta } from '../../../common/data_request_descriptor_types';
import { DataMeta } from '../../../common/descriptor_types';
import { DataRequest } from './data_request';

const SOURCE_UPDATE_REQUIRED = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* eslint-disable max-classes-per-file */

import _ from 'lodash';
import { DataRequestDescriptor, DataMeta } from '../../../common/data_request_descriptor_types';
import { DataRequestDescriptor, DataMeta } from '../../../common/descriptor_types';

export class DataRequest {
private readonly _descriptor: DataRequestDescriptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Query } from '../../../common/map_descriptor';
import { Query } from '../../../common/descriptor_types';

// Refresh only query is query where timestamps are different but query is the same.
// Triggered by clicking "Refresh" button in QueryBar
Expand Down
7 changes: 5 additions & 2 deletions x-pack/legacy/plugins/maps/public/layers/vector_layer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@

import { AbstractLayer } from './layer';
import { IVectorSource } from './sources/vector_source';
import { VectorLayerDescriptor } from '../../common/descriptor_types';
import { MapFilters, VectorSourceRequestMeta } from '../../common/data_request_descriptor_types';
import {
MapFilters,
VectorLayerDescriptor,
VectorSourceRequestMeta,
} from '../../common/descriptor_types';
import { ILayer } from './layer';
import { IJoin } from './joins/join';
import { IVectorStyle } from './styles/vector/vector_style';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class EnhancedSearchInterceptor extends SearchInterceptor {
}),
},
{
toastLifeTimeMs: Infinity,
toastLifeTimeMs: 1000000,
}
);
};
Expand Down
Loading

0 comments on commit 55dedae

Please sign in to comment.