Skip to content

Commit

Permalink
Merge branch 'master' into es-ui-ts-project
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed Jan 12, 2021
2 parents 4711fd2 + 1a9836b commit a9bb753
Show file tree
Hide file tree
Showing 139 changed files with 1,847 additions and 983 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
"dedent": "^0.7.0",
"deep-freeze-strict": "^1.1.1",
"del": "^5.1.0",
"elastic-apm-node": "^3.7.0",
"elastic-apm-node": "^3.10.0",
"elasticsearch": "^16.7.0",
"execa": "^4.0.2",
"exit-hook": "^2.2.0",
Expand Down Expand Up @@ -440,6 +440,7 @@
"@types/enzyme": "^3.10.5",
"@types/eslint": "^6.1.3",
"@types/extract-zip": "^1.6.2",
"@types/faker": "^5.1.5",
"@types/fancy-log": "^1.3.1",
"@types/fetch-mock": "^7.3.1",
"@types/file-saver": "^2.0.0",
Expand Down Expand Up @@ -647,7 +648,7 @@
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-perf": "^3.2.3",
"expose-loader": "^0.7.5",
"faker": "1.1.0",
"faker": "^5.1.0",
"fancy-log": "^1.3.2",
"fast-glob": "2.2.7",
"fetch-mock": "^7.3.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ describe('migration v2', () => {
await new Promise((resolve) => setTimeout(resolve, 10000));
};

describe('migrating from 7.3.0-xpack version', () => {
// FLAKY: https://github.com/elastic/kibana/issues/87968
describe.skip('migrating from 7.3.0-xpack version', () => {
const migratedIndex = `.kibana_${kibanaVersion}_001`;

beforeAll(async () => {
Expand Down
21 changes: 21 additions & 0 deletions src/plugins/advanced_settings/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"public/**/*",
"server/**/*"
],
"references": [
{ "path": "../../core/tsconfig.json" },
{ "path": "../management/tsconfig.json" },
{ "path": "../home/tsconfig.json" },
{ "path": "../usage_collection/tsconfig.json" },
{ "path": "../kibana_react/tsconfig.json" },
]
}
16 changes: 16 additions & 0 deletions src/plugins/charts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": ["common/**/*", "public/**/*", "server/**/*"],
"references": [
{ "path": "../../core/tsconfig.json" },
{ "path": "../expressions/tsconfig.json" },
{ "path": "../embeddable/tsconfig.json" }
]
}
2 changes: 2 additions & 0 deletions src/plugins/dashboard/.storybook/storyshots.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'moment-timezone';
import ReactDOM from 'react-dom';

import initStoryshots, { multiSnapshotWithOptions } from '@storybook/addon-storyshots';
// @ts-ignore
import styleSheetSerializer from 'jest-styled-components/src/styleSheetSerializer';
import { addSerializer } from 'jest-specific-snapshot';

Expand Down Expand Up @@ -52,6 +53,7 @@ jest.mock('@elastic/eui/lib/components/overlay_mask/overlay_mask', () => {
};
});

// @ts-ignore
import { EuiObserver } from '@elastic/eui/test-env/components/observer/observer';
jest.mock('@elastic/eui/test-env/components/observer/observer');
EuiObserver.mockImplementation(() => 'EuiObserver');
Expand Down
17 changes: 12 additions & 5 deletions src/plugins/dashboard/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,21 @@
"embeddable",
"inspector",
"kibanaLegacy",
"urlForwarding",
"navigation",
"uiActions",
"savedObjects",
"share"
"share",
"uiActions",
"urlForwarding"
],
"optionalPlugins": ["home", "usageCollection", "savedObjectsTaggingOss"],
"optionalPlugins": [
"home",
"savedObjectsTaggingOss",
"usageCollection"],
"server": true,
"ui": true,
"requiredBundles": ["kibanaUtils", "kibanaReact", "home"]
"requiredBundles": [
"home",
"kibanaReact",
"kibanaUtils"
]
}
34 changes: 34 additions & 0 deletions src/plugins/dashboard/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"*.ts",
".storybook/**/*",
"common/**/*",
"public/**/*",
"server/**/*",
],
"references": [
{ "path": "../../core/tsconfig.json" },
{ "path": "../inspector/tsconfig.json" },
{ "path": "../kibana_legacy/tsconfig.json" },
{ "path": "../kibana_react/tsconfig.json" },
{ "path": "../kibana_utils/tsconfig.json" },
{ "path": "../share/tsconfig.json" },
{ "path": "../url_forwarding/tsconfig.json" },
{ "path": "../usage_collection/tsconfig.json" },
{ "path": "../data/tsconfig.json"},
{ "path": "../embeddable/tsconfig.json" },
{ "path": "../home/tsconfig.json" },
{ "path": "../navigation/tsconfig.json" },
{ "path": "../saved_objects_tagging_oss/tsconfig.json" },
{ "path": "../saved_objects/tsconfig.json" },
{ "path": "../ui_actions/tsconfig.json" },
]
}
28 changes: 28 additions & 0 deletions src/plugins/discover/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": ["common/**/*", "public/**/*", "server/**/*", "../../../typings/**/*"],
"references": [
{ "path": "../../core/tsconfig.json" },
{ "path": "../charts/tsconfig.json" },
{ "path": "../data/tsconfig.json" },
{ "path": "../embeddable/tsconfig.json" },
{ "path": "../inspector/tsconfig.json" },
{ "path": "../url_forwarding/tsconfig.json" },
{ "path": "../saved_objects/tsconfig.json" },
{ "path": "../navigation/tsconfig.json" },
{ "path": "../ui_actions/tsconfig.json" },
{ "path": "../home/tsconfig.json" },
{ "path": "../share/tsconfig.json" },
{ "path": "../usage_collection/tsconfig.json" },
{ "path": "../kibana_utils/tsconfig.json" },
{ "path": "../kibana_react/tsconfig.json" },
{ "path": "../kibana_legacy/tsconfig.json" }
]
}
2 changes: 1 addition & 1 deletion src/plugins/embeddable/README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ There is also an example of rendering dashboard container outside of dashboard a

