mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Clicking link in host/user flyout does not refresh details panel (#209863)
## Summary This PR fixes the issue of navigation link behaviour not updating after first click/update. ## Testing Steps 1. Kibana - 8.18 2. Generate some data using data generator and alerts. 3. Enable Risk Score 4. Go to Security -> Alerts 5. Open Host Flyout of a host with risk score 6. Click alert/risk summary link, then click the other one and observe the tab on the left and content change in response ✅ ### Screen Recordings #### Host Selected https://github.com/user-attachments/assets/ac071adc-8255-496e-956b-cf727191cbe3 #### User Selected https://github.com/user-attachments/assets/ab10a640-964d-457f-9ff3-198c19641889 Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
d2070ca724
commit
8c7714a611
1 changed files with 7 additions and 2 deletions
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import React, { useEffect, useMemo, useState } from 'react';
|
||||
import type { FlyoutPanelProps } from '@kbn/expandable-flyout';
|
||||
import { EntityIdentifierFields, EntityType } from '../../../../common/entity_analytics/types';
|
||||
import {
|
||||
|
@ -52,12 +52,17 @@ export const HostDetailsPanel = ({
|
|||
: EntityDetailsLeftPanelTab.RISK_INPUTS
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (path?.tab && path.tab !== selectedTabId) {
|
||||
setSelectedTabId(path.tab);
|
||||
}
|
||||
}, [path?.tab, selectedTabId]);
|
||||
|
||||
const [tabs] = useMemo(() => {
|
||||
const isRiskScoreTabAvailable = isRiskScoreExist && name;
|
||||
const riskScoreTab = isRiskScoreTabAvailable
|
||||
? [getRiskInputTab({ entityName: name, entityType: EntityType.host, scopeId })]
|
||||
: [];
|
||||
|
||||
// Determine if the Insights tab should be included
|
||||
const insightsTab =
|
||||
hasMisconfigurationFindings || hasVulnerabilitiesFindings || hasNonClosedAlerts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue