Skip to content

Commit e5933fb

Browse files
committed
Adjusted types to use ConsoleResponseActionCommands
1 parent 5c94daf commit e5933fb

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/hooks.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import type {
1111
OnRefreshChangeProps,
1212
} from '@elastic/eui/src/components/date_picker/types';
1313
import type {
14+
ConsoleResponseActionCommands,
1415
ResponseActionsApiCommandNames,
1516
ResponseActionStatus,
1617
} from '../../../../../common/endpoint/service/response_actions/constants';
@@ -132,10 +133,7 @@ export const getActionStatus = (status: ResponseActionStatus): string => {
132133
*/
133134
export const getUiCommand = (
134135
command: ResponseActionsApiCommandNames
135-
):
136-
| Exclude<ResponseActionsApiCommandNames, 'unisolate' | 'running-processes'>
137-
| 'release'
138-
| 'processes' => {
136+
): ConsoleResponseActionCommands => {
139137
if (command === 'unisolate') {
140138
return 'release';
141139
} else if (command === 'running-processes') {
@@ -151,10 +149,7 @@ export const getUiCommand = (
151149
* processes -> running-processes
152150
*/
153151
export const getCommandKey = (
154-
uiCommand:
155-
| Exclude<ResponseActionsApiCommandNames, 'unisolate' | 'running-processes'>
156-
| 'release'
157-
| 'processes'
152+
uiCommand: ConsoleResponseActionCommands
158153
): ResponseActionsApiCommandNames => {
159154
if (uiCommand === 'release') {
160155
return 'unisolate';

x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/use_action_history_url_params.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77
import { useCallback, useEffect, useMemo, useState } from 'react';
88
import { useHistory, useLocation } from 'react-router-dom';
9+
import type { ConsoleResponseActionCommands } from '../../../../../common/endpoint/service/response_actions/constants';
910
import {
1011
RESPONSE_ACTION_API_COMMANDS_NAMES,
1112
RESPONSE_ACTION_STATUS,
@@ -24,11 +25,7 @@ interface UrlParamsActionsLogFilters {
2425
}
2526

2627
interface ActionsLogFiltersFromUrlParams {
27-
commands?: Array<
28-
| Exclude<ResponseActionsApiCommandNames, 'unisolate' | 'running-processes'>
29-
| 'release'
30-
| 'processes'
31-
>;
28+
commands?: ConsoleResponseActionCommands[];
3229
hosts?: string[];
3330
statuses?: ResponseActionStatus[];
3431
startDate?: string;

0 commit comments

Comments
 (0)