-
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
[Lens] Correctly use UserMessage longMessage as function #192492
[Lens] Correctly use UserMessage longMessage as function #192492
Conversation
791eb08
to
3b3f7d5
Compare
3b3f7d5
to
824f2f9
Compare
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
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.
Change LGTM, I would just suggest extracting the duplicate logic.
...k/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_errors.tsx
Outdated
Show resolved
Hide resolved
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11332389816 |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
|
) ## Summary After elastic#167205 was merged, the `UserMessage.longMessage` was typed as `longMessage: string | React.ReactNode | ((closePopover: () => void) => React.ReactNode);` With the upcoming React 18 upgrade, an error will become visible because `((closePopover: () => void) => React.ReactNode);` can't be used as a ReactNode but it correctly needs to be called. In this PR I've made the `closePopover` function being optional (to simplify the refactoring) and I've added the typecheck where needed. (cherry picked from commit e35507a)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…) (#196194) # Backport This will backport the following commits from `main` to `8.x`: - [[Lens] Correctly use UserMessage longMessage as function (#192492)](#192492) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Marco Vettorello","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-14T17:34:36Z","message":"[Lens] Correctly use UserMessage longMessage as function (#192492)\n\n## Summary\r\n\r\nAfter #167205 was merged, the\r\n`UserMessage.longMessage` was typed as `longMessage: string |\r\nReact.ReactNode | ((closePopover: () => void) => React.ReactNode);`\r\n\r\nWith the upcoming React 18 upgrade, an error will become visible because\r\n`((closePopover: () => void) => React.ReactNode);` can't be used as a\r\nReactNode but it correctly needs to be called.\r\n\r\nIn this PR I've made the `closePopover` function being optional (to\r\nsimplify the refactoring) and I've added the typecheck where needed.","sha":"e35507a27d9c8df3fe5947c7227d6072d007dfa5","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:Lens","v9.0.0","backport:prev-minor","v8.16.0"],"title":"[Lens] Correctly use UserMessage longMessage as function ","number":192492,"url":"https://github.com/elastic/kibana/pull/192492","mergeCommit":{"message":"[Lens] Correctly use UserMessage longMessage as function (#192492)\n\n## Summary\r\n\r\nAfter #167205 was merged, the\r\n`UserMessage.longMessage` was typed as `longMessage: string |\r\nReact.ReactNode | ((closePopover: () => void) => React.ReactNode);`\r\n\r\nWith the upcoming React 18 upgrade, an error will become visible because\r\n`((closePopover: () => void) => React.ReactNode);` can't be used as a\r\nReactNode but it correctly needs to be called.\r\n\r\nIn this PR I've made the `closePopover` function being optional (to\r\nsimplify the refactoring) and I've added the typecheck where needed.","sha":"e35507a27d9c8df3fe5947c7227d6072d007dfa5"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192492","number":192492,"mergeCommit":{"message":"[Lens] Correctly use UserMessage longMessage as function (#192492)\n\n## Summary\r\n\r\nAfter #167205 was merged, the\r\n`UserMessage.longMessage` was typed as `longMessage: string |\r\nReact.ReactNode | ((closePopover: () => void) => React.ReactNode);`\r\n\r\nWith the upcoming React 18 upgrade, an error will become visible because\r\n`((closePopover: () => void) => React.ReactNode);` can't be used as a\r\nReactNode but it correctly needs to be called.\r\n\r\nIn this PR I've made the `closePopover` function being optional (to\r\nsimplify the refactoring) and I've added the typecheck where needed.","sha":"e35507a27d9c8df3fe5947c7227d6072d007dfa5"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Marco Vettorello <[email protected]>
Summary
After #167205 was merged, the
UserMessage.longMessage
was typed aslongMessage: string | React.ReactNode | ((closePopover: () => void) => React.ReactNode);
With the upcoming React 18 upgrade, an error will become visible because
((closePopover: () => void) => React.ReactNode);
can't be used as a ReactNode but it correctly needs to be called.In this PR I've made the
closePopover
function being optional (to simplify the refactoring) and I've added the typecheck where needed.