[8.12] [RAM] Fix o11y view in app (#172740) (#172823)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[RAM] Fix o11y view in app
(#172740)](https://github.com/elastic/kibana/pull/172740)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Xavier
Mouligneau","email":"xavier.mouligneau@elastic.co"},"sourceCommit":{"committedDate":"2023-12-07T14:00:49Z","message":"[RAM]
Fix o11y view in app (#172740)\n\n## Summary\r\n\r\nFix ->
https://github.com/elastic/kibana/issues/166982","sha":"ba27a25ec78a8e9b2afa63add5b48d07e33ac9bb","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","high","release_note:skip","Team:ResponseOps","v8.12.0","Team:obs-ux-management","v8.11.2","v8.13.0"],"number":172740,"url":"https://github.com/elastic/kibana/pull/172740","mergeCommit":{"message":"[RAM]
Fix o11y view in app (#172740)\n\n## Summary\r\n\r\nFix ->
https://github.com/elastic/kibana/issues/166982","sha":"ba27a25ec78a8e9b2afa63add5b48d07e33ac9bb"}},"sourceBranch":"main","suggestedTargetBranches":["8.12","8.11"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.11","label":"v8.11.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172740","number":172740,"mergeCommit":{"message":"[RAM]
Fix o11y view in app (#172740)\n\n## Summary\r\n\r\nFix ->
https://github.com/elastic/kibana/issues/166982","sha":"ba27a25ec78a8e9b2afa63add5b48d07e33ac9bb"}}]}]
BACKPORT-->

Co-authored-by: Xavier Mouligneau <xavier.mouligneau@elastic.co>
This commit is contained in:
Kibana Machine 2023-12-07 10:17:08 -05:00 committed by GitHub
parent 3b1f89257d
commit 1806937483
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,13 +79,13 @@ export function AlertActions({
const observabilityAlert = parseObservabilityAlert(alert);
useEffect(() => {
const alertLink = alert.link as unknown as string;
if (!alert.hasBasePath) {
const alertLink = observabilityAlert.link as unknown as string;
if (!observabilityAlert.hasBasePath) {
setViewInAppUrl(prepend(alertLink ?? ''));
} else {
setViewInAppUrl(alertLink);
}
}, [alert.hasBasePath, alert.link, prepend]);
}, [observabilityAlert.hasBasePath, observabilityAlert.link, prepend]);
const [isPopoverOpen, setIsPopoverOpen] = useState<boolean>(false);