Skip to content

Commit

Permalink
Move apply filters popover ⇒ NP (elastic#51566)
Browse files Browse the repository at this point in the history
* Move ApplyFiltersPopoverContent and applyFiltersPopover to NP

* code review
  • Loading branch information
Liza Katz committed Nov 26, 2019
1 parent e32fb65 commit 8f36b5c
Show file tree
Hide file tree
Showing 8 changed files with 1,474 additions and 87 deletions.
1,445 changes: 1,445 additions & 0 deletions src/core/MIGRATION.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import {
esFilters,
FilterManager,
TimefilterContract,
applyFiltersPopover,
changeTimeFilter,
extractTimeFilter,
} from '../../../../../../plugins/data/public';
import { applyFiltersPopover } from '../apply_filters/apply_filters_popover';
import { IndexPatternsStart } from '../../index_patterns';
export const GLOBAL_APPLY_FILTER_ACTION = 'GLOBAL_APPLY_FILTER_ACTION';

Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion src/legacy/core_plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export function plugin() {
/** @public types */
export { DataSetup, DataStart };

export { ApplyFiltersPopover } from './filter';
export {
Field,
FieldType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,12 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import React, { Component } from 'react';
import { IndexPattern } from '../../index_patterns';
import {
mapAndFlattenFilters,
esFilters,
utils,
FilterLabel,
} from '../../../../../../plugins/data/public';
import { mapAndFlattenFilters, esFilters, utils, IIndexPattern } from '../..';
import { FilterLabel } from '../filter_bar';

interface Props {
filters: esFilters.Filter[];
indexPatterns: IndexPattern[];
indexPatterns: IIndexPattern[];
onCancel: () => void;
onSubmit: (filters: esFilters.Filter[]) => void;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,25 @@
* under the License.
*/

export { ApplyFiltersPopover } from './apply_filters';
import React from 'react';
import { ApplyFiltersPopoverContent } from './apply_filter_popover_content';
import { IIndexPattern, esFilters } from '../..';

type CancelFnType = () => void;
type SubmitFnType = (filters: esFilters.Filter[]) => void;

export const applyFiltersPopover = (
filters: esFilters.Filter[],
indexPatterns: IIndexPattern[],
onCancel: CancelFnType,
onSubmit: SubmitFnType
) => {
return (
<ApplyFiltersPopoverContent
indexPatterns={indexPatterns}
filters={filters}
onCancel={onCancel}
onSubmit={onSubmit}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

export { ApplyFiltersPopover } from './apply_filters_popover';
export { applyFiltersPopover } from './apply_filters_popover';
3 changes: 2 additions & 1 deletion src/plugins/data/public/ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
* under the License.
*/

export * from './filter_bar';
export { FilterBar } from './filter_bar';
export { applyFiltersPopover } from './apply_filters';

0 comments on commit 8f36b5c

Please sign in to comment.