mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Remove change to Direction's definition in generated file, resolve resulting TS issues by casting (#53607)
This commit is contained in:
parent
d6a19f1a12
commit
665c962c91
7 changed files with 26 additions and 17 deletions
|
@ -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({
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
@ -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({
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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';
|
||||
|
@ -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({
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
@ -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({
|
||||
|
|
|
@ -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 {
|
||||
|
@ -54,7 +52,7 @@ export interface PaginationInput {
|
|||
export interface SortField {
|
||||
sortFieldId: string;
|
||||
|
||||
direction: Direction | EuiDirection;
|
||||
direction: Direction;
|
||||
}
|
||||
|
||||
export interface LastTimeDetails {
|
||||
|
@ -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 {
|
||||
|
@ -94,7 +92,7 @@ export interface NetworkHttpSortField {
|
|||
export interface TlsSortField {
|
||||
field: TlsFields;
|
||||
|
||||
direction: Direction | EuiDirection;
|
||||
direction: Direction;
|
||||
}
|
||||
|
||||
export interface PageInfoTimeline {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue