Skip to content

Commit

Permalink
Merge branch 'master' into TSVB-IFieldType-removal
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Aug 30, 2021
2 parents 9526479 + 079fc9a commit 99883dd
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 31 deletions.
4 changes: 4 additions & 0 deletions packages/kbn-securitysolution-list-api/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@kbn/babel-preset/node_preset"],
"ignore": ["**/*.test.ts", "**/*.test.tsx"]
}
4 changes: 4 additions & 0 deletions packages/kbn-securitysolution-list-api/.babelrc.browser
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@kbn/babel-preset/webpack_preset"],
"ignore": ["**/*.test.ts", "**/*.test.tsx"]
}
35 changes: 26 additions & 9 deletions packages/kbn-securitysolution-list-api/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")

PKG_BASE_NAME = "kbn-securitysolution-list-api"

Expand Down Expand Up @@ -27,21 +28,36 @@ NPM_MODULE_EXTRA_FILES = [
"README.md",
]

SRC_DEPS = [
RUNTIME_DEPS = [
"//packages/kbn-securitysolution-io-ts-list-types",
"//packages/kbn-securitysolution-io-ts-utils",
"//packages/kbn-securitysolution-list-constants",
"//packages/kbn-securitysolution-io-ts-list-types",
"@npm//fp-ts",
"@npm//io-ts",
"@npm//tslib",
]

TYPES_DEPS = [
"//packages/kbn-securitysolution-io-ts-list-types",
"//packages/kbn-securitysolution-io-ts-utils",
"//packages/kbn-securitysolution-list-constants",
"@npm//fp-ts",
"@npm//io-ts",
"@npm//@types/jest",
"@npm//@types/node",
]

DEPS = SRC_DEPS + TYPES_DEPS
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)

jsts_transpiler(
name = "target_web",
srcs = SRCS,
build_pkg_name = package_name(),
config_file = ".babelrc.browser"
)

ts_config(
name = "tsconfig",
Expand All @@ -53,24 +69,25 @@ ts_config(
)

ts_project(
name = "tsc",
name = "tsc_types",
srcs = SRCS,
deps = TYPES_DEPS,
args = ["--pretty"],
declaration = True,
declaration_map = True,
out_dir = "target",
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
source_map = True,
tsconfig = ":tsconfig",
deps = DEPS,
)

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

pkg_npm(
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-securitysolution-list-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "1.0.0",
"description": "security solution list REST API",
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"browser": "./target_web/index.js",
"main": "./target_node/index.js",
"types": "./target_types/index.d.ts",
"private": true
}
3 changes: 2 additions & 1 deletion packages/kbn-securitysolution-list-api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"outDir": "target",
"emitDeclarationOnly": true,
"outDir": "target_types",
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-securitysolution-list-api/src",
Expand Down
4 changes: 4 additions & 0 deletions packages/kbn-securitysolution-list-constants/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@kbn/babel-preset/node_preset"],
"ignore": ["**/*.test.ts", "**/*.test.tsx"]
}
4 changes: 4 additions & 0 deletions packages/kbn-securitysolution-list-constants/.babelrc.browser
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@kbn/babel-preset/webpack_preset"],
"ignore": ["**/*.test.ts", "**/*.test.tsx"]
}
29 changes: 20 additions & 9 deletions packages/kbn-securitysolution-list-constants/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")

PKG_BASE_NAME = "kbn-securitysolution-list-constants"

Expand Down Expand Up @@ -27,16 +28,25 @@ NPM_MODULE_EXTRA_FILES = [
"README.md",
]

SRC_DEPS = [
"@npm//tslib",
]
RUNTIME_DEPS = []

TYPES_DEPS = [
"@npm//@types/jest",
"@npm//@types/node",
]

DEPS = SRC_DEPS + TYPES_DEPS
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)

jsts_transpiler(
name = "target_web",
srcs = SRCS,
build_pkg_name = package_name(),
config_file = ".babelrc.browser"
)

ts_config(
name = "tsconfig",
Expand All @@ -48,24 +58,25 @@ ts_config(
)

ts_project(
name = "tsc",
name = "tsc_types",
srcs = SRCS,
deps = TYPES_DEPS,
args = ["--pretty"],
declaration = True,
declaration_map = True,
out_dir = "target",
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
source_map = True,
tsconfig = ":tsconfig",
deps = DEPS,
)

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

pkg_npm(
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-securitysolution-list-constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "1.0.0",
"description": "security solution list constants to use across plugins such lists, security_solution, cases, etc...",
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"browser": "./target_web/index.js",
"main": "./target_node/index.js",
"types": "./target_types/index.d.ts",
"private": true
}
3 changes: 2 additions & 1 deletion packages/kbn-securitysolution-list-constants/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"outDir": "target",
"emitDeclarationOnly": true,
"outDir": "target_types",
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-securitysolution-list-constants/src",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ class ImageUpload extends React.Component {
onValueChange: PropTypes.func.isRequired,
typeInstance: PropTypes.object.isRequired,
resolvedArgValue: PropTypes.string,
argValue: PropTypes.string,
assets: PropTypes.object.isRequired,
};

constructor(props) {
super(props);

const url = props.resolvedArgValue || null;
const url = props.resolvedArgValue || props.argValue || null;

let urlType = Object.keys(props.assets).length ? 'asset' : 'file';
// if not a valid base64 string, will show as missing asset icon
Expand Down Expand Up @@ -143,7 +143,7 @@ class ImageUpload extends React.Component {
file: <FileForm loading={loading} onChange={this.handleUpload} />,
link: (
<LinkForm
url={url}
url={selectedAsset.id ? '' : url}
inputRef={(ref) => (this.inputRefs.srcUrlText = ref)}
onSubmit={this.setSrcUrl}
/>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@
.euiDataGridRowCell--boolean {
text-transform: none;
}

// Override to align the sorting arrow at the bottom when histogram charts are enabled
.euiDataGridHeaderCell .euiDataGridHeaderCell__sortingArrow {
margin-top: auto;
margin-bottom: 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from '@elastic/eui';
import { SecurityPageName } from '../../../common/constants';
import { SpyRoute } from '../../common/utils/route/spy_routes';
import { useTestIdGenerator } from './hooks/use_test_id_generator';

interface AdministrationListPageProps {
title: React.ReactNode;
Expand Down Expand Up @@ -45,21 +46,23 @@ export const AdministrationListPage: FC<AdministrationListPageProps & CommonProp
return <span data-test-subj="header-panel-subtitle">{subtitle}</span>;
}, [subtitle]);

const getTestId = useTestIdGenerator(otherProps['data-test-subj']);

return (
<>
<div {...otherProps}>
<EuiPageHeader
pageTitle={header}
description={description}
bottomBorder={true}
rightSideItems={[actions]}
restrictWidth={false}
{...otherProps}
data-test-subj={getTestId('header')}
/>
<EuiSpacer size="l" />
{children}

<SpyRoute pageName={SecurityPageName.administration} />
</>
</div>
);
}
);
Expand Down

0 comments on commit 99883dd

Please sign in to comment.