Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into move-kbn-ui-frame…
Browse files Browse the repository at this point in the history
…work-into-bazel
  • Loading branch information
mistic committed Jun 22, 2021
2 parents 3a47f18 + 1036a5b commit bd58a17
Show file tree
Hide file tree
Showing 286 changed files with 6,653 additions and 2,466 deletions.
1 change: 1 addition & 0 deletions docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ yarn kbn watch-bazel
- @kbn/server-http-tools
- @kbn/server-route-repository
- @kbn/std
- @kbn/storybook
- @kbn/telemetry-utils
- @kbn/tinymath
- @kbn/ui-framework
Expand Down
5 changes: 0 additions & 5 deletions docs/user/alerting/alerting-getting-started.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,4 @@ Functionally, {kib} alerting differs in that:
At a higher level, {kib} alerting allows rich integrations across use cases like <<xpack-apm,*APM*>>, <<metrics-app,*Metrics*>>, <<xpack-siem,*Security*>>, and <<uptime-app,*Uptime*>>.
Pre-packaged *rule types* simplify setup and hide the details of complex, domain-specific detections, while providing a consistent interface across {kib}.

[float]
[[alerting-setup-prerequisites]]
== Prerequisites
<<alerting-prerequisites, Alerting prerequisites>>

--
4 changes: 2 additions & 2 deletions docs/user/alerting/alerting-setup.asciidoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[role="xpack"]
[[alerting-setup]]
== Alerting Setup
== Alerting Set up
++++
<titleabbrev>Setup</titleabbrev>
<titleabbrev>Set up</titleabbrev>
++++

The Alerting feature is automatically enabled in {kib}, but might require some additional configuration.
Expand Down
11 changes: 0 additions & 11 deletions docs/user/alerting/defining-rules.asciidoc

This file was deleted.

2 changes: 0 additions & 2 deletions docs/user/alerting/index.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
include::alerting-getting-started.asciidoc[]
include::alerting-setup.asciidoc[]
include::create-and-manage-rules.asciidoc[]
include::defining-rules.asciidoc[]
include::rule-management.asciidoc[]
include::rule-types.asciidoc[]
include::alerting-troubleshooting.asciidoc[]
5 changes: 0 additions & 5 deletions docs/user/alerting/rule-management.asciidoc

This file was deleted.

2 changes: 1 addition & 1 deletion docs/user/alerting/rule-types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ see {subscriptions}[the subscription page].
[[stack-rules]]
=== Stack rules

<<alert-management, Stack rules>> are built into {kib}. To access the *Stack Rules* feature and create and edit rules, users require the `all` privilege. See <<kibana-feature-privileges, feature privileges>> for more information.
<<create-and-manage-rules, Stack rules>> are built into {kib}. To access the *Stack Rules* feature and create and edit rules, users require the `all` privilege. See <<kibana-feature-privileges, feature privileges>> for more information.

[cols="2*<"]
|===
Expand Down
5 changes: 5 additions & 0 deletions docs/user/dashboard/vega-reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ To learn more, read about
https://vega.github.io/vega/docs/specification/#autosize[autosize]
in the Vega documentation.

WARNING: Autosize in Vega-Lite has https://vega.github.io/vega-lite/docs/size.html#limitations[several limitations]
that can result in a warning like `Autosize "fit" only works for single views and layered views.`
The recommended fix for this warning is to convert your spec to Vega using the <<vega-browser-debugging-console, browser console>>
`VEGA_DEBUG.vega_spec` output.

[float]
[[vega-theme]]
====== Default theme to match {kib}
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@
"yarn": "^1.21.1"
},
"dependencies": {
"@elastic/apm-rum": "^5.6.1",
"@elastic/apm-rum-react": "^1.2.5",
"@elastic/apm-rum": "^5.8.0",
"@elastic/apm-rum-react": "^1.2.11",
"@elastic/charts": "30.1.0",
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.13",
Expand Down Expand Up @@ -224,7 +224,7 @@
"deep-freeze-strict": "^1.1.1",
"deepmerge": "^4.2.2",
"del": "^5.1.0",
"elastic-apm-node": "^3.14.0",
"elastic-apm-node": "^3.16.0",
"elasticsearch": "^16.7.0",
"execa": "^4.0.2",
"exit-hook": "^2.2.0",
Expand Down Expand Up @@ -468,7 +468,7 @@
"@kbn/plugin-generator": "link:bazel-bin/packages/kbn-plugin-generator",
"@kbn/plugin-helpers": "link:packages/kbn-plugin-helpers",
"@kbn/pm": "link:packages/kbn-pm",
"@kbn/storybook": "link:packages/kbn-storybook",
"@kbn/storybook": "link:bazel-bin/packages/kbn-storybook",
"@kbn/telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools",
"@kbn/test": "link:packages/kbn-test",
"@kbn/test-subj-selector": "link:packages/kbn-test-subj-selector",
Expand Down Expand Up @@ -841,4 +841,4 @@
"yargs": "^15.4.1",
"zlib": "^1.0.5"
}
}
}
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ filegroup(
"//packages/kbn-server-http-tools:build",
"//packages/kbn-server-route-repository:build",
"//packages/kbn-std:build",
"//packages/kbn-storybook:build",
"//packages/kbn-telemetry-tools:build",
"//packages/kbn-tinymath:build",
"//packages/kbn-ui-framework:build",
Expand Down
4 changes: 4 additions & 0 deletions packages/kbn-securitysolution-list-utils/src/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ export const filterExceptionItems = (
}
}, []);

