Skip to content

Commit abf69d4

Browse files
author
Brent Kimmel
committed
Draft: Separate limit information
1 parent a46560e commit abf69d4

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

x-pack/plugins/security_solution/public/resolver/store/data/action.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import {
1313
interface ServerReturnedResolverData {
1414
readonly type: 'serverReturnedResolverData';
1515
readonly payload: {
16-
readonly events: ResolverEvent[];
17-
readonly stats: Map<string, ResolverNodeStats>;
18-
readonly limitReached: boolean;
16+
readonly events: Readonly<ResolverEvent[]>;
17+
readonly stats: Readonly<Map<string, ResolverNodeStats>>;
18+
readonly lineageLimits: { readonly children: string | null; readonly ancestors: string | null };
1919
};
2020
}
2121

x-pack/plugins/security_solution/public/resolver/store/data/reducer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ function initialState(): DataState {
1313
relatedEventsStats: new Map(),
1414
relatedEvents: new Map(),
1515
relatedEventsReady: new Map(),
16+
lineageLimits: { children: null, ancestors: null },
1617
isLoading: false,
1718
hasError: false,
1819
};
@@ -24,7 +25,7 @@ export const dataReducer: Reducer<DataState, ResolverAction> = (state = initialS
2425
...state,
2526
results: action.payload.events,
2627
relatedEventsStats: action.payload.stats,
27-
limitReached: action.payload.limitReached,
28+
lineageLimits: action.payload.lineageLimits,
2829
isLoading: false,
2930
hasError: false,
3031
};

x-pack/plugins/security_solution/public/resolver/store/middleware.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ export const resolverMiddlewareFactory: MiddlewareFactory = (context) => {
7777
}
7878
const nodeStats: Map<string, ResolverNodeStats> = new Map();
7979
nodeStats.set(entityId, stats);
80-
const limitReached = children.nextChild !== null || ancestry.nextAncestor !== null;
80+
const lineageLimits = { children: children.nextChild, ancestors: ancestry.nextAncestor };
81+
8182
const events = [
8283
...lifecycle,
8384
...getLifecycleEventsAndStats(children.childNodes, nodeStats),
@@ -88,7 +89,7 @@ export const resolverMiddlewareFactory: MiddlewareFactory = (context) => {
8889
payload: {
8990
events,
9091
stats: nodeStats,
91-
limitReached,
92+
lineageLimits,
9293
},
9394
});
9495
} catch (error) {

x-pack/plugins/security_solution/public/resolver/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,10 @@ export type CameraState = {
147147
*/
148148
export interface DataState {
149149
readonly results: readonly ResolverEvent[];
150-
readonly relatedEventsStats: Map<string, ResolverNodeStats>;
150+
readonly relatedEventsStats: Readonly<Map<string, ResolverNodeStats>>;
151151
readonly relatedEvents: Map<string, ResolverRelatedEvents>;
152152
readonly relatedEventsReady: Map<string, boolean>;
153+
readonly lineageLimits: Readonly<{ children: string | null; ancestors: string | null }>;
153154
isLoading: boolean;
154155
hasError: boolean;
155156
}

0 commit comments

Comments
 (0)