=== Docs

(./docs/README.md)[Embeddable docs, guides & caveats]
link:./docs/README.md[Embeddable docs, guides & caveats]

=== API docs

Expand Down
11 changes: 9 additions & 2 deletions src/plugins/input_control_vis/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
"kibanaVersion": "kibana",
"server": true,
"ui": true,
"requiredPlugins": ["data", "expressions", "visualizations", "visDefaultEditor"],
"requiredBundles": ["kibanaReact"]
"requiredPlugins": [
"data",
"expressions",
"visDefaultEditor",
"visualizations"
],
"requiredBundles": [
"kibanaReact"
]
}
16 changes: 16 additions & 0 deletions src/plugins/presentation_util/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": ["common/**/*", "public/**/*"],
"references": [
{ "path": "../../core/tsconfig.json" },
{ "path": "../dashboard/tsconfig.json" },
{ "path": "../saved_objects/tsconfig.json" },
]
}
12 changes: 10 additions & 2 deletions src/plugins/vis_type_markdown/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"version": "kibana",
"ui": true,
"server": true,
"requiredPlugins": ["expressions", "visualizations"],
"requiredBundles": ["kibanaReact", "visualizations", "expressions", "visDefaultEditor"]
"requiredPlugins": [
"expressions",
"visualizations"
],
"requiredBundles": [
"expressions",
"kibanaReact",
"visDefaultEditor",
"visualizations"
]
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
*/

import { isBasicAgg } from './agg_lookup';
import { MetricsItemsSchema } from './types';

describe('aggLookup', () => {
describe('isBasicAgg(metric)', () => {
test('returns true for a basic metric (count)', () => {
expect(isBasicAgg({ type: 'count' })).toEqual(true);
expect(isBasicAgg({ type: 'count' } as MetricsItemsSchema)).toEqual(true);
});
test('returns false for a pipeline metric (derivative)', () => {
expect(isBasicAgg({ type: 'derivative' })).toEqual(false);
expect(isBasicAgg({ type: 'derivative' } as MetricsItemsSchema)).toEqual(false);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
* under the License.
*/

import _ from 'lodash';
import { omit, pick, includes } from 'lodash';
import { i18n } from '@kbn/i18n';
import { MetricsItemsSchema } from './types';

export const lookup = {
export const lookup: Record<string, string> = {
count: i18n.translate('visTypeTimeseries.aggLookup.countLabel', { defaultMessage: 'Count' }),
calculation: i18n.translate('visTypeTimeseries.aggLookup.calculationLabel', {
defaultMessage: 'Calculation',
Expand Down Expand Up @@ -122,11 +123,11 @@ const pipeline = [

const byType = {
_all: lookup,
pipeline: pipeline,
basic: _.omit(lookup, pipeline),
metrics: _.pick(lookup, ['count', 'avg', 'min', 'max', 'sum', 'cardinality', 'value_count']),
pipeline,
basic: omit(lookup, pipeline),
metrics: pick(lookup, ['count', 'avg', 'min', 'max', 'sum', 'cardinality', 'value_count']),
};

export function isBasicAgg(item) {
return _.includes(Object.keys(byType.basic), item.type);
export function isBasicAgg(item: MetricsItemsSchema) {
return includes(Object.keys(byType.basic), item.type);
}
Loading

0 comments on commit a9bb753

Please sign in to comment.