if (entries.length === 0) {
return acc;
}

const item = { ...exception, entries };

if (exceptionListItemSchema.is(item)) {
Expand Down
98 changes: 98 additions & 0 deletions packages/kbn-storybook/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")

PKG_BASE_NAME = "kbn-storybook"
PKG_REQUIRE_NAME = "@kbn/storybook"

SOURCE_FILES = glob(
[
"lib/**/*.ts",
"lib/**/*.tsx",
"*.ts",
],
exclude = ["**/*.test.*"],
)

SRCS = SOURCE_FILES

filegroup(
name = "srcs",
srcs = SRCS,
)

NPM_MODULE_EXTRA_FILES = [
"preset/package.json",
"templates/index.ejs",
"package.json",
"README.md",
"preset.js",
]

SRC_DEPS = [
"//packages/kbn-dev-utils",
"//packages/kbn-ui-shared-deps",
"@npm//@storybook/addons",
"@npm//@storybook/api",
"@npm//@storybook/components",
"@npm//@storybook/core",
"@npm//@storybook/node-logger",
"@npm//@storybook/react",
"@npm//@storybook/theming",
"@npm//loader-utils",
"@npm//react",
"@npm//webpack",
"@npm//webpack-merge",
]

TYPES_DEPS = [
"@npm//@types/loader-utils",
"@npm//@types/node",
"@npm//@types/webpack",
"@npm//@types/webpack-merge",
]

DEPS = SRC_DEPS + TYPES_DEPS

ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
],
)

ts_project(
name = "tsc",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
declaration = True,
declaration_map = True,
incremental = True,
out_dir = "target",
source_map = True,
tsconfig = ":tsconfig",
)

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = [":tsc"] + DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)

pkg_npm(
name = "npm_module",
deps = [
":%s" % PKG_BASE_NAME,
]
)

filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)
5 changes: 0 additions & 5 deletions packages/kbn-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,5 @@
"types": "./target/index.d.ts",
"kibana": {
"devOnly": true
},
"scripts": {
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch"
}
}
1 change: 1 addition & 0 deletions packages/kbn-storybook/preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

// eslint-disable-next-line
const webpackConfig = require('./target/webpack.config').default;

module.exports = {
Expand Down
4 changes: 4 additions & 0 deletions packages/kbn-storybook/preset/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"private": true,
"main": "../preset.js"
}
File renamed without changes.
7 changes: 4 additions & 3 deletions packages/kbn-storybook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"incremental": true,
"outDir": "target",
"skipLibCheck": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-storybook",
"target": "es2015",
"types": ["node"]
},
"include": ["*.ts", "lib/**/*.ts", "lib/**/*.tsx", "../../typings/index.d.ts"]
"include": ["*.ts", "lib/**/*.ts", "lib/**/*.tsx"]
}
18 changes: 18 additions & 0 deletions packages/kbn-storybook/typings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* 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.
*/

// Storybook react doesn't declare this in its typings, but it's there.
declare module '@storybook/react/standalone';

// Storybook references this module. It's @ts-ignored in the codebase but when
// built into its dist it strips that out. Add it here to avoid a type checking
// error.
//
// See https://github.com/storybookjs/storybook/issues/11684
declare module 'react-syntax-highlighter/dist/cjs/create-element';
declare module 'react-syntax-highlighter/dist/cjs/prism-light';
2 changes: 1 addition & 1 deletion packages/kbn-storybook/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default function ({ config: storybookConfig }: { config: Configuration })
return plugin.options && typeof plugin.options.template === 'string';
});
if (htmlWebpackPlugin) {
htmlWebpackPlugin.options.template = require.resolve('../lib/templates/index.ejs');
htmlWebpackPlugin.options.template = require.resolve('../templates/index.ejs');
}

return webpackMerge(storybookConfig, config);
Expand Down
Loading

0 comments on commit bd58a17

Please sign in to comment.