[Lens] Correctly use UserMessage longMessage as function #192492
Merged
markov00 merged 5 commits intoelastic:mainfrom Oct 14, 2024
Merged
[Lens] Correctly use UserMessage longMessage as function #192492markov00 merged 5 commits intoelastic:mainfrom
markov00 merged 5 commits intoelastic:mainfrom
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: |
nickofthyme
approved these changes
Sep 26, 2024
Contributor
nickofthyme
left a comment
There was a problem hiding this comment.
Change LGTM, I would just suggest extracting the duplicate logic.
Contributor
|
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11332389816 |
Contributor
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
|
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Oct 14, 2024
) ## 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)
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Oct 14, 2024
…) (#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":"marco.vettorello@elastic.co"},"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 <marco.vettorello@elastic.co>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After #167205 was merged, the
UserMessage.longMessagewas 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
closePopoverfunction being optional (to simplify the refactoring) and I've added the typecheck where needed.