Skip to content

Commit

Permalink
[8.x] [Security Solution] Fix incorrect diff display after switching …
Browse files Browse the repository at this point in the history
…versions (#211901) (#212346)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution] Fix incorrect diff display after switching
versions (#211901)](#211901)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Nikita
Indik","email":"nikita.indik@elastic.co"},"sourceCommit":{"committedDate":"2025-02-25T10:29:05Z","message":"[Security
Solution] Fix incorrect diff display after switching versions
(#211901)\n\n**Resolves:
https://github.com/elastic/kibana/issues/208085**\n\n## Summary\n\nFixes
a bug where incorrect diff was shown for ABC SOLVABLE cases in\nprebuilt
rule upgrade flyout.\n\n###
Before\n\n\nhttps://github.com/user-attachments/assets/cc56e115-24e9-4e6c-b5fc-26704c506137\n\n###
After\n\n\nhttps://github.com/user-attachments/assets/c27978d7-76ce-4dd4-8b78-4680625cd922\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"8e3d423572beeab14ad4a2be2a77934c8eeafa43","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security
Solution] Fix incorrect diff display after switching
versions","number":211901,"url":"https://github.com/elastic/kibana/pull/211901","mergeCommit":{"message":"[Security
Solution] Fix incorrect diff display after switching versions
(#211901)\n\n**Resolves:
https://github.com/elastic/kibana/issues/208085**\n\n## Summary\n\nFixes
a bug where incorrect diff was shown for ABC SOLVABLE cases in\nprebuilt
rule upgrade flyout.\n\n###
Before\n\n\nhttps://github.com/user-attachments/assets/cc56e115-24e9-4e6c-b5fc-26704c506137\n\n###
After\n\n\nhttps://github.com/user-attachments/assets/c27978d7-76ce-4dd4-8b78-4680625cd922\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"8e3d423572beeab14ad4a2be2a77934c8eeafa43"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211901","number":211901,"mergeCommit":{"message":"[Security
Solution] Fix incorrect diff display after switching versions
(#211901)\n\n**Resolves:
https://github.com/elastic/kibana/issues/208085**\n\n## Summary\n\nFixes
a bug where incorrect diff was shown for ABC SOLVABLE cases in\nprebuilt
rule upgrade flyout.\n\n###
Before\n\n\nhttps://github.com/user-attachments/assets/cc56e115-24e9-4e6c-b5fc-26704c506137\n\n###
After\n\n\nhttps://github.com/user-attachments/assets/c27978d7-76ce-4dd4-8b78-4680625cd922\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"8e3d423572beeab14ad4a2be2a77934c8eeafa43"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nikita Indik <nikita.indik@elastic.co>
  • Loading branch information
kibanamachine and nikitaindik authored Feb 25, 2025
1 parent 4c42363 commit e3b2b50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function FieldComparisonSide(): JSX.Element {
useEffect(() => {
if (
selectedOption !== VersionsPickerOptionEnum.MyChanges &&
prevResolvedValue !== undefined &&
!isEqual(prevResolvedValue, resolvedValue)
) {
setSelectedOption(VersionsPickerOptionEnum.MyChanges);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function getVersionsForComparison(
case VersionsPickerOptionEnum.UpdateFromElastic:
return hasBaseVersion ? [Version.Base, Version.Target] : [Version.Current, Version.Target];
case VersionsPickerOptionEnum.Merged:
return [Version.Base, Version.Target];
return [Version.Base, Version.Final];
default:
return assertUnreachable(selectedOption);
}
Expand Down

0 comments on commit e3b2b50

Please sign in to comment.