-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into investigate-in-timeline
- Loading branch information
Showing
89 changed files
with
3,294 additions
and
1,860 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
const defaultConfig = require('@kbn/storybook').defaultConfig; | ||
|
||
module.exports = { | ||
...defaultConfig, | ||
stories: ['../**/*.stories.tsx'], | ||
reactOptions: { | ||
strictMode: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
*/ | ||
const { addons } = require('@storybook/addons'); | ||
const { create } = require('@storybook/theming'); | ||
const { PANEL_ID } = require('@storybook/addon-actions'); | ||
|
||
addons.setConfig({ | ||
theme: create({ | ||
base: 'light', | ||
brandTitle: 'Content Management Storybook', | ||
}), | ||
showPanel: () => true, | ||
selectedPanel: PANEL_ID, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
load("@npm//@bazel/typescript:index.bzl", "ts_config") | ||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library") | ||
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") | ||
|
||
PKG_DIRNAME = "table_list" | ||
PKG_REQUIRE_NAME = "@kbn/content-management-table-list" | ||
|
||
SOURCE_FILES = glob( | ||
[ | ||
"**/*.ts", | ||
"**/*.tsx", | ||
], | ||
exclude = [ | ||
"**/*.config.js", | ||
"**/*.mock.*", | ||
"**/*.test.*", | ||
"**/*.stories.*", | ||
"**/__snapshots__", | ||
"**/integration_tests", | ||
"**/mocks", | ||
"**/scripts", | ||
"**/storybook", | ||
"**/test_fixtures", | ||
"**/test_helpers", | ||
], | ||
) | ||
|
||
SRCS = SOURCE_FILES | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = SRCS, | ||
) | ||
|
||
NPM_MODULE_EXTRA_FILES = [ | ||
"package.json", | ||
] | ||
|
||
# In this array place runtime dependencies, including other packages and NPM packages | ||
# which must be available for this code to run. | ||
# | ||
# To reference other packages use: | ||
# "//repo/relative/path/to/package" | ||
# eg. "//packages/kbn-utils" | ||
# | ||
# To reference a NPM package use: | ||
# "@npm//name-of-package" | ||
# eg. "@npm//lodash" | ||
RUNTIME_DEPS = [ | ||
"//packages/kbn-i18n-react", | ||
"//packages/kbn-i18n", | ||
"//packages/core/http/core-http-browser", | ||
"//packages/core/theme/core-theme-browser", | ||
"//packages/kbn-safer-lodash-set", | ||
"//packages/shared-ux/page/kibana_template/impl", | ||
"@npm//@elastic/eui", | ||
"@npm//@emotion/react", | ||
"@npm//@emotion/css", | ||
"@npm//lodash", | ||
"@npm//moment", | ||
"@npm//react-use", | ||
"@npm//react", | ||
"@npm//rxjs", | ||
] | ||
|
||
# In this array place dependencies necessary to build the types, which will include the | ||
# :npm_module_types target of other packages and packages from NPM, including @types/* | ||
# packages. | ||
# | ||
# To reference the types for another package use: | ||
# "//repo/relative/path/to/package:npm_module_types" | ||
# eg. "//packages/kbn-utils:npm_module_types" | ||
# | ||
# References to NPM packages work the same as RUNTIME_DEPS | ||
TYPES_DEPS = [ | ||
"//packages/kbn-i18n:npm_module_types", | ||
"//packages/kbn-i18n-react:npm_module_types", | ||
"//packages/core/http/core-http-browser:npm_module_types", | ||
"//packages/core/theme/core-theme-browser:npm_module_types", | ||
"//packages/kbn-ambient-storybook-types", | ||
"//packages/kbn-ambient-ui-types", | ||
"//packages/kbn-safer-lodash-set:npm_module_types", | ||
"//packages/shared-ux/page/kibana_template/impl:npm_module_types", | ||
"//packages/shared-ux/page/kibana_template/types", | ||
"@npm//@types/node", | ||
"@npm//@types/jest", | ||
"@npm//@types/lodash", | ||
"@npm//@types/react", | ||
"@npm//@elastic/eui", | ||
"@npm//react-use", | ||
"@npm//rxjs", | ||
] | ||
|
||
jsts_transpiler( | ||
name = "target_node", | ||
srcs = SRCS, | ||
build_pkg_name = package_name(), | ||
) | ||
|
||
jsts_transpiler( | ||
name = "target_web", | ||
srcs = SRCS, | ||
build_pkg_name = package_name(), | ||
web = True, | ||
) | ||
|
||
ts_config( | ||
name = "tsconfig", | ||
src = "tsconfig.json", | ||
deps = [ | ||
"//:tsconfig.base.json", | ||
"//:tsconfig.bazel.json", | ||
], | ||
) | ||
|
||
ts_project( | ||
name = "tsc_types", | ||
args = ['--pretty'], | ||
srcs = SRCS, | ||
deps = TYPES_DEPS, | ||
declaration = True, | ||
declaration_map = True, | ||
emit_declaration_only = True, | ||
out_dir = "target_types", | ||
tsconfig = ":tsconfig", | ||
) | ||
|
||
js_library( | ||
name = PKG_DIRNAME, | ||
srcs = NPM_MODULE_EXTRA_FILES, | ||
deps = RUNTIME_DEPS + [":target_node", ":target_web"], | ||
package_name = PKG_REQUIRE_NAME, | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
pkg_npm( | ||
name = "npm_module", | ||
deps = [":" + PKG_DIRNAME], | ||
) | ||
|
||
filegroup( | ||
name = "build", | ||
srcs = [":npm_module"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
pkg_npm_types( | ||
name = "npm_module_types", | ||
srcs = SRCS, | ||
deps = [":tsc_types"], | ||
package_name = PKG_REQUIRE_NAME, | ||
tsconfig = ":tsconfig", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
filegroup( | ||
name = "build_types", | ||
srcs = [":npm_module_types"], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
id: sharedUX/contentManagement/TableList | ||
slug: /shared-ux/content-management/table-list | ||
title: Table list view | ||
summary: A table to render user generated saved objects. | ||
tags: ['shared-ux', 'content-management'] | ||
date: 2022-08-09 | ||
--- | ||
|
||
The `<TableListView />` render a eui page to display a list of user content saved object. | ||
|
||
**Uncomplete documentation**. Will be updated. | ||
|
||
## API | ||
|
||
TODO | ||
|
||
## EUI Promotion Status | ||
|
||
This component is not currently considered for promotion to EUI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { TableListView, TableListViewProvider, TableListViewKibanaProvider } from './src'; | ||
|
||
export type { UserContentCommonSchema } from './src'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/content-management/table_list'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "shared-common", | ||
"id": "@kbn/content-management-table-list", | ||
"owner": "@elastic/shared-ux", | ||
"runtimeDeps": [], | ||
"typeDeps": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "@kbn/content-management-table-list", | ||
"private": true, | ||
"version": "1.0.0", | ||
"main": "./target_node/index.js", | ||
"browser": "./target_web/index.js", | ||
"license": "SSPL-1.0 OR Elastic License 2.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
* Side Public License, v 1. | ||
*/ | ||
|
||
export * from './table_list_view'; | ||
export { WithServices } from './tests.helpers'; |
36 changes: 36 additions & 0 deletions
36
packages/content-management/table_list/src/__jest__/tests.helpers.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import type { ComponentType } from 'react'; | ||
import { from } from 'rxjs'; | ||
|
||
import { TableListViewProvider, Services } from '../services'; | ||
|
||
export const getMockServices = (overrides?: Partial<Services>) => { | ||
const services: Services = { | ||
canEditAdvancedSettings: true, | ||
getListingLimitSettingsUrl: () => 'http://elastic.co', | ||
notifyError: () => undefined, | ||
currentAppId$: from('mockedApp'), | ||
navigateToUrl: () => undefined, | ||
...overrides, | ||
}; | ||
|
||
return services; | ||
}; | ||
|
||
export function WithServices<P>(Comp: ComponentType<P>, overrides: Partial<Services> = {}) { | ||
return (props: P) => { | ||
const services = getMockServices(overrides); | ||
return ( | ||
<TableListViewProvider {...services}> | ||
<Comp {...(props as any)} /> | ||
</TableListViewProvider> | ||
); | ||
}; | ||
} |
Oops, something went wrong.