Skip to content

Commit

Permalink
Merge branch 'main' into sharedux/use-is_nested_eui_provider
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Apr 30, 2024
2 parents b9029dd + d4c6e07 commit 773e463
Show file tree
Hide file tree
Showing 165 changed files with 2,258 additions and 614 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ packages/kbn-apm-utils @elastic/obs-ux-infra_services-team
test/plugin_functional/plugins/app_link_test @elastic/kibana-core
x-pack/test/usage_collection/plugins/application_usage_test @elastic/kibana-core
x-pack/plugins/observability_solution/asset_manager @elastic/obs-knowledge-team
x-pack/plugins/observability_solution/assets_data_access @elastic/obs-knowledge-team
x-pack/test/security_api_integration/plugins/audit_log @elastic/kibana-security
packages/kbn-axe-config @elastic/kibana-qa
packages/kbn-babel-preset @elastic/kibana-operations
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ The plugin exposes the static DefaultEditorController class to consume.
|This plugin provides access to observed asset data, such as information about hosts, pods, containers, services, and more.
|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/assets_data_access[assetsDataAccess]
|WARNING: Missing README.
|{kib-repo}blob/{branch}/x-pack/plugins/banners/README.md[banners]
|Allow to add a header banner that will be displayed on every page of the Kibana application
Expand Down
2 changes: 1 addition & 1 deletion fleet_packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@
},
{
"name": "security_detection_engine",
"version": "8.13.4"
"version": "8.13.5"
}
]
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"@kbn/app-link-test-plugin": "link:test/plugin_functional/plugins/app_link_test",
"@kbn/application-usage-test-plugin": "link:x-pack/test/usage_collection/plugins/application_usage_test",
"@kbn/assetManager-plugin": "link:x-pack/plugins/observability_solution/asset_manager",
"@kbn/assets-data-access-plugin": "link:x-pack/plugins/observability_solution/assets_data_access",
"@kbn/audit-log-plugin": "link:x-pack/test/security_api_integration/plugins/audit_log",
"@kbn/banners-plugin": "link:x-pack/plugins/banners",
"@kbn/bfetch-error": "link:packages/kbn-bfetch-error",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type {
import type { DataView } from '@kbn/data-views-plugin/public';
import type { SavedObjectReference } from '@kbn/core/server';
import { AxesSettingsConfig } from '@kbn/visualizations-plugin/common';
import type { LegendStats } from '@kbn/visualizations-plugin/common/constants';
import type { XYLegendValue } from '@kbn/visualizations-plugin/common/constants';
import type { Chart, ChartConfig, ChartLayer } from '../types';
import { DEFAULT_LAYER_ID } from '../utils';
import { XY_ID } from './constants';
Expand Down Expand Up @@ -131,7 +131,7 @@ export const getXYVisualizationState = (
isVisible: false,
position: 'right',
showSingleSeries: false,
legendStats: ['values' as LegendStats.values],
legendStats: ['currentAndLastValue' as XYLegendValue.CurrentAndLastValue],
},
valueLabels: 'show',
yLeftScale: 'linear',
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/bfetch/server/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export function getUiSettings(): Record<string, UiSettingsParams<unknown>> {
}),
schema: schema.boolean(),
category: [],
requiresPageReload: true,
},
[DISABLE_BFETCH_COMPRESSION]: {
name: i18n.translate('bfetch.disableBfetchCompression', {
Expand All @@ -36,6 +37,7 @@ export function getUiSettings(): Record<string, UiSettingsParams<unknown>> {
}),
schema: schema.boolean(),
category: [],
requiresPageReload: true,
},
};
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import {
ValueFormats,
LegendDisplay,
} from '../types/expression_renderers';
import { ExpressionValueVisDimension, LegendStats } from '@kbn/visualizations-plugin/common';
import {
ExpressionValueVisDimension,
PartitionLegendValue,
} from '@kbn/visualizations-plugin/common';
import { Datatable } from '@kbn/expressions-plugin/common/expression_types/specs';
import { waffleVisFunction } from './waffle_vis_function';
import { PARTITION_LABELS_VALUE, PARTITION_VIS_RENDERER_NAME } from '../constants';
Expand All @@ -34,7 +37,7 @@ describe('interpreter/functions#waffleVis', () => {

const visConfig: WaffleVisConfig = {
addTooltip: true,
legendStats: [LegendStats.values],
legendStats: [PartitionLegendValue.Value],
metricsToLabels: JSON.stringify({}),
legendDisplay: LegendDisplay.SHOW,
legendPosition: 'right',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import type { AllowedChartOverrides, AllowedSettingsOverrides } from '@kbn/chart
import type { PaletteOutput } from '@kbn/coloring';
import type { Datatable, DatatableColumn } from '@kbn/expressions-plugin/common';
import type { SerializedFieldFormat } from '@kbn/field-formats-plugin/common';
import type { ExpressionValueVisDimension, LegendStats } from '@kbn/visualizations-plugin/common';
import type {
ExpressionValueVisDimension,
PartitionLegendValue,
} from '@kbn/visualizations-plugin/common';
import type { LegendSize } from '@kbn/visualizations-plugin/public';
import {
type AllowedPartitionOverrides,
Expand Down Expand Up @@ -80,7 +83,7 @@ export interface PartitionVisParams extends VisCommonParams {
labels: LabelsParams;
palette: PaletteOutput;
isDonut?: boolean;
legendStats?: LegendStats[];
legendStats?: PartitionLegendValue[];
respectSourceOrder?: boolean;
emptySizeRatio?: EmptySizeRatios;
startFromSecondLargestSlice?: boolean;
Expand Down Expand Up @@ -110,7 +113,7 @@ export interface MosaicVisConfig

export interface WaffleVisConfig extends Omit<VisCommonConfig, 'buckets'> {
bucket?: ExpressionValueVisDimension | string;
legendStats?: LegendStats[];
legendStats?: PartitionLegendValue[];
}

export interface PartitionChartProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { Position } from '@elastic/charts';
import { ArgTypes } from '@storybook/addons';
import { LegendStats } from '@kbn/visualizations-plugin/common/constants';
import { PartitionLegendValue } from '@kbn/visualizations-plugin/common/constants';
import { EmptySizeRatios, LegendDisplay } from '../../../common';
import { ChartTypes } from '../../../common/types';

Expand Down Expand Up @@ -212,7 +212,7 @@ export const waffleArgTypes: ArgTypes = {
description: 'Legend stats',
type: { name: 'string', required: false },
table: { type: { summary: 'string' }, defaultValue: { summary: undefined } },
options: [LegendStats.values],
options: [PartitionLegendValue.Value],
control: { type: 'select' },
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
} from '@kbn/expressions-plugin/public';
import type { FieldFormat } from '@kbn/field-formats-plugin/common';
import { getOverridesFor } from '@kbn/chart-expressions-common';
import { LegendStats } from '@kbn/visualizations-plugin/common/constants';
import { PartitionLegendValue } from '@kbn/visualizations-plugin/common/constants';
import { consolidateMetricColumns } from '../../common/utils';
import { DEFAULT_PERCENT_DECIMALS } from '../../common/constants';
import {
Expand Down Expand Up @@ -564,7 +564,7 @@ const PartitionVisComponent = (props: PartitionVisComponentProps) => {
legendColorPicker={props.uiState ? LegendColorPickerWrapper : undefined}
flatLegend={flatLegend}
legendSort={customLegendSort}
showLegendExtra={visParams.legendStats?.[0] === LegendStats.values}
showLegendExtra={visParams.legendStats?.[0] === PartitionLegendValue.Value}
onElementClick={([elementEvent]) => {
// this cast is safe because we are rendering a partition chart
const [layerValues] = elementEvent as PartitionElementEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { Datatable } from '@kbn/expressions-plugin/public';
import { LegendStats } from '@kbn/visualizations-plugin/common/constants';
import { PartitionLegendValue } from '@kbn/visualizations-plugin/common/constants';
import {
BucketColumns,
PartitionVisParams,
Expand Down Expand Up @@ -382,6 +382,6 @@ export const createMockWaffleParams = (): PartitionVisParams => {
},
],
},
legendStats: [LegendStats.values],
legendStats: [PartitionLegendValue.Value],
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
DatatableColumnMeta,
ExpressionFunctionDefinition,
} from '@kbn/expressions-plugin/common';
import { LegendSize, LegendStats } from '@kbn/visualizations-plugin/common';
import { LegendSize, XYLegendValue } from '@kbn/visualizations-plugin/common';
import { EventAnnotationOutput } from '@kbn/event-annotation-plugin/common';
import { ExpressionValueVisDimension } from '@kbn/visualizations-plugin/common';

Expand Down Expand Up @@ -217,7 +217,7 @@ export interface LegendConfig {
/**
* metrics to display in the legend
*/
legendStats?: LegendStats[];
legendStats?: XYLegendValue[];
}

// Arguments to XY chart expression, with computed properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import { XYChart, XYChartRenderProps } from './xy_chart';
import { ExtendedDataLayerConfig, XYProps, AnnotationLayerConfigResult } from '../../common/types';
import { DataLayers } from './data_layers';
import { SplitChart } from './split_chart';
import { LegendSize, LegendStats } from '@kbn/visualizations-plugin/common';
import { LegendSize, XYLegendValue } from '@kbn/visualizations-plugin/common';
import type { LayerCellValueActions } from '../types';

const onClickValue = jest.fn();
Expand Down Expand Up @@ -742,7 +742,10 @@ describe('XYChart component', () => {
const component = shallow(
<XYChart
{...defaultProps}
args={{ ...args, legend: { ...args.legend, legendStats: [LegendStats.values] } }}
args={{
...args,
legend: { ...args.legend, legendStats: [XYLegendValue.CurrentAndLastValue] },
}}
/>
);
expect(component.find(Settings).at(0).prop('showLegendExtra')).toEqual(false);
Expand All @@ -757,7 +760,7 @@ describe('XYChart component', () => {
...args,
legend: {
...args.legend,
legendStats: [LegendStats.values],
legendStats: [XYLegendValue.CurrentAndLastValue],
},
layers: [dateHistogramLayer],
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import {
import {
DEFAULT_LEGEND_SIZE,
LegendSizeToPixels,
LegendStats,
XYLegendValue,
} from '@kbn/visualizations-plugin/common/constants';
import { PersistedState } from '@kbn/visualizations-plugin/public';
import { getOverridesFor, ChartSizeSpec } from '@kbn/chart-expressions-common';
Expand Down Expand Up @@ -869,7 +869,9 @@ export function XYChart({
)
: undefined
}
showLegendExtra={isHistogramViz && legend.legendStats?.[0] === LegendStats.values}
showLegendExtra={
isHistogramViz && legend.legendStats?.[0] === XYLegendValue.CurrentAndLastValue
}
ariaLabel={args.ariaLabel}
ariaUseDefaultSummary={!args.ariaLabel}
orderOrdinalBinsBy={
Expand Down
5 changes: 5 additions & 0 deletions src/plugins/data/server/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ export function getUiSettings(
defaultMessage: 'Whether the filters should have a global state (be pinned) by default',
}),
schema: schema.boolean(),
requiresPageReload: true,
},
[UI_SETTINGS.FILTERS_EDITOR_SUGGEST_VALUES]: {
name: i18n.translate('data.advancedSettings.suggestFilterValuesTitle', {
Expand All @@ -510,6 +511,7 @@ export function getUiSettings(
'Set this property to false to prevent the filter editor from suggesting values for fields.',
}),
schema: schema.boolean(),
requiresPageReload: true,
},
[UI_SETTINGS.AUTOCOMPLETE_VALUE_SUGGESTION_METHOD]: {
name: i18n.translate('data.advancedSettings.autocompleteValueSuggestionMethod', {
Expand All @@ -535,6 +537,7 @@ export function getUiSettings(
options: ['terms_enum', 'terms_agg'],
category: ['autocomplete'],
schema: schema.string(),
requiresPageReload: true,
},
[UI_SETTINGS.AUTOCOMPLETE_USE_TIMERANGE]: {
name: i18n.translate('data.advancedSettings.autocompleteIgnoreTimerange', {
Expand All @@ -556,6 +559,7 @@ export function getUiSettings(
}),
category: ['autocomplete'],
schema: schema.boolean(),
requiresPageReload: true,
},
[UI_SETTINGS.SEARCH_TIMEOUT]: {
name: i18n.translate('data.advancedSettings.searchTimeout', {
Expand All @@ -569,6 +573,7 @@ export function getUiSettings(
type: 'number',
category: ['search'],
schema: schema.number(),
requiresPageReload: true,
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { LegendStats } from '@kbn/visualizations-plugin/common/constants';
import { PartitionLegendValue } from '@kbn/visualizations-plugin/common/constants';
import { getConfiguration } from '.';
import { samplePieVis } from '../../sample_vis.test.mocks';

Expand Down Expand Up @@ -39,7 +39,7 @@ describe('getConfiguration', () => {
percentDecimals: 2,
primaryGroups: ['bucket-1'],
secondaryGroups: [],
legendStats: [LegendStats.values],
legendStats: [PartitionLegendValue.Value],
truncateLegend: true,
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { LegendDisplay, PartitionVisParams } from '@kbn/expression-partition-vis-plugin/common';
import { LegendStats } from '@kbn/visualizations-plugin/common/constants';
import { PartitionLegendValue } from '@kbn/visualizations-plugin/common/constants';
import {
CategoryDisplayTypes,
NumberDisplayTypes,
Expand All @@ -28,7 +28,7 @@ const getLayers = (
const showValuesInLegend =
vis.params.labels.values ??
(vis.params.legendStats
? vis.params.legendStats?.[0] === LegendStats.values
? vis.params.legendStats?.[0] === PartitionLegendValue.Value
: vis.type.visConfig.defaults.showValuesInLegend);

return [
Expand All @@ -50,7 +50,7 @@ const getLayers = (
vis.params.legendDisplay ??
vis.type.visConfig.defaults.legendDisplay,
legendPosition: vis.params.legendPosition ?? vis.type.visConfig.defaults.legendPosition,
legendStats: showValuesInLegend ? [LegendStats.values] : undefined,
legendStats: showValuesInLegend ? [PartitionLegendValue.Value] : undefined,
nestedLegend: vis.params.nestedLegend ?? vis.type.visConfig.defaults.nestedLegend,
percentDecimals:
vis.params.labels.percentDecimals ?? vis.type.visConfig.defaults.labels.percentDecimals,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
XYReferenceLineLayerConfig,
} from '@kbn/visualizations-plugin/common/convert_to_lens';
import { Vis } from '@kbn/visualizations-plugin/public';
import { LegendStats } from '@kbn/visualizations-plugin/common/constants';
import { XYLegendValue } from '@kbn/visualizations-plugin/common/constants';
import { Layer } from '..';
import { ChartType } from '../../../common';
import {
Expand Down Expand Up @@ -237,7 +237,7 @@ export const getConfiguration = (
maxLines: vis.params.maxLegendLines ?? vis.type.visConfig.defaults.maxLegendLines,
showSingleSeries: true,
legendStats: Boolean(vis.params.labels.show ?? vis.type.visConfig.defaults.labels?.show)
? [LegendStats.values]
? [XYLegendValue.CurrentAndLastValue]
: undefined,
},
fittingFunction: fittingFunction
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/vis_types/xy/public/to_ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { buildExpression, buildExpressionFunction } from '@kbn/expressions-plugi
import { BUCKET_TYPES } from '@kbn/data-plugin/public';
import type { TimeRangeBounds } from '@kbn/data-plugin/common';
import type { PaletteOutput } from '@kbn/charts-plugin/common/expressions/palette/types';
import { LegendStats } from '@kbn/visualizations-plugin/common/constants';
import { XYLegendValue } from '@kbn/visualizations-plugin/common/constants';
import {
Dimensions,
Dimension,
Expand Down Expand Up @@ -48,7 +48,7 @@ const prepareLengend = (params: VisParams, legendSize?: LegendSize) => {
shouldTruncate: params.truncateLegend,
showSingleSeries: true,
legendSize,
legendStats: params.labels.show ? [LegendStats.values] : undefined,
legendStats: params.labels.show ? [XYLegendValue.CurrentAndLastValue] : undefined,
});

return buildExpression([legend]);
Expand Down
8 changes: 6 additions & 2 deletions src/plugins/visualizations/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export const SUPPORTED_AGGREGATIONS = [
...Object.values(BUCKET_TYPES),
] as const;

export enum LegendStats {
values = 'values',
export enum XYLegendValue {
CurrentAndLastValue = 'currentAndLastValue',
}

export enum PartitionLegendValue {
Value = 'value',
}

0 comments on commit 773e463

Please sign in to comment.