mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
chore(slo): open SLO details into new tab (#166872)
This commit is contained in:
parent
bcfcb87b57
commit
cd68eb7266
1 changed files with 10 additions and 12 deletions
|
@ -11,7 +11,6 @@ import {
|
|||
EuiContextMenuPanel,
|
||||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
EuiLink,
|
||||
EuiPanel,
|
||||
EuiPopover,
|
||||
EuiText,
|
||||
|
@ -23,6 +22,7 @@ import { useQueryClient } from '@tanstack/react-query';
|
|||
import React, { useState } from 'react';
|
||||
import { rulesLocatorID, sloFeatureId } from '../../../../common';
|
||||
import { SLO_BURN_RATE_RULE_TYPE_ID } from '../../../../common/constants';
|
||||
import { paths } from '../../../../common/locators/paths';
|
||||
import { sloKeys } from '../../../hooks/slo/query_key_factory';
|
||||
import { useCapabilities } from '../../../hooks/slo/use_capabilities';
|
||||
import { useCloneSlo } from '../../../hooks/slo/use_clone_slo';
|
||||
|
@ -30,7 +30,6 @@ import { useDeleteSlo } from '../../../hooks/slo/use_delete_slo';
|
|||
import type { SloRule } from '../../../hooks/slo/use_fetch_rules_for_slo';
|
||||
import { useGetFilteredRuleTypes } from '../../../hooks/use_get_filtered_rule_types';
|
||||
import type { RulesParams } from '../../../locators/rules';
|
||||
import { paths } from '../../../../common/locators/paths';
|
||||
import { useKibana } from '../../../utils/kibana_react';
|
||||
import {
|
||||
transformCreateSLOFormToCreateSLOInput,
|
||||
|
@ -79,15 +78,14 @@ export function SloListItem({
|
|||
setIsActionsPopoverOpen(!isActionsPopoverOpen);
|
||||
};
|
||||
|
||||
const sloDetailsUrl = basePath.prepend(
|
||||
paths.observability.sloDetails(
|
||||
slo.id,
|
||||
slo.groupBy !== ALL_VALUE && slo.instanceId ? slo.instanceId : undefined
|
||||
)
|
||||
);
|
||||
const handleViewDetails = () => {
|
||||
navigateToUrl(
|
||||
basePath.prepend(
|
||||
paths.observability.sloDetails(
|
||||
slo.id,
|
||||
slo.groupBy !== ALL_VALUE && slo.instanceId ? slo.instanceId : undefined
|
||||
)
|
||||
)
|
||||
);
|
||||
navigateToUrl(sloDetailsUrl);
|
||||
};
|
||||
|
||||
const handleEdit = () => {
|
||||
|
@ -142,9 +140,9 @@ export function SloListItem({
|
|||
<EuiFlexItem>
|
||||
<EuiText size="s">
|
||||
{slo.summary ? (
|
||||
<EuiLink data-test-subj="o11ySloListItemLink" onClick={handleViewDetails}>
|
||||
<a data-test-subj="o11ySloListItemLink" href={sloDetailsUrl}>
|
||||
{slo.name}
|
||||
</EuiLink>
|
||||
</a>
|
||||
) : (
|
||||
<span>{slo.name}</span>
|
||||
)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue