Skip to content

Commit

Permalink
fix circular dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierM committed Feb 14, 2020
1 parent 308f87e commit b124a8c
Show file tree
Hide file tree
Showing 73 changed files with 348 additions and 291 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { defaultColumnHeaderType } from '../timeline/body/column_headers/default_headers';
import { DEFAULT_COLUMN_MIN_WIDTH, DEFAULT_DATE_COLUMN_MIN_WIDTH } from '../timeline/body/helpers';
import { timelineDefaults, SubsetTimelineModel } from '../../store/timeline/model';
import {
DEFAULT_COLUMN_MIN_WIDTH,
DEFAULT_DATE_COLUMN_MIN_WIDTH,
} from '../timeline/body/constants';
import { ColumnHeader, SubsetTimelineModel } from '../../store/timeline/model';
import { timelineDefaults } from '../../store/timeline/defaults';

export const alertsHeaders: ColumnHeader[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { ActionCreator } from 'typescript-fsa';

import { BrowserFields, getAllFieldsByName } from '../../containers/source';
import { IdToDataProvider } from '../../store/drag_and_drop/model';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { DEFAULT_COLUMN_MIN_WIDTH } from '../timeline/body/helpers';
import { ColumnHeader } from '../../store/timeline/model';
import { DEFAULT_COLUMN_MIN_WIDTH } from '../timeline/body/constants';

import { DataProvider } from '../timeline/data_providers/data_provider';
import { dragAndDropActions, timelineActions } from '../../store/actions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ import styled from 'styled-components';
import { BrowserFields } from '../../containers/source';
import { ToStringArray } from '../../graphql/types';
import { WithCopyToClipboard } from '../../lib/clipboard/with_copy_to_clipboard';
import { ColumnHeader } from '../../store/timeline/model';
import { DragEffects } from '../drag_and_drop/draggable_wrapper';
import { DroppableWrapper } from '../drag_and_drop/droppable_wrapper';
import { getDroppableId, getDraggableFieldId, DRAG_TYPE_FIELD } from '../drag_and_drop/helpers';
import { DraggableFieldBadge } from '../draggables/field_badge';
import { FieldName } from '../fields_browser/field_name';
import { SelectableText } from '../selectable_text';
import { OverflowField } from '../tables/helpers';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { defaultColumnHeaderType } from '../timeline/body/column_headers/default_headers';
import { DEFAULT_COLUMN_MIN_WIDTH } from '../timeline/body/helpers';
import { DEFAULT_COLUMN_MIN_WIDTH } from '../timeline/body/constants';
import { MESSAGE_FIELD_NAME } from '../timeline/body/renderers/constants';
import { FormattedFieldValue } from '../timeline/body/renderers/formatted_field';
import { OnUpdateColumns } from '../timeline/events';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import styled from 'styled-components';

import { BrowserFields } from '../../containers/source';
import { DetailItem } from '../../graphql/types';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { ColumnHeader } from '../../store/timeline/model';
import { OnUpdateColumns } from '../timeline/events';
import { EventFieldsBrowser } from './event_fields_browser';
import { JsonView } from './json_view';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { sortBy } from 'lodash';
import { EuiInMemoryTable } from '@elastic/eui';
import React, { useMemo } from 'react';

import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { ColumnHeader } from '../../store/timeline/model';
import { BrowserFields, getAllFieldsByName } from '../../containers/source';
import { DetailItem } from '../../graphql/types';
import { OnUpdateColumns } from '../timeline/events';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
import { get, getOr, isEmpty, uniqBy } from 'lodash/fp';

import { BrowserField, BrowserFields } from '../../containers/source';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { DEFAULT_DATE_COLUMN_MIN_WIDTH, DEFAULT_COLUMN_MIN_WIDTH } from '../timeline/body/helpers';
import { ColumnHeader } from '../../store/timeline/model';
import {
DEFAULT_DATE_COLUMN_MIN_WIDTH,
DEFAULT_COLUMN_MIN_WIDTH,
} from '../timeline/body/constants';
import { ToStringArray } from '../../graphql/types';

import * as i18n from './translations';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import React, { useCallback, useState } from 'react';

import { BrowserFields } from '../../containers/source';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { DetailItem } from '../../graphql/types';
import { ColumnHeader } from '../../store/timeline/model';
import { OnUpdateColumns } from '../timeline/events';

import { EventDetails, View } from './event_details';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { ColumnHeader } from '../../store/timeline/model';
import { defaultColumnHeaderType } from '../timeline/body/column_headers/default_headers';
import { DEFAULT_COLUMN_MIN_WIDTH, DEFAULT_DATE_COLUMN_MIN_WIDTH } from '../timeline/body/helpers';
import {
DEFAULT_COLUMN_MIN_WIDTH,
DEFAULT_DATE_COLUMN_MIN_WIDTH,
} from '../timeline/body/constants';

export const defaultHeaders: ColumnHeader[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*/

import { defaultHeaders } from './default_headers';
import { SubsetTimelineModel, timelineDefaults } from '../../store/timeline/model';
import { SubsetTimelineModel } from '../../store/timeline/model';
import { timelineDefaults } from '../../store/timeline/defaults';

export const eventsDefaultModel: SubsetTimelineModel = {
...timelineDefaults,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ import { BrowserFields } from '../../containers/source';
import { TimelineQuery } from '../../containers/timeline';
import { Direction } from '../../graphql/types';
import { useKibana } from '../../lib/kibana';
import { KqlMode } from '../../store/timeline/model';
import { ColumnHeader, KqlMode } from '../../store/timeline/model';
import { AutoSizer } from '../auto_sizer';
import { HeaderSection } from '../header_section';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { defaultHeaders } from '../timeline/body/column_headers/default_headers';
import { Sort } from '../timeline/body/sort';
import { StatefulBody } from '../timeline/body/stateful_body';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ import { connect } from 'react-redux';
import { ActionCreator } from 'typescript-fsa';
import { inputsModel, inputsSelectors, State, timelineSelectors } from '../../store';
import { inputsActions, timelineActions } from '../../store/actions';
import { KqlMode, SubsetTimelineModel, TimelineModel } from '../../store/timeline/model';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import {
ColumnHeader,
KqlMode,
SubsetTimelineModel,
TimelineModel,
} from '../../store/timeline/model';
import { DataProvider } from '../timeline/data_providers/data_provider';
import { Sort } from '../timeline/body/sort';
import { OnChangeItemsPerPage } from '../timeline/events';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { noop } from 'lodash/fp';
import styled from 'styled-components';

import { BrowserFields } from '../../containers/source';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { ColumnHeader } from '../../store/timeline/model';
import { CategoriesPane } from './categories_pane';
import { FieldsPane } from './fields_pane';
import { Header } from './header';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import React from 'react';

import { mockBrowserFields } from '../../containers/source/mock';
import { TestProviders } from '../../mock';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { ColumnHeader } from '../../store/timeline/model';
import { defaultColumnHeaderType } from '../timeline/body/column_headers/default_headers';
import { DEFAULT_DATE_COLUMN_MIN_WIDTH } from '../timeline/body/helpers';
import { DEFAULT_DATE_COLUMN_MIN_WIDTH } from '../timeline/body/constants';

import { Category } from './category';
import { getFieldColumns, getFieldItems } from './field_items';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ import { Draggable } from 'react-beautiful-dnd';
import styled from 'styled-components';

import { BrowserField, BrowserFields } from '../../containers/source';
import { ColumnHeader } from '../../store/timeline/model';
import { DragEffects } from '../drag_and_drop/draggable_wrapper';
import { DroppableWrapper } from '../drag_and_drop/droppable_wrapper';
import { getDraggableFieldId, getDroppableId, DRAG_TYPE_FIELD } from '../drag_and_drop/helpers';
import { DraggableFieldBadge } from '../draggables/field_badge';
import { getEmptyValue } from '../empty_value';
import { getColumnsWithTimestamp, getExampleText, getIconFromType } from '../event_details/helpers';
import { SelectableText } from '../selectable_text';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { defaultColumnHeaderType } from '../timeline/body/column_headers/default_headers';
import { DEFAULT_COLUMN_MIN_WIDTH } from '../timeline/body/helpers';
import { DEFAULT_COLUMN_MIN_WIDTH } from '../timeline/body/constants';
import { OnUpdateColumns } from '../timeline/events';
import { TruncatableText } from '../truncatable_text';
import { FieldName } from './field_name';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import React, { useContext } from 'react';
import styled from 'styled-components';

import { WithCopyToClipboard } from '../../lib/clipboard/with_copy_to_clipboard';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { ColumnHeader } from '../../store/timeline/model';
import { OnUpdateColumns } from '../timeline/events';
import { TimelineContext } from '../timeline/timeline_context';
import { WithHoverActions } from '../with_hover_actions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from 'react';
import styled from 'styled-components';

import { BrowserFields } from '../../containers/source';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { ColumnHeader } from '../../store/timeline/model';

import { Category } from './category';
import { FieldBrowserProps } from './types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ActionCreator } from 'typescript-fsa';

import { BrowserFields } from '../../containers/source';
import { timelineActions } from '../../store/actions';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { ColumnHeader } from '../../store/timeline/model';
import { DEFAULT_CATEGORY_NAME } from '../timeline/body/column_headers/default_headers';
import { FieldsBrowser } from './field_browser';
import { filterBrowserFieldsByFieldName, mergeBrowserFieldsWithDefaultCategory } from './helpers';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

import { BrowserFields } from '../../containers/source';
import { ColumnHeader } from '../../store/timeline/model';
import { OnUpdateColumns } from '../timeline/events';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';

export type OnFieldSelected = (fieldId: string) => void;
export type OnHideFieldBrowser = () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import { Properties } from '../../timeline/properties';
import { appActions, appModel } from '../../../store/app';
import { inputsActions } from '../../../store/inputs';
import { timelineActions } from '../../../store/actions';
import { timelineDefaults, TimelineModel } from '../../../store/timeline/model';
import { DEFAULT_TIMELINE_WIDTH } from '../../timeline/body/helpers';
import { TimelineModel } from '../../../store/timeline/model';
import { timelineDefaults } from '../../../store/timeline/defaults';
import { DEFAULT_TIMELINE_WIDTH } from '../../timeline/body/constants';
import { InputsModelId } from '../../../store/inputs/constants';

interface OwnProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { DataProvider } from '../timeline/data_providers/data_provider';
import { FlyoutButton } from './button';
import { Pane } from './pane';
import { timelineActions } from '../../store/actions';
import { DEFAULT_TIMELINE_WIDTH } from '../timeline/body/helpers';
import { DEFAULT_TIMELINE_WIDTH } from '../timeline/body/constants';

/** The height in pixels of the flyout header, exported for use in height calculations */
export const flyoutHeaderHeight: number = 60;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { cloneDeep, omit } from 'lodash/fp';

import { mockTimelineResults } from '../../mock/timeline_results';
import { timelineDefaults } from '../../store/timeline/model';
import { timelineDefaults } from '../../store/timeline/defaults';
import {
defaultTimelineToTimelineModel,
getNotesCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ import {
addTimeline as dispatchAddTimeline,
} from '../../store/timeline/actions';

import { TimelineModel, timelineDefaults } from '../../store/timeline/model';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { ColumnHeader, TimelineModel } from '../../store/timeline/model';
import { timelineDefaults } from '../../store/timeline/defaults';
import {
defaultColumnHeaderType,
defaultHeaders,
} from '../timeline/body/column_headers/default_headers';
import { DEFAULT_DATE_COLUMN_MIN_WIDTH, DEFAULT_COLUMN_MIN_WIDTH } from '../timeline/body/helpers';
import {
DEFAULT_DATE_COLUMN_MIN_WIDTH,
DEFAULT_COLUMN_MIN_WIDTH,
} from '../timeline/body/constants';

import { OpenTimelineResult, UpdateTimeline, DispatchUpdateTimeline } from './types';
import { getTimeRangeSettings } from '../../utils/default_date_settings';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import { AllTimelinesVariables, AllTimelinesQuery } from '../../containers/timel
import { allTimelinesQuery } from '../../containers/timeline/all/index.gql_query';
import { DeleteTimelineMutation, SortFieldTimeline, Direction } from '../../graphql/types';
import { State, timelineSelectors } from '../../store';
import { timelineDefaults, TimelineModel } from '../../store/timeline/model';
import { ColumnHeader, TimelineModel } from '../../store/timeline/model';
import { timelineDefaults } from '../../store/timeline/defaults';
import {
createTimeline as dispatchCreateNewTimeline,
updateIsLoading as dispatchUpdateIsLoading,
} from '../../store/timeline/actions';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { OpenTimeline } from './open_timeline';
import { OPEN_TIMELINE_CLASS_NAME, queryTimelineById, dispatchUpdateTimeline } from './helpers';
import { OpenTimelineModalBody } from './open_timeline_modal/open_timeline_modal_body';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import { ActionCreator } from 'typescript-fsa';

import { AllTimelinesVariables } from '../../containers/timeline/all';
import { TimelineModel } from '../../store/timeline/model';
import { ColumnHeader } from '../timeline/body/column_headers/column_header';
import { ColumnHeader, TimelineModel } from '../../store/timeline/model';
import { NoteResult } from '../../graphql/types';

/** The users who added a timeline to favorites */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { mount } from 'enzyme';
import React from 'react';

import { TestProviders } from '../../../../mock';
import { DEFAULT_ACTIONS_COLUMN_WIDTH } from '../helpers';
import { DEFAULT_ACTIONS_COLUMN_WIDTH } from '../constants';

import { Actions } from '.';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import { EuiButtonIcon } from '@elastic/eui';
import React from 'react';

import { ColumnHeader } from '../../../../../store/timeline/model';
import { OnColumnRemoved } from '../../../events';
import { EventsHeadingExtra, EventsLoading } from '../../../styles';
import { useTimelineContext } from '../../../timeline_context';
import { Sort } from '../../sort';
import { ColumnHeader } from '../column_header';

import * as i18n from '../translations';

interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import React from 'react';
import { Draggable } from 'react-beautiful-dnd';
import { Resizable, ResizeCallback } from 're-resizable';

import { ColumnHeader as IColumnHeader } from '../../../../store/timeline/model';
import { DragEffects } from '../../../drag_and_drop/draggable_wrapper';
import { getDraggableFieldId, DRAG_TYPE_FIELD } from '../../../drag_and_drop/helpers';
import { DraggableFieldBadge } from '../../../draggables/field_badge';
Expand All @@ -16,29 +18,10 @@ import { Sort } from '../sort';
import { DraggingContainer } from './common/dragging_container';

import { Header } from './header';
import { ColumnId } from '../column_id';

export type ColumnHeaderType = 'not-filtered' | 'text-filter';

/** The specification of a column header */
export interface ColumnHeader {
aggregatable?: boolean;
category?: string;
columnHeaderType: ColumnHeaderType;
description?: string;
example?: string;
format?: string;
id: ColumnId;
label?: string;
linkField?: string;
placeholder?: string;
type?: string;
width: number;
}

interface ColumneHeaderProps {
draggableIndex: number;
header: ColumnHeader;
header: IColumnHeader;
onColumnRemoved: OnColumnRemoved;
onColumnSorted: OnColumnSorted;
onColumnResized: OnColumnResized;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { DEFAULT_COLUMN_MIN_WIDTH, DEFAULT_DATE_COLUMN_MIN_WIDTH } from '../helpers';

import { ColumnHeader, ColumnHeaderType } from './column_header';
import { ColumnHeader, ColumnHeaderType } from '../../../../store/timeline/model';
import { DEFAULT_COLUMN_MIN_WIDTH, DEFAULT_DATE_COLUMN_MIN_WIDTH } from '../constants';

export const defaultColumnHeaderType: ColumnHeaderType = 'not-filtered';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { mount, shallow } from 'enzyme';
import React from 'react';

import { ColumnHeaderType } from '../column_header';
import { ColumnHeaderType } from '../../../../../store/timeline/model';
import { defaultHeaders } from '../default_headers';

import { Filter } from '.';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { noop } from 'lodash/fp';
import React from 'react';

import { OnFilterChange } from '../../../events';
import { ColumnHeader } from '../column_header';
import { ColumnHeader } from '../../../../../store/timeline/model';
import { TextFilter } from '../text_filter';

interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { EuiToolTip } from '@elastic/eui';
import { noop } from 'lodash/fp';
import React from 'react';

import { ColumnHeader } from '../../../../../store/timeline/model';
import { TruncatableText } from '../../../../truncatable_text';
import { EventsHeading, EventsHeadingTitleButton, EventsHeadingTitleSpan } from '../../../styles';
import { useTimelineContext } from '../../../timeline_context';
import { Sort } from '../../sort';
import { SortIndicator } from '../../sort/sort_indicator';
import { ColumnHeader } from '../column_header';
import { HeaderToolTipContent } from '../header_tooltip_content';
import { getSortDirection } from './helpers';

Expand Down
Loading

0 comments on commit b124a8c

Please sign in to comment.