-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Canvas] Expression reveal image. #101987
[Canvas] Expression reveal image. #101987
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
@elasticmachine merge upstream |
⏳ Build in-progress, with failures
Failed CI StepsHistory
To update your PR or re-run it, just comment with: cc @Kunzetsov |
⏳ Build in-progress, with failures
Failed CI StepsHistory
To update your PR or re-run it, just comment with: cc @Kunzetsov |
handlers.event({ name: 'onResize', data: updateImageView }); | ||
handlers.done(); | ||
return () => { | ||
handlers.event({ name: 'destroy' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this event consumed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this event consumed ?
src/plugins/expression_reveal_image/public/expression_renderers/reveal_image_renderer.tsx:31
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And you can find such a workflow in every renderer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's not consuming this event, onDestroy renderer is a separate thing. This event will get fired and the consumer (canvas app) would need to listen for it and react to it, renderers just won't get any information about this.
can you explain the workflow ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You were right. The workflow is further:
- For example, a user is pressing
backspace
after selecting the element.
x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/interactive_workpad_page.js
is renderingWorkpadShortcuts
.
Among them:x-pack/plugins/canvas/public/lib/element_handler_creators.ts:63
. Onbackspace
deleteNodes
is executed. It is removing elements fromredux state
and calling rerender. - After current rerender,
componendWillUnmount
is executed. We are writing in a functional way withhooks
, so the returned function fromuseEffect
is called atRenderWithFn
component. (x-pack/plugins/canvas/public/components/render_with_fn/render_with_fn.tsx:84
). It is emittingdestroy
on line 84. - Renderer is listening to current
event
, by bindinghandlers.onDestroy(...)
atsrc/plugins/expression_reveal_image/public/expression_renderers/reveal_image_renderer.tsx:31
. Ondestroy
it is unmounting component, which has been mounted in parent node. - Component, which has been rendered by renderer is unmounting and calling
event({ name: 'destroy' })
. I believe, there was some idea behind it before, but now it is useless.
Thank you, @ppisljar, for this suggestion.
@elasticmachine merge upstream |
interface RevealImageComponentProps extends RevealImageRendererConfig { | ||
handlers: IInterpreterRenderHandlers; | ||
parentNode: HTMLElement; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For testability and concern separation maybe it would be useful to make this component more "presentational" and decouple it from the knowledge of "handlers".
Maybe handlers
prop can be replaced by canonical React onSomething
props:
interface RevealImageComponentProps extends RevealImageRendererConfig { | |
handlers: IInterpreterRenderHandlers; | |
parentNode: HTMLElement; | |
} | |
interface RevealImageComponentProps extends RevealImageRendererConfig { | |
onResize: () => void; | |
onLoaded: () => void; | |
onUnmount: () => void; | |
parentNode: HTMLElement; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume, that moving from handlers
to onSomething
will make developers, who will extract other plugins, write a lot of boilerplate code for covering this pattern. We already have a standardized way of providing listeners and emitters from the plugin, which is calling a renderer. It is describing types, possible events, etc. And current component is locked in a scope of a renderer
and not going to be used separately. I'm not really sure if it is needed.
But at the same moment, I assume, that I don't see all the map and can be out of knowledge of the whole idea. I should refer to somebody, who is more knowledgeable.
@crob611, what do you think about it? Are there any reasons for making such changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll provide such changes. Thanks for this suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -60,12 +63,15 @@ function RevealImageComponent({ | |||
}, [imgRef, handlers]); | |||
|
|||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this effect looks obsolete now, handlers will never change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That code is for defining componentDidMount
lifecycle. In the other words, it will execute once, on component mounting and will call destroy
on unmount. That is what is expected from this useEffect
block. I prefer to separate useEffect
for different logical parts, based on its role.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it, because done
is already calling after updating the dimensions of parentNode.
}); | ||
|
||
setLoaded(true); | ||
handlers.done(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: seems this is the only handler used now, so i am also in favor of what vadim partialy suggested as well, to not pass whole handlers to this component, but rather just pass the done handler: <image_reveal onLoaded={handlers.done}
which might make it easier to spot which handlers specific renderer depends upon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure, that all further components will be using handlers
in such a simple way? If not, we will provide a bad pattern. What would you say about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't insist, I'm trying to imagine, what consequences it will cause.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no strong opinion on it, i think most renderers are not gonna use a lot of handlers, but some of course will.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expression function should be registered on the server as well (and implementation if possible provided in common)
@ppisljar, I've done changes, based on your suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app services related code LGTM
Thanks for the review and a lot of useful suggestions. |
* expression_reveal_image skeleton. * expression_functions added. * expression_renderers added. * Backup of daily work. * Fixed errors. * Added legacy support. Added button for legacy. * Added storybook. * Removed revealImage from canvas. * setState while rendering error fixed. * tsconfig.json added. * jest.config.js added. * Demo doc added. * Types fixed. * added limits. * Removed not used imports. * i18n namespaces fixed. * Fixed test suite error. * Some errors fixed. * Fixed eslint error. * Removed more unused translations. * Moved UI and elements, related to expressionRevealImage from canvas. * Fixed unused translations errors. * Moved type of element to types. * Fixed types and added service for representing elements, ui and supported renderers to canvas. * Added expression registration to canvas. * Fixed * Fixed mutiple call of the function. * Removed support of a legacy lib for revealImage chart. * Removed legacy presentation_utils plugin import. * Doc error fixed. * Removed useless translations and tried to fix error. * One more fix. * Small imports fix. * Fixed translations. * Made fixes based on nits. * Removed useless params. * fix. * Fixed errors, related to jest and __mocks__. * Removed useless type definition. * Replaced RendererHandlers with IInterpreterRendererHandlers. * fixed supported_shareable. * Moved elements back to canvas. * Moved views to canvas, removed expression service and imported renderer to canvas. * Fixed translations. * Types fix. * Moved libs to presentation utils. * Fixed one mistake. * removed dataurl lib. * Fixed jest files. * elasticLogo removed. * Removed elastic_outline. * removed httpurl. * Removed missing_asset. * removed url. * replaced mostly all tests. * Fixed types. * Fixed types and removed function_wrapper.ts * Fixed types of test helpers. * Changed limits of presentationUtil plugin. * Fixed imports. * One more fix. * Fixed huge size of bundle. * Reduced allow limit for presentationUtil * Updated limits for presentationUtil. * Fixed public API. * fixed type errors. * Moved css to component. * Fixed spaces at element. * Changed order of requiredPlugins. * Updated limits. * Removed unused plugin. * Added rule for allowing import from __stories__ directory. * removed useless comment. * Changed readme.md * Fixed docs error. * A possible of smoke test. * onResize changed to useResizeObserver. * Remove useless events and `useEffect` block. * Changed from passing handlers to separate functions. * `function` moved to `server`. * Fixed eslint error. Co-authored-by: Kibana Machine <[email protected]>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Any counts in public APIs
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
History
To update your PR or re-run it, just comment with: cc @Kunzetsov |
* expression_reveal_image skeleton. * expression_functions added. * expression_renderers added. * Backup of daily work. * Fixed errors. * Added legacy support. Added button for legacy. * Added storybook. * Removed revealImage from canvas. * setState while rendering error fixed. * tsconfig.json added. * jest.config.js added. * Demo doc added. * Types fixed. * added limits. * Removed not used imports. * i18n namespaces fixed. * Fixed test suite error. * Some errors fixed. * Fixed eslint error. * Removed more unused translations. * Moved UI and elements, related to expressionRevealImage from canvas. * Fixed unused translations errors. * Moved type of element to types. * Fixed types and added service for representing elements, ui and supported renderers to canvas. * Added expression registration to canvas. * Fixed * Fixed mutiple call of the function. * Removed support of a legacy lib for revealImage chart. * Removed legacy presentation_utils plugin import. * Doc error fixed. * Removed useless translations and tried to fix error. * One more fix. * Small imports fix. * Fixed translations. * Made fixes based on nits. * Removed useless params. * fix. * Fixed errors, related to jest and __mocks__. * Removed useless type definition. * Replaced RendererHandlers with IInterpreterRendererHandlers. * fixed supported_shareable. * Moved elements back to canvas. * Moved views to canvas, removed expression service and imported renderer to canvas. * Fixed translations. * Types fix. * Moved libs to presentation utils. * Fixed one mistake. * removed dataurl lib. * Fixed jest files. * elasticLogo removed. * Removed elastic_outline. * removed httpurl. * Removed missing_asset. * removed url. * replaced mostly all tests. * Fixed types. * Fixed types and removed function_wrapper.ts * Fixed types of test helpers. * Changed limits of presentationUtil plugin. * Fixed imports. * One more fix. * Fixed huge size of bundle. * Reduced allow limit for presentationUtil * Updated limits for presentationUtil. * Fixed public API. * fixed type errors. * Moved css to component. * Fixed spaces at element. * Changed order of requiredPlugins. * Updated limits. * Removed unused plugin. * Added rule for allowing import from __stories__ directory. * removed useless comment. * Changed readme.md * Fixed docs error. * A possible of smoke test. * onResize changed to useResizeObserver. * Remove useless events and `useEffect` block. * Changed from passing handlers to separate functions. * `function` moved to `server`. * Fixed eslint error. Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Yaroslav Kuznietsov <[email protected]>
* expression_reveal_image skeleton. * expression_functions added. * expression_renderers added. * Backup of daily work. * Fixed errors. * Added legacy support. Added button for legacy. * Added storybook. * Removed revealImage from canvas. * setState while rendering error fixed. * tsconfig.json added. * jest.config.js added. * Demo doc added. * Types fixed. * added limits. * Removed not used imports. * i18n namespaces fixed. * Fixed test suite error. * Some errors fixed. * Fixed eslint error. * Removed more unused translations. * Moved UI and elements, related to expressionRevealImage from canvas. * Fixed unused translations errors. * Moved type of element to types. * Fixed types and added service for representing elements, ui and supported renderers to canvas. * Added expression registration to canvas. * Fixed * Fixed mutiple call of the function. * Removed support of a legacy lib for revealImage chart. * Removed legacy presentation_utils plugin import. * Doc error fixed. * Removed useless translations and tried to fix error. * One more fix. * Small imports fix. * Fixed translations. * Made fixes based on nits. * Removed useless params. * fix. * Fixed errors, related to jest and __mocks__. * Removed useless type definition. * Replaced RendererHandlers with IInterpreterRendererHandlers. * fixed supported_shareable. * Moved elements back to canvas. * Moved views to canvas, removed expression service and imported renderer to canvas. * Fixed translations. * Types fix. * Moved libs to presentation utils. * Fixed one mistake. * removed dataurl lib. * Fixed jest files. * elasticLogo removed. * Removed elastic_outline. * removed httpurl. * Removed missing_asset. * removed url. * replaced mostly all tests. * Fixed types. * Fixed types and removed function_wrapper.ts * Fixed types of test helpers. * Changed limits of presentationUtil plugin. * Fixed imports. * One more fix. * Fixed huge size of bundle. * Reduced allow limit for presentationUtil * Updated limits for presentationUtil. * Fixed public API. * fixed type errors. * Moved css to component. * Fixed spaces at element. * Changed order of requiredPlugins. * Updated limits. * Removed unused plugin. * Added rule for allowing import from __stories__ directory. * removed useless comment. * Changed readme.md * Fixed docs error. * A possible of smoke test. * onResize changed to useResizeObserver. * Remove useless events and `useEffect` block. * Changed from passing handlers to separate functions. * `function` moved to `server`. * Fixed eslint error. Co-authored-by: Kibana Machine <[email protected]>
…3399) * Added lazy loading of async libs to storybook. * Refactored lazy loading of import for a storybook. * more refactoring stuff. * more refactoring. * small refactor of waitFor. * Added support of async functions. * Types fix. * fixed docs. * Fixed some mistakes. * Fixed type of tests. * added type for async function to write dicts easier. * Updated stories and view with async image. * Changed all static to async imports. * Removed static import of `elasticLogo`. Fixed type error. * Changed way of returning async functions in `functionWrapper`. * fixed renderer test. * fixed errors. * added outline and fixed types. * added outline everywhere. * waitFor fixed. * removed useless exports. * Fixed type error. * fixed types of dropdown_control.test.ts * fixed `csv.test.ts` types. * Tests fixed. * Fixed storybooks. * Fixed failed tests. * [Canvas] Expression reveal image. (#101987) * expression_reveal_image skeleton. * expression_functions added. * expression_renderers added. * Backup of daily work. * Fixed errors. * Added legacy support. Added button for legacy. * Added storybook. * Removed revealImage from canvas. * setState while rendering error fixed. * tsconfig.json added. * jest.config.js added. * Demo doc added. * Types fixed. * added limits. * Removed not used imports. * i18n namespaces fixed. * Fixed test suite error. * Some errors fixed. * Fixed eslint error. * Removed more unused translations. * Moved UI and elements, related to expressionRevealImage from canvas. * Fixed unused translations errors. * Moved type of element to types. * Fixed types and added service for representing elements, ui and supported renderers to canvas. * Added expression registration to canvas. * Fixed * Fixed mutiple call of the function. * Removed support of a legacy lib for revealImage chart. * Removed legacy presentation_utils plugin import. * Doc error fixed. * Removed useless translations and tried to fix error. * One more fix. * Small imports fix. * Fixed translations. * Made fixes based on nits. * Removed useless params. * fix. * Fixed errors, related to jest and __mocks__. * Removed useless type definition. * Replaced RendererHandlers with IInterpreterRendererHandlers. * fixed supported_shareable. * Moved elements back to canvas. * Moved views to canvas, removed expression service and imported renderer to canvas. * Fixed translations. * Types fix. * Moved libs to presentation utils. * Fixed one mistake. * removed dataurl lib. * Fixed jest files. * elasticLogo removed. * Removed elastic_outline. * removed httpurl. * Removed missing_asset. * removed url. * replaced mostly all tests. * Fixed types. * Fixed types and removed function_wrapper.ts * Fixed types of test helpers. * Changed limits of presentationUtil plugin. * Fixed imports. * One more fix. * Fixed huge size of bundle. * Reduced allow limit for presentationUtil * Updated limits for presentationUtil. * Fixed public API. * fixed type errors. * Moved css to component. * Fixed spaces at element. * Changed order of requiredPlugins. * Updated limits. * Removed unused plugin. * Added rule for allowing import from __stories__ directory. * removed useless comment. * Changed readme.md * Fixed docs error. * A possible of smoke test. * onResize changed to useResizeObserver. * Remove useless events and `useEffect` block. * Changed from passing handlers to separate functions. * `function` moved to `server`. * Fixed eslint error. Co-authored-by: Kibana Machine <[email protected]> * Fixed mistake of merge. * Storybook fixed. * Fixed a mistake that occurred while resolving merge conflicts. * removed registerFunctionAsync and changed functionWrapper from async to sync. + RepeatImageFunction. * Fixed async functionWrapper usage and fixed `image.test.js` to run. * Added default value for image. * More fixes of async. * Fixed a lot of legacy. * Type fixes. * Fix of fallen tests. * First part of suggestions completed. * Made image required. * Removed useless `async` * Jest test fixed. * Fixed code, based on nits. * Moved to `emotion`. * Fixed prettier error. * replaced jsx pragma with react. * Removed unused jsx. Co-authored-by: Kibana Machine <[email protected]>
…stic#103399) * Added lazy loading of async libs to storybook. * Refactored lazy loading of import for a storybook. * more refactoring stuff. * more refactoring. * small refactor of waitFor. * Added support of async functions. * Types fix. * fixed docs. * Fixed some mistakes. * Fixed type of tests. * added type for async function to write dicts easier. * Updated stories and view with async image. * Changed all static to async imports. * Removed static import of `elasticLogo`. Fixed type error. * Changed way of returning async functions in `functionWrapper`. * fixed renderer test. * fixed errors. * added outline and fixed types. * added outline everywhere. * waitFor fixed. * removed useless exports. * Fixed type error. * fixed types of dropdown_control.test.ts * fixed `csv.test.ts` types. * Tests fixed. * Fixed storybooks. * Fixed failed tests. * [Canvas] Expression reveal image. (elastic#101987) * expression_reveal_image skeleton. * expression_functions added. * expression_renderers added. * Backup of daily work. * Fixed errors. * Added legacy support. Added button for legacy. * Added storybook. * Removed revealImage from canvas. * setState while rendering error fixed. * tsconfig.json added. * jest.config.js added. * Demo doc added. * Types fixed. * added limits. * Removed not used imports. * i18n namespaces fixed. * Fixed test suite error. * Some errors fixed. * Fixed eslint error. * Removed more unused translations. * Moved UI and elements, related to expressionRevealImage from canvas. * Fixed unused translations errors. * Moved type of element to types. * Fixed types and added service for representing elements, ui and supported renderers to canvas. * Added expression registration to canvas. * Fixed * Fixed mutiple call of the function. * Removed support of a legacy lib for revealImage chart. * Removed legacy presentation_utils plugin import. * Doc error fixed. * Removed useless translations and tried to fix error. * One more fix. * Small imports fix. * Fixed translations. * Made fixes based on nits. * Removed useless params. * fix. * Fixed errors, related to jest and __mocks__. * Removed useless type definition. * Replaced RendererHandlers with IInterpreterRendererHandlers. * fixed supported_shareable. * Moved elements back to canvas. * Moved views to canvas, removed expression service and imported renderer to canvas. * Fixed translations. * Types fix. * Moved libs to presentation utils. * Fixed one mistake. * removed dataurl lib. * Fixed jest files. * elasticLogo removed. * Removed elastic_outline. * removed httpurl. * Removed missing_asset. * removed url. * replaced mostly all tests. * Fixed types. * Fixed types and removed function_wrapper.ts * Fixed types of test helpers. * Changed limits of presentationUtil plugin. * Fixed imports. * One more fix. * Fixed huge size of bundle. * Reduced allow limit for presentationUtil * Updated limits for presentationUtil. * Fixed public API. * fixed type errors. * Moved css to component. * Fixed spaces at element. * Changed order of requiredPlugins. * Updated limits. * Removed unused plugin. * Added rule for allowing import from __stories__ directory. * removed useless comment. * Changed readme.md * Fixed docs error. * A possible of smoke test. * onResize changed to useResizeObserver. * Remove useless events and `useEffect` block. * Changed from passing handlers to separate functions. * `function` moved to `server`. * Fixed eslint error. Co-authored-by: Kibana Machine <[email protected]> * Fixed mistake of merge. * Storybook fixed. * Fixed a mistake that occurred while resolving merge conflicts. * removed registerFunctionAsync and changed functionWrapper from async to sync. + RepeatImageFunction. * Fixed async functionWrapper usage and fixed `image.test.js` to run. * Added default value for image. * More fixes of async. * Fixed a lot of legacy. * Type fixes. * Fix of fallen tests. * First part of suggestions completed. * Made image required. * Removed useless `async` * Jest test fixed. * Fixed code, based on nits. * Moved to `emotion`. * Fixed prettier error. * replaced jsx pragma with react. * Removed unused jsx. Co-authored-by: Kibana Machine <[email protected]>
…3399) (#106103) * Added lazy loading of async libs to storybook. * Refactored lazy loading of import for a storybook. * more refactoring stuff. * more refactoring. * small refactor of waitFor. * Added support of async functions. * Types fix. * fixed docs. * Fixed some mistakes. * Fixed type of tests. * added type for async function to write dicts easier. * Updated stories and view with async image. * Changed all static to async imports. * Removed static import of `elasticLogo`. Fixed type error. * Changed way of returning async functions in `functionWrapper`. * fixed renderer test. * fixed errors. * added outline and fixed types. * added outline everywhere. * waitFor fixed. * removed useless exports. * Fixed type error. * fixed types of dropdown_control.test.ts * fixed `csv.test.ts` types. * Tests fixed. * Fixed storybooks. * Fixed failed tests. * [Canvas] Expression reveal image. (#101987) * expression_reveal_image skeleton. * expression_functions added. * expression_renderers added. * Backup of daily work. * Fixed errors. * Added legacy support. Added button for legacy. * Added storybook. * Removed revealImage from canvas. * setState while rendering error fixed. * tsconfig.json added. * jest.config.js added. * Demo doc added. * Types fixed. * added limits. * Removed not used imports. * i18n namespaces fixed. * Fixed test suite error. * Some errors fixed. * Fixed eslint error. * Removed more unused translations. * Moved UI and elements, related to expressionRevealImage from canvas. * Fixed unused translations errors. * Moved type of element to types. * Fixed types and added service for representing elements, ui and supported renderers to canvas. * Added expression registration to canvas. * Fixed * Fixed mutiple call of the function. * Removed support of a legacy lib for revealImage chart. * Removed legacy presentation_utils plugin import. * Doc error fixed. * Removed useless translations and tried to fix error. * One more fix. * Small imports fix. * Fixed translations. * Made fixes based on nits. * Removed useless params. * fix. * Fixed errors, related to jest and __mocks__. * Removed useless type definition. * Replaced RendererHandlers with IInterpreterRendererHandlers. * fixed supported_shareable. * Moved elements back to canvas. * Moved views to canvas, removed expression service and imported renderer to canvas. * Fixed translations. * Types fix. * Moved libs to presentation utils. * Fixed one mistake. * removed dataurl lib. * Fixed jest files. * elasticLogo removed. * Removed elastic_outline. * removed httpurl. * Removed missing_asset. * removed url. * replaced mostly all tests. * Fixed types. * Fixed types and removed function_wrapper.ts * Fixed types of test helpers. * Changed limits of presentationUtil plugin. * Fixed imports. * One more fix. * Fixed huge size of bundle. * Reduced allow limit for presentationUtil * Updated limits for presentationUtil. * Fixed public API. * fixed type errors. * Moved css to component. * Fixed spaces at element. * Changed order of requiredPlugins. * Updated limits. * Removed unused plugin. * Added rule for allowing import from __stories__ directory. * removed useless comment. * Changed readme.md * Fixed docs error. * A possible of smoke test. * onResize changed to useResizeObserver. * Remove useless events and `useEffect` block. * Changed from passing handlers to separate functions. * `function` moved to `server`. * Fixed eslint error. Co-authored-by: Kibana Machine <[email protected]> * Fixed mistake of merge. * Storybook fixed. * Fixed a mistake that occurred while resolving merge conflicts. * removed registerFunctionAsync and changed functionWrapper from async to sync. + RepeatImageFunction. * Fixed async functionWrapper usage and fixed `image.test.js` to run. * Added default value for image. * More fixes of async. * Fixed a lot of legacy. * Type fixes. * Fix of fallen tests. * First part of suggestions completed. * Made image required. * Removed useless `async` * Jest test fixed. * Fixed code, based on nits. * Moved to `emotion`. * Fixed prettier error. * replaced jsx pragma with react. * Removed unused jsx. Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Yaroslav Kuznietsov <[email protected]>
Completes a part of #101377.
At this PR reveal Image expression is extracted from the canvas plugin and set up as a separate plugin.
List of required changes to be done:
revealImage
expression from canvas to a separate plugin.ts
andReact
.revealImage
.Storybook
for the reveal image expression renderer.canvas
pluginAfter reviews, need to make further changes:
RendererHandlers
withIInterpreterRendererHandlers
shareable runtime
renderers atcanvas'
setup to static import of renderer from pluginelements
anduiViews
fromexpression_reveal_image
back tocanvas
libs/helpers
, which are reused incanvas
andexpression_reveal_image
, topresentation_utils
Testing Notes
This moves the reveal_image expression function to a standalone plugin and refactors the code. To test, just test that the reveal_image expression in canvas continues to work as expected.