Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RAC] T-Grid is moving to a new home #100265

Merged
merged 97 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
a766816
wip
XavierM Apr 30, 2021
4b4226a
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM May 3, 2021
ff8e573
First pass at standalone and embedded redux stores and usage
kqualters-elastic May 6, 2021
c83fa58
wip
XavierM Apr 30, 2021
eb8ac73
First pass at standalone and embedded redux stores and usage
kqualters-elastic May 6, 2021
129351d
wip
XavierM May 6, 2021
cd05741
Merge branch 't-grid-new-home' of github.com:XavierM/kibana into t-gr…
XavierM May 14, 2021
36c240c
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM May 14, 2021
2bb49a7
clean up
XavierM May 14, 2021
e8b0a4b
wip
XavierM May 17, 2021
b42b00c
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM May 18, 2021
fdeaffc
refact(NA): remove extra pkg_npm target and add specific target folde…
mistic May 18, 2021
752e357
Merge remote-tracking branch 'upstream/master' into remove-extra-pkg_…
mistic May 18, 2021
c3adc62
cleanup
XavierM May 18, 2021
2f619fc
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM May 18, 2021
f047145
Merge branch 'remove-extra-pkg_npm-from-kbn-i18n' of github.com:misti…
XavierM May 18, 2021
df93aa5
- fixes type errors in tests
andrew-goldstein May 19, 2021
30bad21
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM May 19, 2021
067bfd1
WIP remove use_manage_timeline
kqualters-elastic May 19, 2021
1a9a414
wip add query + selector
XavierM May 20, 2021
6bf50ba
Merge branch 't-grid-new-home' of github.com:XavierM/kibana into t-gr…
XavierM May 20, 2021
83310e3
finishing integrating timeline manage context from redux
XavierM May 20, 2021
18ac6db
integrating t-grid in security solution
XavierM May 24, 2021
a80802d
fix RowRender type
XavierM May 25, 2021
8459d5b
WIP begin to move components from package to plugin
kqualters-elastic May 25, 2021
22016a5
Merge branch 't-grid-new-home' of github.com:XavierM/kibana into t-gr…
XavierM May 25, 2021
dc7ac7c
integration of t-grid inside of security solution
XavierM May 25, 2021
bee3f65
wip to make redux work
XavierM May 25, 2021
f552264
little trick to make it render
XavierM May 25, 2021
136ae44
- fixes a few type errors
andrew-goldstein May 27, 2021
aca8810
better integration betwen tgrid and security solutions
XavierM May 28, 2021
980979a
Merge branch 't-grid-new-home' of github.com:XavierM/kibana into t-gr…
XavierM May 28, 2021
642090f
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM May 28, 2021
eab2df6
bringing back tsconfig on timeline
XavierM May 28, 2021
ccb66e3
wip integration t-grid in observability
XavierM Jun 3, 2021
981cb8b
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM Jun 4, 2021
559bfa8
fix types
XavierM Jun 4, 2021
73a2da7
fix type in security solutions
XavierM Jun 5, 2021
31ceae3
add type to import + trie dto get the bundle size as small as possible
XavierM Jun 7, 2021
9a438e1
fix type in integration test
XavierM Jun 7, 2021
5bca60e
fix type in integration test
XavierM Jun 7, 2021
279aa58
Merge branch 't-grid-new-home' of github.com:XavierM/kibana into t-gr…
XavierM Jun 7, 2021
a227538
- fix tests
andrew-goldstein Jun 8, 2021
782db0c
Merge branch 't-grid-new-home' of github.com:XavierM/kibana into t-gr…
andrew-goldstein Jun 8, 2021
3873495
clean up to use technical fields
XavierM Jun 8, 2021
2e70041
Merge branch 't-grid-new-home' of github.com:XavierM/kibana into t-gr…
XavierM Jun 8, 2021
abfd4e8
- fixes unit tests
andrew-goldstein Jun 9, 2021
712fc00
- mocks the `useDateFormat` function of the `useKibana` service to fi…
andrew-goldstein Jun 9, 2021
de5b04e
fix t-grid settings vs create timeline + fix inspect button
XavierM Jun 10, 2021
f97b842
Merge branch 't-grid-new-home' of github.com:XavierM/kibana into t-gr…
XavierM Jun 10, 2021
39fdaa0
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM Jun 10, 2021
f581b11
fix last suites test
XavierM Jun 10, 2021
6b6aa51
Update unit tests, snapshots and lint
kqualters-elastic Jun 10, 2021
1006453
Merge remote-tracking branch 'xavier/t-grid-new-home' into t-grid-new…
kqualters-elastic Jun 10, 2021
9d8504b
Fix bad merge
kqualters-elastic Jun 10, 2021
fb9f220
fix plugin export
XavierM Jun 10, 2021
fd2bf33
Merge remote-tracking branch 'xavier/t-grid-new-home' into t-grid-new…
kqualters-elastic Jun 10, 2021
b740fd3
Fix some failing tests
kqualters-elastic Jun 10, 2021
74f8d02
fix unit tets in timelines plugins
XavierM Jun 10, 2021
c84b084
Merge branch 't-grid-new-home' of github.com:XavierM/kibana into t-gr…
XavierM Jun 10, 2021
080b0d6
fix latest test
XavierM Jun 10, 2021
b28faeb
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM Jun 10, 2021
b3f548e
fix i18n
XavierM Jun 10, 2021
ba5b086
free obs from t-grid
XavierM Jun 10, 2021
1aa1e3b
Fix timeline functional plugin types
kqualters-elastic Jun 10, 2021
c2f9de7
Merge branch 't-grid-new-home' of github.com:XavierM/kibana into t-gr…
kqualters-elastic Jun 14, 2021
411516d
fix store provider
XavierM Jun 14, 2021
70604e1
Merge branch 't-grid-new-home' of github.com:XavierM/kibana into t-gr…
XavierM Jun 14, 2021
e333728
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM Jun 14, 2021
7190e78
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM Jun 15, 2021
4382a10
Update failing defaultHeader test
kqualters-elastic Jun 15, 2021
b2ceb1d
Fix i18n usage in security solution
kqualters-elastic Jun 15, 2021
eda18f9
Fix remaining i18n errors in timelines plugin
kqualters-elastic Jun 15, 2021
3ee7e2c
Dedupe common shared types
kqualters-elastic Jun 16, 2021
9076b4f
move drag and drop utils in package to avoid duplication
XavierM Jun 17, 2021
cd5700b
Merge branch 't-grid-new-home' of github.com:XavierM/kibana into t-gr…
XavierM Jun 17, 2021
bf12fa9
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM Jun 17, 2021
cb04865
More shared type cleanup
kqualters-elastic Jun 17, 2021
c98693a
Merge branch 't-grid-new-home' of github.com:XavierM/kibana into t-gr…
XavierM Jun 17, 2021
fb282b3
add feature flag
XavierM Jun 17, 2021
e8b56cf
review I
XavierM Jun 17, 2021
38dd389
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM Jun 17, 2021
0a9bd47
fix merge with master
XavierM Jun 21, 2021
7262fd5
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM Jun 21, 2021
495c53b
fix i18n translation
XavierM Jun 21, 2021
0c53075
More type deduping
kqualters-elastic Jun 21, 2021
2a9546d
Merge remote-tracking branch 'xavier/t-grid-new-home' into t-grid-new…
kqualters-elastic Jun 21, 2021
d1557f3
Use @kbn/common-utils, fix remaining types
kqualters-elastic Jun 21, 2021
2960665
fix types
XavierM Jun 21, 2021
0e2286b
Merge branch 't-grid-new-home' of github.com:XavierM/kibana into t-gr…
XavierM Jun 21, 2021
8e71b5c
fix tests
XavierM Jun 21, 2021
a4ddf6f
missing type
XavierM Jun 21, 2021
05dd22e
fix cypress tests
XavierM Jun 22, 2021
9815b74
Update limits.yml and fix functional plugin tests
kqualters-elastic Jun 22, 2021
fe4be92
Merge branch 'master' of github.com:elastic/kibana into t-grid-new-home
XavierM Jun 22, 2021
4e4277d
fix cypress test + few bugs found
XavierM Jun 22, 2021
5f43fc4
Fix failing jest test
kqualters-elastic Jun 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 10 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,8 @@ module.exports = {
files: [
'x-pack/plugins/security_solution/public/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/security_solution/common/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/timelines/public/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/timelines/common/**/*.{js,mjs,ts,tsx}',
],
rules: {
'import/no-nodejs-modules': 'error',
Expand All @@ -907,7 +909,10 @@ module.exports = {
},
{
// typescript only for front and back end
files: ['x-pack/plugins/security_solution/**/*.{ts,tsx}'],
files: [
'x-pack/plugins/security_solution/**/*.{ts,tsx}',
'x-pack/plugins/timelines/**/*.{ts,tsx}',
],
rules: {
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/no-explicit-any': 'error',
Expand All @@ -917,7 +922,10 @@ module.exports = {
},
{
// typescript and javascript for front and back end
files: ['x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}'],
files: [
'x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/timelines/**/*.{js,mjs,ts,tsx}',
],
plugins: ['eslint-plugin-node', 'react'],
env: {
jest: true,
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"@kbn/securitysolution-list-api": "link:bazel-bin/packages/kbn-securitysolution-list-api",
"@kbn/securitysolution-list-hooks": "link:bazel-bin/packages/kbn-securitysolution-list-hooks",
"@kbn/securitysolution-list-utils": "link:bazel-bin/packages/kbn-securitysolution-list-utils",
"@kbn/securitysolution-t-grid": "link:bazel-bin/packages/kbn-securitysolution-t-grid",
"@kbn/securitysolution-utils": "link:bazel-bin/packages/kbn-securitysolution-utils",
"@kbn/server-http-tools": "link:bazel-bin/packages/kbn-server-http-tools",
"@kbn/server-route-repository": "link:bazel-bin/packages/kbn-server-route-repository",
Expand Down Expand Up @@ -217,6 +218,8 @@
"cytoscape-dagre": "^2.2.2",
"d3": "3.5.17",
"d3-array": "1.2.4",
"d3-cloud": "1.2.5",
"d3-interpolate": "^3.0.1",
"d3-scale": "1.0.7",
"d3-shape": "^1.1.0",
"d3-time": "^1.1.0",
Expand Down Expand Up @@ -512,6 +515,7 @@
"@types/cytoscape": "^3.14.0",
"@types/d3": "^3.5.43",
"@types/d3-array": "^1.2.7",
"@types/d3-interpolate": "^2.0.0",
"@types/d3-scale": "^2.1.1",
"@types/d3-shape": "^1.3.1",
"@types/d3-time": "^1.0.10",
Expand Down
3 changes: 2 additions & 1 deletion packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
filegroup(
name = "build",
srcs = [
"//packages/elastic-datemath:build",
"//packages/elastic-datemath:build",
"//packages/elastic-eslint-config-kibana:build",
"//packages/elastic-safer-lodash-set:build",
"//packages/kbn-ace:build",
Expand Down Expand Up @@ -40,6 +40,7 @@ filegroup(
"//packages/kbn-securitysolution-list-utils:build",
"//packages/kbn-securitysolution-utils:build",
"//packages/kbn-securitysolution-es-utils:build",
"//packages/kbn-securitysolution-t-grid:build",
"//packages/kbn-securitysolution-hook-utils:build",
"//packages/kbn-server-http-tools:build",
"//packages/kbn-server-route-repository:build",
Expand Down
125 changes: 125 additions & 0 deletions packages/kbn-securitysolution-t-grid/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
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-securitysolution-t-grid"

PKG_REQUIRE_NAME = "@kbn/securitysolution-t-grid"

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

SRCS = SOURCE_FILES

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

NPM_MODULE_EXTRA_FILES = [
"react/package.json",
"package.json",
"README.md",
]

SRC_DEPS = [
"//packages/kbn-babel-preset",
"//packages/kbn-dev-utils",
"//packages/kbn-i18n",
"@npm//@babel/core",
"@npm//babel-loader",
"@npm//enzyme",
"@npm//jest",
"@npm//lodash",
"@npm//react",
"@npm//react-beautiful-dnd",
"@npm//tslib",
]

TYPES_DEPS = [
"@npm//typescript",
"@npm//@types/enzyme",
"@npm//@types/jest",
"@npm//@types/lodash",
"@npm//@types/node",
"@npm//@types/react",
"@npm//@types/react-beautiful-dnd",
]

DEPS = SRC_DEPS + TYPES_DEPS

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

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

ts_project(
name = "tsc",
args = ["--pretty"],
srcs = SRCS,
deps = DEPS,
declaration = True,
declaration_dir = "target_types",
declaration_map = True,
incremental = True,
out_dir = "target_node",
root_dir = "src",
source_map = True,
tsconfig = ":tsconfig",
)

ts_project(
name = "tsc_browser",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
allow_js = True,
declaration = False,
incremental = True,
out_dir = "target_web",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig_browser",
)

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

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

filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)
3 changes: 3 additions & 0 deletions packages/kbn-securitysolution-t-grid/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# kbn-securitysolution-t-grid

We do not want to create circular dependencies between security_solution and timelines plugins. Therefore , we will use this packages to share components between these two plugins.
19 changes: 19 additions & 0 deletions packages/kbn-securitysolution-t-grid/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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.
*/

module.exports = {
env: {
web: {
presets: ['@kbn/babel-preset/webpack_preset'],
},
node: {
presets: ['@kbn/babel-preset/node_preset'],
},
},
ignore: ['**/*.test.ts', '**/*.test.tsx'],
};
13 changes: 13 additions & 0 deletions packages/kbn-securitysolution-t-grid/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* 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.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-securitysolution-t-grid'],
};
10 changes: 10 additions & 0 deletions packages/kbn-securitysolution-t-grid/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "@kbn/securitysolution-t-grid",
"version": "1.0.0",
"description": "security solution t-grid packages will allow sharing components between timelines and security_solution plugin until we transfer all functionality to timelines plugin",
"license": "SSPL-1.0 OR Elastic License 2.0",
"browser": "./target_web/browser.js",
"main": "./target_node/index.js",
"types": "./target_types/index.d.ts",
"private": true
}
5 changes: 5 additions & 0 deletions packages/kbn-securitysolution-t-grid/react/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"browser": "../target_web/react",
"main": "../target_node/react",
"types": "../target_types/react/index.d.ts"
}
26 changes: 26 additions & 0 deletions packages/kbn-securitysolution-t-grid/src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* 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.
*/

export const HIGHLIGHTED_DROP_TARGET_CLASS_NAME = 'highlighted-drop-target';
export const EMPTY_PROVIDERS_GROUP_CLASS_NAME = 'empty-providers-group';

/** The draggable will move this many pixels via the keyboard when the arrow key is pressed */
export const KEYBOARD_DRAG_OFFSET = 20;

export const DRAGGABLE_KEYBOARD_WRAPPER_CLASS_NAME = 'draggable-keyboard-wrapper';

export const ROW_RENDERER_CLASS_NAME = 'row-renderer';

export const NOTES_CONTAINER_CLASS_NAME = 'notes-container';

export const NOTE_CONTENT_CLASS_NAME = 'note-content';

/** This class is added to the document body while dragging */
export const IS_DRAGGING_CLASS_NAME = 'is-dragging';

export const HOVER_ACTIONS_ALWAYS_SHOW_CLASS_NAME = 'hover-actions-always-show';
11 changes: 11 additions & 0 deletions packages/kbn-securitysolution-t-grid/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* 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.
*/

export * from './constants';
export * from './utils';
export * from './mock';
9 changes: 9 additions & 0 deletions packages/kbn-securitysolution-t-grid/src/mock/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* 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.
*/

export * from './mock_event_details';
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
* 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.
*/

export const eventHit = {
Expand Down
42 changes: 42 additions & 0 deletions packages/kbn-securitysolution-t-grid/src/utils/api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* 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 { has } from 'lodash/fp';

export interface AppError extends Error {
body: {
message: string;
};
}

export interface KibanaError extends AppError {
body: {
message: string;
statusCode: number;
};
}

export interface SecurityAppError extends AppError {
body: {
message: string;
status_code: number;
};
}

export const isKibanaError = (error: unknown): error is KibanaError =>
has('message', error) && has('body.message', error) && has('body.statusCode', error);

export const isSecurityAppError = (error: unknown): error is SecurityAppError =>
has('message', error) && has('body.message', error) && has('body.status_code', error);

export const isAppError = (error: unknown): error is AppError =>
isKibanaError(error) || isSecurityAppError(error);

export const isNotFoundError = (error: unknown) =>
(isKibanaError(error) && error.body.statusCode === 404) ||
(isSecurityAppError(error) && error.body.status_code === 404);
Loading