Skip to content

Commit 645bc3f

Browse files
[Canvas] Expression error (#103048)
* Basic setup of error plugin. * Removed not used `function` files at `error` expression. * Moved related components from canvas. * Changed imports of components. * Fixed renderer and storybook. * Fixed types errors. * Added limits. * Removed useless translations and fixed .i18nrc.json * added `done` handler call. * Added more fixes fo i18nc. * Added docs. * More fixes of i18nrc. * Fixed async functions. Written current code, based on storybookjs/storybook#7745 * Fixed one test with Expression input. After changing the way of rendering in stories, all elements are mounting and componentDidMount is involved. The previous snapshot was without mounted `monaco` editor. * Fixed storybook error. * More fixes. * removed unused translations. * Removed handlers and changed the way of handling `resize` and calling `done`. * Fixed i18n error. * Fixed storybook. * Replaced Popover with EuiPopover. * Moved `Popover` back to `canvas` * Removed `Popover` export from presentation_utils components. * Moved error_component and debug_component from presentation_util to expression_error. * Fixed translations and imports. * Moved `debug renderer` to `expression_error` plugin. * Fixed error. * Fixed lazy exports. * Fixed imports * Fixed storybook snapshot. * Removed `.i18nrc.json`. * Fixed color of `error`. * Exported concrete elements from popover. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # packages/kbn-optimizer/limits.yml # src/plugins/expression_error/public/components/debug/debug.tsx
1 parent 1ce67c9 commit 645bc3f

59 files changed

Lines changed: 538 additions & 218 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.

.i18nrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"esUi": "src/plugins/es_ui_shared",
1717
"devTools": "src/plugins/dev_tools",
1818
"expressions": "src/plugins/expressions",
19+
"expressionError": "src/plugins/expression_error",
1920
"expressionRevealImage": "src/plugins/expression_reveal_image",
2021
"inputControl": "src/plugins/input_control_vis",
2122
"inspector": "src/plugins/inspector",

docs/developer/plugin-list.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ This API doesn't support angular, for registering angular dev tools, bootstrap a
7070
|WARNING: Missing README.
7171
7272
73+
|{kib-repo}blob/{branch}/src/plugins/expression_error/README.md[expressionError]
74+
|Expression Error plugin adds an error renderer to the expression plugin. The renderer will display the error image.
75+
76+
7377
|{kib-repo}blob/{branch}/src/plugins/expression_reveal_image/README.md[expressionRevealImage]
7478
|Expression Reveal Image plugin adds a revealImage function to the expression plugin and an associated renderer. The renderer will display the given percentage of a given image.
7579

packages/kbn-optimizer/limits.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,4 @@ pageLoadAssetSize:
112112
visTypePie: 35583
113113
expressionRevealImage: 25675
114114
cases: 144442
115+
expressionError: 22127

src/dev/storybook/aliases.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const storybookAliases = {
1717
dashboard_enhanced: 'x-pack/plugins/dashboard_enhanced/.storybook',
1818
data_enhanced: 'x-pack/plugins/data_enhanced/.storybook',
1919
embeddable: 'src/plugins/embeddable/.storybook',
20+
expression_error: 'src/plugins/expression_error/.storybook',
2021
expression_reveal_image: 'src/plugins/expression_reveal_image/.storybook',
2122
infra: 'x-pack/plugins/infra/.storybook',
2223
security_solution: 'x-pack/plugins/security_solution/.storybook',
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
// eslint-disable-next-line import/no-commonjs
10+
module.exports = require('@kbn/storybook').defaultConfig;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# expressionRevealImage
2+
3+
Expression Error plugin adds an `error` renderer to the expression plugin. The renderer will display the error image.
4+
5+
---
6+
7+
## Development
8+
9+
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) for instructions setting up your development environment.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
export const PLUGIN_ID = 'expressionError';
9+
export const PLUGIN_NAME = 'expressionError';
10+
11+
export const JSON = 'JSON';
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
export * from './constants';
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
export type OriginString = 'bottom' | 'left' | 'top' | 'right';
10+
11+
export interface ErrorRendererConfig {
12+
error: Error;
13+
}
14+
15+
export interface NodeDimensions {
16+
width: number;
17+
height: number;
18+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
export * from './expression_renderers';

0 commit comments

Comments
 (0)