Skip to content

Commit

Permalink
Merge with main and resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed Jul 25, 2022
2 parents 3f9b97c + 51816a0 commit 3a8abb3
Show file tree
Hide file tree
Showing 282 changed files with 4,916 additions and 5,917 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"@elastic/apm-rum": "^5.12.0",
"@elastic/apm-rum-react": "^1.4.2",
"@elastic/apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace",
"@elastic/charts": "46.13.0",
"@elastic/charts": "47.0.0",
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "npm:@elastic/[email protected]",
"@elastic/ems-client": "8.3.3",
Expand Down Expand Up @@ -525,7 +525,7 @@
"uuid": "3.3.2",
"vega": "^5.22.1",
"vega-interpreter": "^1.0.4",
"vega-lite": "^5.2.0",
"vega-lite": "^5.3.0",
"vega-schema-url-parser": "^2.2.0",
"vega-spec-injector": "^0.0.2",
"vega-tooltip": "^0.28.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const getSeriesIdentifier = ({
seriesSplitAccessors: Map<number | string, number | string>;
}): XYChartSeriesIdentifier => ({
specId: generateSeriesId({ layerId, xAccessor }, splitAccessors, yAccessor),
xAccessor: xAccessor ?? 'x',
yAccessor: yAccessor ?? 'a',
splitAccessors: seriesSplitAccessors,
seriesKeys: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,7 @@ describe('XYChart component', () => {
seriesKeys: [],
key: '',
specId: 'a',
xAccessor: '',
yAccessor: '',
splitAccessors: new Map(),
};
Expand Down
116 changes: 0 additions & 116 deletions src/plugins/telemetry/schema/oss_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -10118,122 +10118,6 @@
}
}
}
},
"vis_type_table": {
"properties": {
"total": {
"type": "long"
},
"total_split": {
"type": "long"
},
"split_columns": {
"properties": {
"total": {
"type": "long"
},
"enabled": {
"type": "long"
}
}
},
"split_rows": {
"properties": {
"total": {
"type": "long"
},
"enabled": {
"type": "long"
}
}
}
}
},
"vis_type_timeseries": {
"properties": {
"timeseries_use_last_value_mode_total": {
"type": "long",
"_meta": {
"description": "Number of TSVB visualizations using \"last value\" as a time range"
}
},
"timeseries_use_es_indices_total": {
"type": "long",
"_meta": {
"description": "Number of TSVB visualizations using elasticsearch indices"
}
},
"timeseries_table_use_aggregate_function": {
"type": "long",
"_meta": {
"description": "Number of TSVB table visualizations using aggregate function"
}
},
"timeseries_types": {
"properties": {
"table": {
"type": "long"
},
"gauge": {
"type": "long"
},
"markdown": {
"type": "long"
},
"top_n": {
"type": "long"
},
"timeseries": {
"type": "long"
},
"metric": {
"type": "long"
}
}
}
}
},
"vis_type_vega": {
"properties": {
"vega_lib_specs_total": {
"type": "long"
},
"vega_lite_lib_specs_total": {
"type": "long"
},
"vega_use_map_total": {
"type": "long"
}
}
},
"visualization_types": {
"properties": {
"DYNAMIC_KEY": {
"properties": {
"total": {
"type": "long"
},
"spaces_min": {
"type": "long"
},
"spaces_max": {
"type": "long"
},
"spaces_avg": {
"type": "long"
},
"saved_7_days_total": {
"type": "long"
},
"saved_30_days_total": {
"type": "long"
},
"saved_90_days_total": {
"type": "long"
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ import { HeatmapVisParams, HeatmapTypeProps } from '../../types';
const HeatmapOptionsLazy = lazy(() => import('./heatmap'));

export const getHeatmapOptions =
({ showElasticChartsOptions, palettes, trackUiMetric }: HeatmapTypeProps) =>
({ showElasticChartsOptions, palettes }: HeatmapTypeProps) =>
(props: VisEditorOptionsProps<HeatmapVisParams>) =>
(
<HeatmapOptionsLazy
{...props}
palettes={palettes}
showElasticChartsOptions={showElasticChartsOptions}
trackUiMetric={trackUiMetric}
/>
);
6 changes: 0 additions & 6 deletions src/plugins/vis_types/heatmap/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,10 @@ export class VisTypeHeatmapPlugin {
{ visualizations, charts, usageCollection }: VisTypeHeatmapSetupDependencies
) {
if (!core.uiSettings.get(LEGACY_HEATMAP_CHARTS_LIBRARY)) {
const trackUiMetric = usageCollection?.reportUiCounter.bind(
usageCollection,
'vis_type_heatmap'
);

visualizations.createBaseVisualization(
heatmapVisType({
showElasticChartsOptions: true,
palettes: charts.palettes,
trackUiMetric,
})
);
}
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/vis_types/heatmap/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { UiCounterMetricType } from '@kbn/analytics';
import type { Position } from '@elastic/charts';
import type { ChartsPluginSetup, Style, Labels, ColorSchemas } from '@kbn/charts-plugin/public';
import { Range } from '@kbn/expressions-plugin/public';
Expand All @@ -14,7 +13,6 @@ import { LegendSize } from '@kbn/visualizations-plugin/public';
export interface HeatmapTypeProps {
showElasticChartsOptions?: boolean;
palettes?: ChartsPluginSetup['palettes'];
trackUiMetric?: (metricType: UiCounterMetricType, eventName: string | string[]) => void;
}

export interface HeatmapVisParams {
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/vis_types/heatmap/public/vis_type/heatmap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { SplitTooltip } from './split_tooltip';
export const getHeatmapVisTypeDefinition = ({
showElasticChartsOptions = false,
palettes,
trackUiMetric,
}: HeatmapTypeProps): VisTypeDefinition<HeatmapVisParams> => ({
name: 'heatmap',
title: i18n.translate('visTypeHeatmap.heatmap.heatmapTitle', { defaultMessage: 'Heat map' }),
Expand Down Expand Up @@ -68,7 +67,6 @@ export const getHeatmapVisTypeDefinition = ({
optionsTemplate: getHeatmapOptions({
showElasticChartsOptions,
palettes,
trackUiMetric,
}),
schemas: [
{
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/vis_types/pie/public/editor/components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ import { PieTypeProps } from '../../types';
const PieOptionsLazy = lazy(() => import('./pie'));

export const getPieOptions =
({ showElasticChartsOptions, palettes, trackUiMetric }: PieTypeProps) =>
({ showElasticChartsOptions, palettes }: PieTypeProps) =>
(props: VisEditorOptionsProps<PartitionVisParams>) =>
(
<PieOptionsLazy
{...props}
palettes={palettes}
showElasticChartsOptions={showElasticChartsOptions}
trackUiMetric={trackUiMetric}
/>
);
13 changes: 0 additions & 13 deletions src/plugins/vis_types/pie/public/editor/components/pie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/

import React, { useState, useEffect, useCallback } from 'react';
import { METRIC_TYPE } from '@kbn/analytics';
import {
EuiPanel,
EuiTitle,
Expand Down Expand Up @@ -223,9 +222,6 @@ const PieOptions = (props: PieOptionsProps) => {
value={stateParams.nestedLegend}
disabled={stateParams.legendDisplay === LegendDisplay.HIDE}
setValue={(paramName, value) => {
if (props.trackUiMetric) {
props.trackUiMetric(METRIC_TYPE.CLICK, 'nested_legend_switched');
}
setValue(paramName, value);
}}
data-test-subj="visTypePieNestedLegendSwitch"
Expand Down Expand Up @@ -253,9 +249,6 @@ const PieOptions = (props: PieOptionsProps) => {
activePalette={stateParams.palette}
paramName="palette"
setPalette={(paramName, value) => {
if (props.trackUiMetric) {
props.trackUiMetric(METRIC_TYPE.CLICK, 'palette_selected');
}
setValue(paramName, value);
}}
/>
Expand Down Expand Up @@ -296,9 +289,6 @@ const PieOptions = (props: PieOptionsProps) => {
: stateParams.labels.position || LabelPositions.DEFAULT
}
setValue={(paramName, value) => {
if (props.trackUiMetric) {
props.trackUiMetric(METRIC_TYPE.CLICK, 'label_position_selected');
}
setLabels(paramName, value);
}}
data-test-subj="visTypePieLabelPositionSelect"
Expand Down Expand Up @@ -338,9 +328,6 @@ const PieOptions = (props: PieOptionsProps) => {
paramName="valuesFormat"
value={stateParams.labels.valuesFormat || ValueFormats.PERCENT}
setValue={(paramName, value) => {
if (props.trackUiMetric) {
props.trackUiMetric(METRIC_TYPE.CLICK, 'values_format_selected');
}
setLabels(paramName, value);
}}
data-test-subj="visTypePieValueFormatsSelect"
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/vis_types/pie/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@ export class VisTypePiePlugin {
{ visualizations, charts, usageCollection }: VisTypePieSetupDependencies
) {
if (!core.uiSettings.get(LEGACY_PIE_CHARTS_LIBRARY, false)) {
const trackUiMetric = usageCollection?.reportUiCounter.bind(usageCollection, 'vis_type_pie');
visualizations.createBaseVisualization(
pieVisType({
showElasticChartsOptions: true,
palettes: charts.palettes,
trackUiMetric,
})
);
}
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/vis_types/pie/public/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Side Public License, v 1.
*/

import { UiCounterMetricType } from '@kbn/analytics';
import { SerializedFieldFormat } from '@kbn/field-formats-plugin/common';
import { ChartsPluginSetup } from '@kbn/charts-plugin/public';

Expand All @@ -28,5 +27,4 @@ export interface Dimensions {
export interface PieTypeProps {
showElasticChartsOptions?: boolean;
palettes?: ChartsPluginSetup['palettes'];
trackUiMetric?: (metricType: UiCounterMetricType, eventName: string | string[]) => void;
}
2 changes: 0 additions & 2 deletions src/plugins/vis_types/pie/public/vis_type/pie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { getPieOptions } from '../editor/components';
export const getPieVisTypeDefinition = ({
showElasticChartsOptions = false,
palettes,
trackUiMetric,
}: PieTypeProps): VisTypeDefinition<PartitionVisParams> => ({
name: 'pie',
title: i18n.translate('visTypePie.pie.pieTitle', { defaultMessage: 'Pie' }),
Expand Down Expand Up @@ -68,7 +67,6 @@ export const getPieVisTypeDefinition = ({
optionsTemplate: getPieOptions({
showElasticChartsOptions,
palettes,
trackUiMetric,
}),
schemas: [
{
Expand Down
1 change: 0 additions & 1 deletion src/plugins/vis_types/table/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"share",
"visDefaultEditor"
],
"optionalPlugins": ["usageCollection"],
"owner": {
"name": "Vis Editors",
"githubTeam": "kibana-vis-editors"
Expand Down
11 changes: 2 additions & 9 deletions src/plugins/vis_types/table/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,14 @@
* Side Public License, v 1.
*/

import { CoreSetup, PluginConfigDescriptor } from '@kbn/core/server';
import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server';

import { PluginConfigDescriptor } from '@kbn/core/server';
import { configSchema, ConfigSchema } from '../config';
import { registerVisTypeTableUsageCollector } from './usage_collector';

export const config: PluginConfigDescriptor<ConfigSchema> = {
schema: configSchema,
};

export const plugin = () => ({
setup(core: CoreSetup, plugins: { usageCollection?: UsageCollectionSetup }) {
if (plugins.usageCollection) {
registerVisTypeTableUsageCollector(plugins.usageCollection);
}
},
setup() {},
start() {},
});
Loading

0 comments on commit 3a8abb3

Please sign in to comment.