Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into kbn-105272-unknow…
Browse files Browse the repository at this point in the history
…n-types-deprecation-warning
  • Loading branch information
pgayvallet committed Sep 7, 2021
2 parents 3f49db4 + 5bc6239 commit 83c1bf9
Show file tree
Hide file tree
Showing 210 changed files with 3,345 additions and 895 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ readonly links: {
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
};
readonly canvas: {
readonly guide: string;
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
"react-moment-proptypes": "^1.7.0",
"react-monaco-editor": "^0.41.2",
"react-popper-tooltip": "^2.10.1",
"react-query": "^3.21.0",
"react-query": "^3.21.1",
"react-redux": "^7.2.0",
"react-resizable": "^1.7.5",
"react-resize-detector": "^4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pageLoadAssetSize:
expressionImage: 19288
expressionMetric: 22238
expressionShape: 34008
interactiveSetup: 70000
interactiveSetup: 80000
expressionTagcloud: 27505
expressions: 239290
securitySolution: 231753
7 changes: 7 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class DocLinksService {
const KIBANA_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/`;
const FLEET_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/fleet/${DOC_LINK_VERSION}/`;
const PLUGIN_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/plugins/${DOC_LINK_VERSION}/`;
const APM_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/apm/`;

return deepFreeze({
DOC_LINK_VERSION,
Expand All @@ -33,6 +34,9 @@ export class DocLinksService {
apm: {
kibanaSettings: `${KIBANA_DOCS}apm-settings-in-kibana.html`,
supportedServiceMaps: `${KIBANA_DOCS}service-maps.html#service-maps-supported`,
droppedTransactionSpans: `${APM_DOCS}get-started/${DOC_LINK_VERSION}/transaction-spans.html#dropped-spans`,
upgrading: `${APM_DOCS}server/${DOC_LINK_VERSION}/upgrading.html`,
metaData: `${APM_DOCS}get-started/${DOC_LINK_VERSION}/metadata.html`,
},
canvas: {
guide: `${KIBANA_DOCS}canvas.html`,
Expand Down Expand Up @@ -458,6 +462,9 @@ export interface DocLinksStart {
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
};
readonly canvas: {
readonly guide: string;
Expand Down
3 changes: 3 additions & 0 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,9 @@ export interface DocLinksStart {
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
};
readonly canvas: {
readonly guide: string;
Expand Down
1 change: 1 addition & 0 deletions src/dev/storybook/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const storybookAliases = {
expression_repeat_image: 'src/plugins/expression_repeat_image/.storybook',
expression_reveal_image: 'src/plugins/expression_reveal_image/.storybook',
expression_shape: 'src/plugins/expression_shape/.storybook',
expression_tagcloud: 'src/plugins/chart_expressions/expression_tagcloud/.storybook',
infra: 'x-pack/plugins/infra/.storybook',
security_solution: 'x-pack/plugins/security_solution/.storybook',
ui_actions_enhanced: 'x-pack/plugins/ui_actions_enhanced/.storybook',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { defaultConfig } from '@kbn/storybook';
import webpackMerge from 'webpack-merge';
import { resolve } from 'path';

const mockConfig = {
resolve: {
alias: {
'../format_service': resolve(__dirname, '../public/__mocks__/format_service.ts'),
},
},
};

module.exports = {
...defaultConfig,
webpackFinal: (config) => webpackMerge(config, mockConfig),
};

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 @@ -9,27 +9,76 @@
import { tagcloudFunction } from './tagcloud_function';

import { functionWrapper } from '../../../../expressions/common/expression_functions/specs/tests/utils';
import { ExpressionValueVisDimension } from '../../../../visualizations/public';
import { Datatable } from '../../../../expressions/common/expression_types/specs';

describe('interpreter/functions#tagcloud', () => {
const fn = functionWrapper(tagcloudFunction());
const column1 = 'Count';
const column2 = 'country';
const context = {
type: 'datatable',
rows: [{ 'col-0-1': 0 }],
columns: [{ id: 'col-0-1', name: 'Count' }],
columns: [
{ id: column1, name: column1 },
{ id: column2, name: column2 },
],
rows: [
{ [column1]: 0, [column2]: 'US' },
{ [column1]: 10, [column2]: 'UK' },
],
};
const visConfig = {
scale: 'linear',
orientation: 'single',
minFontSize: 18,
maxFontSize: 72,
showLabel: true,
metric: { accessor: 0, format: { id: 'number' } },
bucket: { accessor: 1, format: { id: 'number' } },
};

it('returns an object with the correct structure', () => {
const actual = fn(context, visConfig, undefined);
const numberAccessors = {
metric: { accessor: 0 },
bucket: { accessor: 1 },
};

const stringAccessors: {
metric: ExpressionValueVisDimension;
bucket: ExpressionValueVisDimension;
} = {
metric: {
type: 'vis_dimension',
accessor: {
id: column1,
name: column1,
meta: {
type: 'number',
},
},
format: {
params: {},
},
},
bucket: {
type: 'vis_dimension',
accessor: {
id: column2,
name: column2,
meta: {
type: 'string',
},
},
format: {
params: {},
},
},
};

it('returns an object with the correct structure for number accessors', () => {
const actual = fn(context, { ...visConfig, ...numberAccessors }, undefined);
expect(actual).toMatchSnapshot();
});

it('returns an object with the correct structure for string accessors', () => {
const actual = fn(context, { ...visConfig, ...stringAccessors }, undefined);
expect(actual).toMatchSnapshot();
});

Expand All @@ -44,7 +93,7 @@ describe('interpreter/functions#tagcloud', () => {
},
},
};
await fn(context, visConfig, handlers as any);
await fn(context, { ...visConfig, ...numberAccessors }, handlers as any);

expect(loggedTable!).toMatchSnapshot();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { i18n } from '@kbn/i18n';

import { prepareLogTable, Dimension } from '../../../../visualizations/common/prepare_log_table';
import { TagCloudVisParams } from '../types';
import { TagCloudRendererParams } from '../types';
import { ExpressionTagcloudFunction } from '../types';
import { EXPRESSION_NAME } from '../constants';

Expand Down Expand Up @@ -125,7 +125,7 @@ export const tagcloudFunction: ExpressionTagcloudFunction = () => {
},
},
fn(input, args, handlers) {
const visParams = {
const visParams: TagCloudRendererParams = {
scale: args.scale,
orientation: args.orientation,
minFontSize: args.minFontSize,
Expand All @@ -139,7 +139,7 @@ export const tagcloudFunction: ExpressionTagcloudFunction = () => {
type: 'palette',
name: args.palette,
},
} as TagCloudVisParams;
};

if (handlers?.inspectorAdapters?.tables) {
const argsTable: Dimension[] = [[[args.metric], dimension.tagSize]];
Expand Down
Loading

0 comments on commit 83c1bf9

Please sign in to comment.