From 1e7abdf222d01bdf188545734a525b3e266b2603 Mon Sep 17 00:00:00 2001 From: oatkiller Date: Mon, 27 Jul 2020 16:13:11 -0400 Subject: [PATCH] spelling --- .../resolver/data_access_layer/factory.ts | 2 +- .../public/resolver/models/process_event.ts | 14 +++---- .../public/resolver/store/middleware/index.ts | 4 +- .../resolver/test_utilities/extend_jest.ts | 2 +- .../test_utilities/simulator/index.tsx | 20 ++++----- .../simulator/mock_resolver.tsx | 2 +- .../test_utilities/spy_middleware_factory.ts | 2 +- .../public/resolver/types.ts | 42 +++++++++---------- .../panels/panel_content_process_detail.tsx | 2 +- .../view/use_resolver_query_params.ts | 4 +- 10 files changed, 47 insertions(+), 47 deletions(-) diff --git a/x-pack/plugins/security_solution/public/resolver/data_access_layer/factory.ts b/x-pack/plugins/security_solution/public/resolver/data_access_layer/factory.ts index 0baab659c912d08..016ebfa0faee40b 100644 --- a/x-pack/plugins/security_solution/public/resolver/data_access_layer/factory.ts +++ b/x-pack/plugins/security_solution/public/resolver/data_access_layer/factory.ts @@ -39,7 +39,7 @@ export function dataAccessLayerFactory( }, /** - * Used to get the default index pattern from the SIEM app. + * Used to get the default index pattern from the SIEM application. */ indexPatterns(): string[] { return context.services.uiSettings.get(defaultIndexKey); diff --git a/x-pack/plugins/security_solution/public/resolver/models/process_event.ts b/x-pack/plugins/security_solution/public/resolver/models/process_event.ts index af465c77c4ba8c4..1a5c67f6a6f2ff5 100644 --- a/x-pack/plugins/security_solution/public/resolver/models/process_event.ts +++ b/x-pack/plugins/security_solution/public/resolver/models/process_event.ts @@ -29,7 +29,7 @@ export function isTerminatedProcess(passedEvent: ResolverEvent) { } /** - * ms since unix epoc, based on timestamp. + * ms since Unix epoc, based on timestamp. * may return NaN if the timestamp wasn't present or was invalid. */ export function datetime(passedEvent: ResolverEvent): number | null { @@ -85,7 +85,7 @@ export function eventType(passedEvent: ResolverEvent): ResolverProcessType { } /** - * Returns the process event's pid + * Returns the process event's PID */ export function uniquePidForProcess(passedEvent: ResolverEvent): string { if (event.isLegacyEvent(passedEvent)) { @@ -96,7 +96,7 @@ export function uniquePidForProcess(passedEvent: ResolverEvent): string { } /** - * Returns the pid for the process on the host + * Returns the PID for the process on the host */ export function processPid(passedEvent: ResolverEvent): number | undefined { if (event.isLegacyEvent(passedEvent)) { @@ -107,7 +107,7 @@ export function processPid(passedEvent: ResolverEvent): number | undefined { } /** - * Returns the process event's parent pid + * Returns the process event's parent PID */ export function uniqueParentPidForProcess(passedEvent: ResolverEvent): string | undefined { if (event.isLegacyEvent(passedEvent)) { @@ -118,7 +118,7 @@ export function uniqueParentPidForProcess(passedEvent: ResolverEvent): string | } /** - * Returns the process event's parent pid + * Returns the process event's parent PID */ export function processParentPid(passedEvent: ResolverEvent): number | undefined { if (event.isLegacyEvent(passedEvent)) { @@ -149,7 +149,7 @@ export function userInfoForProcess( } /** - * Returns the MD5 hash for the `passedEvent` param, or undefined if it can't be located + * Returns the MD5 hash for the `passedEvent` parameter, or undefined if it can't be located * @param {ResolverEvent} passedEvent The `ResolverEvent` to get the MD5 value for * @returns {string | undefined} The MD5 string for the event */ @@ -164,7 +164,7 @@ export function md5HashForProcess(passedEvent: ResolverEvent): string | undefine /** * Returns the command line path and arguments used to run the `passedEvent` if any * - * @param {ResolverEvent} passedEvent The `ResolverEvent` to get the arguemnts value for + * @param {ResolverEvent} passedEvent The `ResolverEvent` to get the arguments value for * @returns {string | undefined} The arguments (including the path) used to run the process */ export function argsForProcess(passedEvent: ResolverEvent): string | undefined { diff --git a/x-pack/plugins/security_solution/public/resolver/store/middleware/index.ts b/x-pack/plugins/security_solution/public/resolver/store/middleware/index.ts index 4ddfac12c11940d..ef6b1f5eb3c6f79 100644 --- a/x-pack/plugins/security_solution/public/resolver/store/middleware/index.ts +++ b/x-pack/plugins/security_solution/public/resolver/store/middleware/index.ts @@ -17,9 +17,9 @@ type MiddlewareFactory = ( ) => (next: Dispatch) => (action: ResolverAction) => unknown; /** - * The redux middleware that the app uses to trigger side effects. + * The `redux` middleware that the application uses to trigger side effects. * All data fetching should be done here. - * For actions that the app triggers directly, use `app` as a prefix for the type. + * For actions that the application triggers directly, use `app` as a prefix for the type. * For actions that are triggered as a result of server interaction, use `server` as a prefix for the type. */ export const resolverMiddlewareFactory: MiddlewareFactory = (dataAccessLayer: DataAccessLayer) => { diff --git a/x-pack/plugins/security_solution/public/resolver/test_utilities/extend_jest.ts b/x-pack/plugins/security_solution/public/resolver/test_utilities/extend_jest.ts index 1f72525ac4e2957..f244a6481fdd3cd 100644 --- a/x-pack/plugins/security_solution/public/resolver/test_utilities/extend_jest.ts +++ b/x-pack/plugins/security_solution/public/resolver/test_utilities/extend_jest.ts @@ -46,7 +46,7 @@ expect.extend({ // Set to true if the test passes. let pass: boolean = false; - // Aysync iterate over the iterable + // Async iterate over the iterable for await (const received of receivedIterable) { // keep track of the last value. Used in both pass and fail messages lastReceived = received; diff --git a/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/index.tsx b/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/index.tsx index 383d3dc432560e6..94b92e62e1f4a42 100644 --- a/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/index.tsx +++ b/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/index.tsx @@ -23,7 +23,7 @@ import { ResolverAction } from '../../store/actions'; */ export class Simulator { /** - * A string that uniquely identifies this Resolver instance amoung others mounted in the DOM. + * A string that uniquely identifies this Resolver instance among others mounted in the DOM. */ private readonly resolverComponentInstanceID: string; /** @@ -54,7 +54,7 @@ export class Simulator { */ dataAccessLayer: DataAccessLayer; /** - * A string that uniquely identifies this Resolver instance amoung others mounted in the DOM. + * A string that uniquely identifies this Resolver instance among others mounted in the DOM. */ resolverComponentInstanceID: string; /** @@ -76,13 +76,13 @@ export class Simulator { this.spyMiddleware.middleware ); - // Create a redux store w/ the top level Resolver reducer and the enhancer that includes the Resolver middleware and the spyMiddleware + // Create a redux store w/ the top level Resolver reducer and the enhancer that includes the Resolver middleware and the `spyMiddleware` this.store = createStore(resolverReducer, middlewareEnhancer); // Create a fake 'history' instance that Resolver will use to read and write query string values this.history = createMemoryHistory(); - // Used for KibanaContextProvider + // Used for `KibanaContextProvider` const coreStart: CoreStart = coreMock.createStart(); // Render Resolver via the `MockResolver` component, using `enzyme`. @@ -121,7 +121,7 @@ export class Simulator { let resolveState: (() => void) | null = null; const promise: Promise = new Promise((resolve) => { - // immedatiely expose the resolve function in the outer scope. it will be resolved when the next state transition occurs. + // Immediately expose the resolve function in the outer scope. It will be resolved when the next state transition occurs. resolveState = resolve; }); @@ -150,16 +150,16 @@ export class Simulator { * * Code will test assertions after each state transition. If the assertion hasn't passed and no further state transitions occur, * then the jest timeout will happen. The timeout doesn't give a useful message about the assertion. - * By shortcircuiting this function, code that uses it can short circuit the test timeout and print a useful error message. + * By short-circuiting this function, code that uses it can short circuit the test timeout and print a useful error message. * - * NB: the logic to shortcircuit the loop is here because knowledge of state is a concern of the simulator, not tests. + * NB: the logic to short-circuit the loop is here because knowledge of state is a concern of the simulator, not tests. */ let timeoutCount = 0; while (true) { /** * `await` a race between the next state transition and a timeout that happens after `0`ms. * If the timeout wins, no `dispatch` call caused a state transition in the last loop. - * If this keeps happening, assume that Resolver isn't going to do anythig else. + * If this keeps happening, assume that Resolver isn't going to do anything else. * * If Resolver adds intentional delay logic (e.g. waiting before making a request), this code might have to change. * In that case, Resolver should use the side effect context to schedule future work. This code could then subscribe to some event published by the side effect context. That way, this code will be aware of Resolver's intention to do work. @@ -186,7 +186,7 @@ export class Simulator { return; } } else { - // If a state transition occurs, reset the timout count and yield the value + // If a state transition occurs, reset the timeout count and yield the value timeoutCount = 0; yield mapper(); } @@ -263,7 +263,7 @@ const baseResolverSelector = '[data-test-subj="resolver:node"]'; interface ProcessNodeElementSelectorOptions { /** - * Entity ID of the node. If passed, will be used to create an data-attribtue CSS selector that should only get the related node element. + * Entity ID of the node. If passed, will be used to create an data-attribute CSS selector that should only get the related node element. */ entityID?: string; /** diff --git a/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx b/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx index b112e9ebbdce9d6..36bb2a5ffc9fe9f 100644 --- a/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx +++ b/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx @@ -30,7 +30,7 @@ type MockResolverProps = { */ rasterHeight?: number; /** - * Used for the KibanaContextProvider + * Used for the `KibanaContextProvider` */ coreStart: CoreStart; /** diff --git a/x-pack/plugins/security_solution/public/resolver/test_utilities/spy_middleware_factory.ts b/x-pack/plugins/security_solution/public/resolver/test_utilities/spy_middleware_factory.ts index aea914e4c32d923..4e70740df9025ec 100644 --- a/x-pack/plugins/security_solution/public/resolver/test_utilities/spy_middleware_factory.ts +++ b/x-pack/plugins/security_solution/public/resolver/test_utilities/spy_middleware_factory.ts @@ -9,7 +9,7 @@ import { SpyMiddleware, SpyMiddlewareStateActionPair } from '../types'; /** * Return a `SpyMiddleware` to be used in testing. Use `debugActions` to console.log actions and the state they produced. - * For reducer/middleware tests, you can use `actions` to get access to each dispatched action along w/ the state it produced. + * For reducer/middleware tests, you can use `actions` to get access to each dispatched action along with the state it produced. */ export const spyMiddlewareFactory: () => SpyMiddleware = () => { const resolvers: Set<(stateActionPair: SpyMiddlewareStateActionPair) => void> = new Set(); diff --git a/x-pack/plugins/security_solution/public/resolver/types.ts b/x-pack/plugins/security_solution/public/resolver/types.ts index 0a1e7b4202bfbad..38e0cd04835592c 100644 --- a/x-pack/plugins/security_solution/public/resolver/types.ts +++ b/x-pack/plugins/security_solution/public/resolver/types.ts @@ -38,21 +38,21 @@ export interface ResolverState { } /** - * Piece of redux state that models an animation for the camera. + * Piece of `redux` state that models an animation for the camera. */ export interface ResolverUIState { /** - * The nodeID for the process that is selected (in the aria-activedescendent sense of being selected.) + * The `nodeID` for the process that is selected (in the `aria-activedescendent` sense of being selected.) */ readonly ariaActiveDescendant: string | null; /** - * nodeID of the selected node + * `nodeID` of the selected node */ readonly selectedNode: string | null; } /** - * Piece of redux state that models an animation for the camera. + * Piece of `redux` state that models an animation for the camera. */ export interface CameraAnimationState { /** @@ -76,7 +76,7 @@ export interface CameraAnimationState { } /** - * The redux state for the `useCamera` hook. + * The `redux` state for the `useCamera` hook. */ export type CameraState = { /** @@ -96,7 +96,7 @@ export type CameraState = { readonly translationNotCountingCurrentPanning: Vector2; /** - * The world coordinates that the pointing device was last over. This is used during mousewheel zoom. + * The world coordinates that the pointing device was last over. This is used during mouse-wheel zoom. */ readonly latestFocusedWorldCoordinates: Vector2 | null; } & ( @@ -143,7 +143,7 @@ export type CameraState = { export type IndexedEntity = IndexedEdgeLineSegment | IndexedProcessNode; /** - * The entity stored in rbush for resolver edge lines. + * The entity stored in `rbush` for resolver edge lines. */ export interface IndexedEdgeLineSegment extends BBox { type: 'edgeLine'; @@ -151,7 +151,7 @@ export interface IndexedEdgeLineSegment extends BBox { } /** - * The entity store in rbush for resolver process nodes. + * The entity store in `rbush` for resolver process nodes. */ export interface IndexedProcessNode extends BBox { type: 'processNode'; @@ -168,7 +168,7 @@ export interface VisibleEntites { } /** - * State for `data` reducer which handles receiving Resolver data from the backend. + * State for `data` reducer which handles receiving Resolver data from the back-end. */ export interface DataState { readonly relatedEvents: Map; @@ -221,11 +221,11 @@ export type Vector2 = readonly [number, number]; */ export interface AABB { /** - * Vector who's `x` component is the _left_ side of the AABB and who's `y` component is the _bottom_ side of the AABB. + * Vector who's `x` component is the _left_ side of the `AABB` and who's `y` component is the _bottom_ side of the `AABB`. **/ readonly minimum: Vector2; /** - * Vector who's `x` component is the _right_ side of the AABB and who's `y` component is the _bottom_ side of the AABB. + * Vector who's `x` component is the _right_ side of the `AABB` and who's `y` component is the _bottom_ side of the `AABB`. **/ readonly maximum: Vector2; } @@ -274,7 +274,7 @@ export interface ProcessEvent { } /** - * A represention of a process tree with indices for O(1) access to children and values by id. + * A representation of a process tree with indices for O(1) access to children and values by id. */ export interface IndexedProcessTree { /** @@ -288,7 +288,7 @@ export interface IndexedProcessTree { } /** - * A map of ProcessEvents (representing process nodes) to the 'width' of their subtrees as calculated by `widthsOfProcessSubtrees` + * A map of `ProcessEvents` (representing process nodes) to the 'width' of their subtrees as calculated by `widthsOfProcessSubtrees` */ export type ProcessWidths = Map; /** @@ -326,16 +326,16 @@ export interface DurationDetails { */ export interface EdgeLineMetadata { elapsedTime?: DurationDetails; - // A string of the two joined process nodes concatted together. + // A string of the two joined process nodes concatenated together. uniqueId: string; } /** - * A tuple of 2 vector2 points forming a polyline. Used to connect process nodes in the graph. + * A tuple of 2 vector2 points forming a poly-line. Used to connect process nodes in the graph. */ export type EdgeLinePoints = Vector2[]; /** - * Edge line components including the points joining the edgeline and any optional associated metadata + * Edge line components including the points joining the edge-line and any optional associated metadata */ export interface EdgeLineSegment { points: EdgeLinePoints; @@ -343,7 +343,7 @@ export interface EdgeLineSegment { } /** - * Used to provide precalculated info from `widthsOfProcessSubtrees`. These 'width' values are used in the layout of the graph. + * Used to provide pre-calculated info from `widthsOfProcessSubtrees`. These 'width' values are used in the layout of the graph. */ export type ProcessWithWidthMetadata = { process: ResolverEvent; @@ -431,11 +431,11 @@ export type ResolverStore = Store; */ export interface IsometricTaxiLayout { /** - * A map of events to position. each event represents its own node. + * A map of events to position. Each event represents its own node. */ processNodePositions: Map; /** - * A map of edgline segments, which graphically connect nodes. + * A map of edge-line segments, which graphically connect nodes. */ edgeLineSegments: EdgeLineSegment[]; @@ -494,8 +494,8 @@ export interface ResolverProps { */ databaseDocumentID?: string; /** - * A string literal describing where in the app resolver is located, - * used to prevent collisions in things like query params + * A string literal describing where in the application resolver is located. + * Used to prevent collisions in things like query parameters. */ resolverComponentInstanceID: string; } diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/panel_content_process_detail.tsx b/x-pack/plugins/security_solution/public/resolver/view/panels/panel_content_process_detail.tsx index 7cceb846db0adcf..c8bcc468e717aa9 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/panels/panel_content_process_detail.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/panels/panel_content_process_detail.tsx @@ -37,7 +37,7 @@ const StyledDescriptionList = styled(EuiDescriptionList)` /** * A description list view of all the Metadata that goes with a particular process event, like: - * Created, Pid, User/Domain, etc. + * Created, PID, User/Domain, etc. */ export const ProcessDetails = memo(function ProcessDetails({ processEvent, diff --git a/x-pack/plugins/security_solution/public/resolver/view/use_resolver_query_params.ts b/x-pack/plugins/security_solution/public/resolver/view/use_resolver_query_params.ts index 5247e30c7749c3f..ed514a61d4e0689 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/use_resolver_query_params.ts +++ b/x-pack/plugins/security_solution/public/resolver/view/use_resolver_query_params.ts @@ -24,8 +24,8 @@ export function useResolverQueryParams() { const uniqueCrumbEventKey: string = `resolver-${resolverComponentInstanceID}-event`; const pushToQueryParams = useCallback( (newCrumbs: CrumbInfo) => { - // Construct a new set of params from the current set (minus empty params) - // by assigning the new set of params provided in `newCrumbs` + // Construct a new set of parameters from the current set (minus empty parameters) + // by assigning the new set of parameters provided in `newCrumbs` const crumbsToPass = { ...querystring.parse(urlSearch.slice(1)), [uniqueCrumbIdKey]: newCrumbs.crumbId,