mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Security Solution][RAC] Fixes updatedAt loading bug (#111010)
This commit is contained in:
parent
daf860c701
commit
733b17f80c
2 changed files with 20 additions and 8 deletions
|
@ -104,6 +104,9 @@ const DetectionEnginePageComponent: React.FC<DetectionEngineComponentProps> = ({
|
|||
const updatedAt = useShallowEqualSelector(
|
||||
(state) => (getTimeline(state, TimelineId.detectionsPage) ?? timelineDefaults).updated
|
||||
);
|
||||
const isAlertsLoading = useShallowEqualSelector(
|
||||
(state) => (getTimeline(state, TimelineId.detectionsPage) ?? timelineDefaults).isLoading
|
||||
);
|
||||
const getGlobalFiltersQuerySelector = useMemo(
|
||||
() => inputsSelectors.globalFiltersQuerySelector(),
|
||||
[]
|
||||
|
@ -144,6 +147,8 @@ const DetectionEnginePageComponent: React.FC<DetectionEngineComponentProps> = ({
|
|||
} = useKibana().services;
|
||||
const [filterGroup, setFilterGroup] = useState<Status>(FILTER_OPEN);
|
||||
|
||||
const showUpdating = useMemo(() => isAlertsLoading || loading, [isAlertsLoading, loading]);
|
||||
|
||||
const updateDateRangeCallback = useCallback<UpdateDateRange>(
|
||||
({ x }) => {
|
||||
if (!x) {
|
||||
|
@ -342,10 +347,11 @@ const DetectionEnginePageComponent: React.FC<DetectionEngineComponentProps> = ({
|
|||
/>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem grow={false}>
|
||||
{timelinesUi.getLastUpdated({
|
||||
updatedAt: updatedAt || 0,
|
||||
showUpdating: loading,
|
||||
})}
|
||||
{updatedAt &&
|
||||
timelinesUi.getLastUpdated({
|
||||
updatedAt: updatedAt || Date.now(),
|
||||
showUpdating,
|
||||
})}
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
<EuiSpacer size="m" />
|
||||
|
|
|
@ -180,6 +180,9 @@ const RuleDetailsPageComponent: React.FC<DetectionEngineComponentProps> = ({
|
|||
const updatedAt = useShallowEqualSelector(
|
||||
(state) => (getTimeline(state, TimelineId.detectionsPage) ?? timelineDefaults).updated
|
||||
);
|
||||
const isAlertsLoading = useShallowEqualSelector(
|
||||
(state) => (getTimeline(state, TimelineId.detectionsPage) ?? timelineDefaults).isLoading
|
||||
);
|
||||
const getGlobalFiltersQuerySelector = useMemo(
|
||||
() => inputsSelectors.globalFiltersQuerySelector(),
|
||||
[]
|
||||
|
@ -285,6 +288,8 @@ const RuleDetailsPageComponent: React.FC<DetectionEngineComponentProps> = ({
|
|||
}
|
||||
}, [hasIndexRead]);
|
||||
|
||||
const showUpdating = useMemo(() => isAlertsLoading || loading, [isAlertsLoading, loading]);
|
||||
|
||||
const title = useMemo(
|
||||
() => (
|
||||
<>
|
||||
|
@ -772,10 +777,11 @@ const RuleDetailsPageComponent: React.FC<DetectionEngineComponentProps> = ({
|
|||
/>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem grow={false}>
|
||||
{timelinesUi.getLastUpdated({
|
||||
updatedAt: updatedAt || 0,
|
||||
showUpdating: loading,
|
||||
})}
|
||||
{updatedAt &&
|
||||
timelinesUi.getLastUpdated({
|
||||
updatedAt: updatedAt || Date.now(),
|
||||
showUpdating,
|
||||
})}
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
<EuiSpacer size="l" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue