Skip to content

Commit b5bb050

Browse files
Merge branch 'master' into canvas/storybook_refactor
2 parents 7987f36 + ac07ebb commit b5bb050

519 files changed

Lines changed: 7289 additions & 5123 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,16 @@ module.exports = {
875875
},
876876
},
877877

878+
/**
879+
* Cases overrides
880+
*/
881+
{
882+
files: ['x-pack/plugins/cases/**/*.{js,mjs,ts,tsx}'],
883+
rules: {
884+
'no-duplicate-imports': 'error',
885+
},
886+
},
887+
878888
/**
879889
* Security Solution overrides
880890
*/

docs/developer/getting-started/monorepo-packages.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ yarn kbn watch-bazel
8787
- @kbn/monaco
8888
- @kbn/rule-data-utils
8989
- @kbn/securitysolution-es-utils
90+
- @kbn/securitysolution-hook-utils
9091
- @kbn/securitysolution-io-ts-alerting-types
9192
- @kbn/securitysolution-io-ts-list-types
9293
- @kbn/securitysolution-io-ts-types

docs/developer/plugin-list.asciidoc

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -261,52 +261,48 @@ The plugin exposes the static DefaultEditorController class to consume.
261261
|The markdown visualization that can be used to place text panels on dashboards.
262262
263263
264-
|{kib-repo}blob/{branch}/src/plugins/vis_type_metric/README.md[visTypeMetric]
265-
|Contains the metric visualization.
264+
|{kib-repo}blob/{branch}/src/plugins/vis_type_metric[visTypeMetric]
265+
|WARNING: Missing README.
266266
267267
268-
|{kib-repo}blob/{branch}/src/plugins/vis_type_pie/README.md[visTypePie]
269-
|Contains the pie chart implementation using the elastic-charts library. The goal is to eventually deprecate the old implementation and keep only this. Until then, the library used is defined by the Legacy charts library advanced setting.
268+
|{kib-repo}blob/{branch}/src/plugins/vis_type_pie[visTypePie]
269+
|WARNING: Missing README.
270270
271271
272272
|{kib-repo}blob/{branch}/src/plugins/vis_type_table/README.md[visTypeTable]
273273
|Contains the data table visualization, that allows presenting data in a simple table format.
274274
275275
276-
|{kib-repo}blob/{branch}/src/plugins/vis_type_tagcloud/README.md[visTypeTagcloud]
277-
|Contains the tagcloud visualization.
276+
|{kib-repo}blob/{branch}/src/plugins/vis_type_tagcloud[visTypeTagcloud]
277+
|WARNING: Missing README.
278278
279279
280280
|{kib-repo}blob/{branch}/src/plugins/vis_type_timelion/README.md[visTypeTimelion]
281281
|Contains the timelion visualization and the timelion backend.
282282
283283
284-
|{kib-repo}blob/{branch}/src/plugins/vis_type_timeseries/README.md[visTypeTimeseries]
285-
|Contains everything around TSVB (the editor, visualizatin implementations and backends).
284+
|{kib-repo}blob/{branch}/src/plugins/vis_type_timeseries[visTypeTimeseries]
285+
|WARNING: Missing README.
286286
287287
288-
|{kib-repo}blob/{branch}/src/plugins/vis_type_vega/README.md[visTypeVega]
289-
|Contains the Vega visualization.
288+
|{kib-repo}blob/{branch}/src/plugins/vis_type_vega[visTypeVega]
289+
|WARNING: Missing README.
290290
291291
292-
|{kib-repo}blob/{branch}/src/plugins/vis_type_vislib/README.md[visTypeVislib]
293-
|Contains the vislib visualizations. These are the classical area/line/bar, pie, gauge/goal and
294-
heatmap charts.
292+
|{kib-repo}blob/{branch}/src/plugins/vis_type_vislib[visTypeVislib]
293+
|WARNING: Missing README.
295294
296295
297-
|{kib-repo}blob/{branch}/src/plugins/vis_type_xy/README.md[visTypeXy]
298-
|Contains the new xy-axis chart using the elastic-charts library, which will eventually
299-
replace the vislib xy-axis charts including bar, area, and line.
296+
|{kib-repo}blob/{branch}/src/plugins/vis_type_xy[visTypeXy]
297+
|WARNING: Missing README.
300298
301299
302-
|{kib-repo}blob/{branch}/src/plugins/visualizations/README.md[visualizations]
303-
|Contains most of the visualization infrastructure, e.g. the visualization type registry or the
304-
visualization embeddable.
300+
|{kib-repo}blob/{branch}/src/plugins/visualizations[visualizations]
301+
|WARNING: Missing README.
305302
306303
307-
|{kib-repo}blob/{branch}/src/plugins/visualize/README.md[visualize]
308-
|Contains the visualize application which includes the listing page and the app frame,
309-
which will load the visualization's editor.
304+
|{kib-repo}blob/{branch}/src/plugins/visualize[visualize]
305+
|WARNING: Missing README.
310306
311307
312308
|===
130 KB
Loading

docs/user/dashboard/lens-advanced.asciidoc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,41 @@ image::images/lens_advanced_5_2.png[Line chart with cumulative sum of orders mad
295295

296296
. Click *Save and return*.
297297

298+
[discrete]
299+
[[compare-time-ranges]]
300+
=== Compare time ranges
301+
302+
*Lens* allows you to compare the currently selected time range with historical data using the *Time shift* option.
303+
304+
Time shifts can be used on any metric. The special shift *previous* will show the time window preceding the currently selected one, spanning the same duration.
305+
For example, if *Last 7 days* is selected in the time filter, *previous* will show data from 14 days ago to 7 days ago.
306+
307+
If multiple time shifts are used in a single chart, a multiple of the date histogram interval should be chosen - otherwise data points might not line up in the chart and empty spots can occur.
308+
For example, if a daily interval is used, shifting one series by *36h*, and another one by *1d*, is not recommended. In this scenario, either reduce the interval to *12h*, or create two separate charts.
309+
310+
To compare current sales numbers with sales from a week ago, follow these steps:
311+
312+
. Open *Lens*.
313+
314+
. From the *Chart Type* dropdown, select *Line*.
315+
316+
. From the *Available fields* list, drag and drop *Records* to the visualization builder.
317+
318+
. Copy the *Count of Records* series by dragging it to the empty drop target of the *Vertical axis* dimension group (*Drop a field or click to add*)
319+
320+
. Shift the second *Count of Records* series by one week to do a week-over-week comparison
321+
322+
.. Click the new *Count of Records [1]* dimension
323+
324+
.. Click *Add advanced options* below the field selector
325+
326+
.. Click *Time shift*
327+
328+
.. Click the *1 week* option. You can also define custom shifts by typing amount followed by time unit (like *1w* for a one week shift), then hit enter.
329+
330+
[role="screenshot"]
331+
image::images/lens_time_shift.png[Line chart with week-over-week sales comparison]
332+
298333
[discrete]
299334
[[view-customers-over-time-by-continents]]
300335
=== View table of customers by category over time

docs/user/dashboard/lens.asciidoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,3 +315,22 @@ Pagination in a data table is unsupported in *Lens*. However, the <<types-of-vis
315315
===== Is it possible to have more than one y-axis scale in visualizations?
316316

317317
*Lens* lets you pick, for each Y dimension, up to two distinct axis: *left* and *right*. Each axis can have a different scale.
318+
319+
[float]
320+
[[why-is-my-value-with-the-right-color-using-value-based-coloring]]
321+
===== Why is my value with the incorrect color when using value-based coloring?
322+
323+
There could be various reasons for a specific value in the table to have a different color than expected.
324+
325+
Here's a short list of few different aspects to check:
326+
* Make sure the value falls within the desired color stop value defined in the panel. Color stop values are "inclusive".
327+
328+
* Make sure you have the right value precision setup: value formatters could round the numeric values up or down.
329+
330+
* Make sure the right color continuity option is selected: if the number is below the first color stop value, a continuity of type `Below` or `Above and below range` is required.
331+
332+
* The default values set by the Value type are based on the current data range displayed on the data table.
333+
334+
** If a custom `Number` configuration is used, check that the color stop values are covering the current data range.
335+
336+
** If a `Percent` configuration is used, and the data range changes, the colors displayed are affected.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
"@kbn/rule-data-utils": "link:bazel-bin/packages/kbn-rule-data-utils",
142142
"@kbn/securitysolution-list-constants": "link:bazel-bin/packages/kbn-securitysolution-list-constants",
143143
"@kbn/securitysolution-es-utils": "link:bazel-bin/packages/kbn-securitysolution-es-utils",
144+
"@kbn/securitysolution-hook-utils": "link:bazel-bin/packages/kbn-securitysolution-hook-utils",
144145
"@kbn/securitysolution-io-ts-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-types",
145146
"@kbn/securitysolution-io-ts-alerting-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-alerting-types",
146147
"@kbn/securitysolution-io-ts-list-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-list-types",

packages/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ filegroup(
4040
"//packages/kbn-securitysolution-list-utils:build",
4141
"//packages/kbn-securitysolution-utils:build",
4242
"//packages/kbn-securitysolution-es-utils:build",
43+
"//packages/kbn-securitysolution-hook-utils:build",
4344
"//packages/kbn-server-http-tools:build",
4445
"//packages/kbn-server-route-repository:build",
4546
"//packages/kbn-std:build",

packages/kbn-optimizer/limits.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,6 @@ pageLoadAssetSize:
108108
banners: 17946
109109
mapsEms: 26072
110110
timelines: 28613
111-
cases: 162385
112111
screenshotMode: 17856
113112
visTypePie: 35583
113+
cases: 144442
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
2+
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
3+
4+
PKG_BASE_NAME = "kbn-securitysolution-hook-utils"
5+
6+
PKG_REQUIRE_NAME = "@kbn/securitysolution-hook-utils"
7+
8+
SOURCE_FILES = glob(
9+
[
10+
"src/**/*.ts",
11+
],
12+
exclude = [
13+
"**/*.test.*",
14+
"**/*.mock.*",
15+
],
16+
)
17+
18+
SRCS = SOURCE_FILES
19+
20+
filegroup(
21+
name = "srcs",
22+
srcs = SRCS,
23+
)
24+
25+
NPM_MODULE_EXTRA_FILES = [
26+
"package.json",
27+
"README.md",
28+
]
29+
30+
SRC_DEPS = [
31+
"@npm//react",
32+
"@npm//rxjs",
33+
"@npm//tslib",
34+
]
35+
36+
TYPES_DEPS = [
37+
"@npm//@types/jest",
38+
"@npm//@types/node",
39+
"@npm//@types/react",
40+
]
41+
42+
DEPS = SRC_DEPS + TYPES_DEPS
43+
44+
ts_config(
45+
name = "tsconfig",
46+
src = "tsconfig.json",
47+
deps = [
48+
"//:tsconfig.base.json",
49+
],
50+
)
51+
52+
ts_project(
53+
name = "tsc",
54+
srcs = SRCS,
55+
args = ["--pretty"],
56+
declaration = True,
57+
declaration_map = True,
58+
incremental = True,
59+
out_dir = "target",
60+
root_dir = "src",
61+
source_map = True,
62+
tsconfig = ":tsconfig",
63+
deps = DEPS,
64+
)
65+
66+
js_library(
67+
name = PKG_BASE_NAME,
68+
package_name = PKG_REQUIRE_NAME,
69+
srcs = NPM_MODULE_EXTRA_FILES,
70+
visibility = ["//visibility:public"],
71+
deps = DEPS + [":tsc"],
72+
)
73+
74+
pkg_npm(
75+
name = "npm_module",
76+
deps = [
77+
":%s" % PKG_BASE_NAME,
78+
],
79+
)
80+
81+
filegroup(
82+
name = "build",
83+
srcs = [
84+
":npm_module",
85+
],
86+
visibility = ["//visibility:public"],
87+
)

0 commit comments

Comments
 (0)