Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert changes to a generated file #53607

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const HostsTableComponent = React.memo<HostsTableProps>(
if (criteria.sort != null) {
const sort: HostsSortField = {
field: getSortField(criteria.sort.field),
direction: criteria.sort.direction,
direction: criteria.sort.direction as Direction,
};
if (sort.direction !== direction || sort.field !== sortField) {
updateHostsSort({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ import { connect } from 'react-redux';
import { ActionCreator } from 'typescript-fsa';

import { networkActions } from '../../../../store/actions';
import { NetworkDnsEdges, NetworkDnsFields, NetworkDnsSortField } from '../../../../graphql/types';
import {
Direction,
NetworkDnsEdges,
NetworkDnsFields,
NetworkDnsSortField,
} from '../../../../graphql/types';
import { networkModel, networkSelectors, State } from '../../../../store';
import { Criteria, ItemsPerRow, PaginatedTable } from '../../../paginated_table';

Expand Down Expand Up @@ -102,7 +107,7 @@ export const NetworkDnsTableComponent = React.memo<NetworkDnsTableProps>(
if (criteria.sort != null) {
const newDnsSortField: NetworkDnsSortField = {
field: criteria.sort.field.split('.')[1] as NetworkDnsFields,
direction: criteria.sort.direction,
direction: criteria.sort.direction as Direction,
};
if (!isEqual(newDnsSortField, sort)) {
updateNetworkTable({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const NetworkTopCountriesTableComponent = React.memo<NetworkTopCountriesTablePro
lastField !== sort.field ? Direction.desc : criteria.sort.direction; // sort by desc on init click
const newTopCountriesSort: NetworkTopTablesSortField = {
field: lastField as NetworkTopTablesFields,
direction: newSortDirection,
direction: newSortDirection as Direction,
};
if (!isEqual(newTopCountriesSort, sort)) {
updateNetworkTable({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const NetworkTopNFlowTableComponent = React.memo<NetworkTopNFlowTableProps>(
const newSortDirection = field !== sort.field ? Direction.desc : criteria.sort.direction; // sort by desc on init click
const newTopNFlowSort: NetworkTopTablesSortField = {
field: field as NetworkTopTablesFields,
direction: newSortDirection,
direction: newSortDirection as Direction,
};
if (!isEqual(newTopNFlowSort, sort)) {
updateNetworkTable({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { compose } from 'redux';
import { ActionCreator } from 'typescript-fsa';

import { networkActions } from '../../../../store/network';
import { TlsEdges, TlsSortField, TlsFields } from '../../../../graphql/types';
import { TlsEdges, TlsSortField, TlsFields, Direction } from '../../../../graphql/types';
import { networkModel, networkSelectors, State } from '../../../../store';
import { Criteria, ItemsPerRow, PaginatedTable, SortingBasicTable } from '../../../paginated_table';
import { getTlsColumns } from './columns';
Expand Down Expand Up @@ -105,7 +105,7 @@ const TlsTableComponent = React.memo<TlsTableProps>(
const splitField = criteria.sort.field.split('.');
const newTlsSort: TlsSortField = {
field: getSortFromString(splitField[splitField.length - 1]),
direction: criteria.sort.direction,
direction: criteria.sort.direction as Direction,
};
if (!isEqual(newTlsSort, sort)) {
updateNetworkTable({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ import { connect } from 'react-redux';
import { ActionCreator } from 'typescript-fsa';

import { networkActions } from '../../../../store/network';
import { FlowTarget, UsersEdges, UsersFields, UsersSortField } from '../../../../graphql/types';
import {
Direction,
FlowTarget,
UsersEdges,
UsersFields,
UsersSortField,
} from '../../../../graphql/types';
import { networkModel, networkSelectors, State } from '../../../../store';
import { Criteria, ItemsPerRow, PaginatedTable, SortingBasicTable } from '../../../paginated_table';

Expand Down Expand Up @@ -104,7 +110,7 @@ const UsersTableComponent = React.memo<UsersTableProps>(
const splitField = criteria.sort.field.split('.');
const newUsersSort: UsersSortField = {
field: getSortFromString(splitField[splitField.length - 1]),
direction: criteria.sort.direction,
direction: criteria.sort.direction as Direction,
};
if (!isEqual(newUsersSort, sort)) {
updateNetworkTable({
Expand Down
14 changes: 6 additions & 8 deletions x-pack/legacy/plugins/siem/public/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Direction as EuiDirection } from '@elastic/eui';

export type Maybe<T> = T | null;

export interface PageInfoNote {
Expand Down Expand Up @@ -54,7 +52,7 @@ export interface PaginationInput {
export interface SortField {
sortFieldId: string;

direction: Direction | EuiDirection;
direction: Direction;
}

export interface LastTimeDetails {
Expand All @@ -66,25 +64,25 @@ export interface LastTimeDetails {
export interface HostsSortField {
field: HostsFields;

direction: Direction | EuiDirection;
direction: Direction;
}

export interface UsersSortField {
field: UsersFields;

direction: Direction | EuiDirection;
direction: Direction;
}

export interface NetworkTopTablesSortField {
field: NetworkTopTablesFields;

direction: Direction | EuiDirection;
direction: Direction;
}

export interface NetworkDnsSortField {
field: NetworkDnsFields;

direction: Direction | EuiDirection;
direction: Direction;
}

export interface NetworkHttpSortField {
Expand All @@ -94,7 +92,7 @@ export interface NetworkHttpSortField {
export interface TlsSortField {
field: TlsFields;

direction: Direction | EuiDirection;
direction: Direction;
}

export interface PageInfoTimeline {
Expand Down