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

[lens][embeddable] Custom lens component does not reload when lastReloadRequestTime changes #203457

Closed
nreese opened this issue Dec 9, 2024 · 1 comment · Fixed by #203755
Closed
Assignees
Labels
enhancement New value added to drive a business result Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@nreese
Copy link
Contributor

nreese commented Dec 9, 2024

The embeddable mechanism for triggering reloads is the PublishesReload interface.

The custom lens renderer component parentApi should implement PublishesReload interface. reload$ should emit when lastReloadRequestTime changes

const reload$ = useMemo(() => {
  return new Subject<void>();
}, []);

useEffect(() => {
  reload$.next();
}, [props.lastReloadRequestTime]);

return (
    <ReactEmbeddableRenderer<LensSerializedState, LensRuntimeState, LensApi>
      // all the other props
      getParentApi(() => {
        // all the other stuff
        reload$,
      })
    />
  );
@nreese nreese added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Dec 9, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@dej611 dej611 added Feature:Lens enhancement New value added to drive a business result labels Dec 11, 2024
@dej611 dej611 self-assigned this Dec 11, 2024
@dej611 dej611 added the impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. label Dec 11, 2024
@dej611 dej611 closed this as completed in 3875d26 Dec 19, 2024
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Dec 19, 2024
## Summary

Fixes elastic#203457

Use the `lastReloadRequestTime` prop to trigger a reload in place of the
legacy `searchSessionId` system.

(cherry picked from commit 3875d26)
kibanamachine added a commit that referenced this issue Dec 19, 2024
… (#204946)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Lens][Embeddable] Use reload$ api for custom component
(#203755)](#203755)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Marco
Liberati","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-19T13:44:12Z","message":"[Lens][Embeddable]
Use reload$ api for custom component (#203755)\n\n##
Summary\r\n\r\nFixes #203457 \r\n\r\nUse the `lastReloadRequestTime`
prop to trigger a reload in place of the\r\nlegacy `searchSessionId`
system.","sha":"3875d26ae8c9be4b5684b7e582eb237113286f99","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","Feature:Lens","v9.0.0","backport:prev-minor"],"title":"[Lens][Embeddable]
Use reload$ api for custom
component","number":203755,"url":"https://github.com/elastic/kibana/pull/203755","mergeCommit":{"message":"[Lens][Embeddable]
Use reload$ api for custom component (#203755)\n\n##
Summary\r\n\r\nFixes #203457 \r\n\r\nUse the `lastReloadRequestTime`
prop to trigger a reload in place of the\r\nlegacy `searchSessionId`
system.","sha":"3875d26ae8c9be4b5684b7e582eb237113286f99"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203755","number":203755,"mergeCommit":{"message":"[Lens][Embeddable]
Use reload$ api for custom component (#203755)\n\n##
Summary\r\n\r\nFixes #203457 \r\n\r\nUse the `lastReloadRequestTime`
prop to trigger a reload in place of the\r\nlegacy `searchSessionId`
system.","sha":"3875d26ae8c9be4b5684b7e582eb237113286f99"}}]}]
BACKPORT-->

Co-authored-by: Marco Liberati <[email protected]>
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this issue Dec 19, 2024
## Summary

Fixes elastic#203457 

Use the `lastReloadRequestTime` prop to trigger a reload in place of the
legacy `searchSessionId` system.
benakansara pushed a commit to benakansara/kibana that referenced this issue Jan 2, 2025
## Summary

Fixes elastic#203457 

Use the `lastReloadRequestTime` prop to trigger a reload in place of the
legacy `searchSessionId` system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants