Skip to content

Commit

Permalink
Move apply filters popover ⇒ NP (#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 authored Nov 26, 2019
1 parent cfed9c6 commit 9e16839
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 88 deletions.
2 changes: 1 addition & 1 deletion src/core/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ import { setup, start } from '../core_plugins/visualizations/public/legacy';
| Legacy Platform | New Platform | Notes |
| ------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `import 'ui/apply_filters'` | `import { ApplyFiltersPopover } from '../data/public'` | Directive is deprecated. |
| `import 'ui/apply_filters'` | `import { applyFiltersPopover } from '../data/public'` | Directive is deprecated. |
| `import 'ui/filter_bar'` | `import { FilterBar } from '../data/public'` | Directive is deprecated. |
| `import 'ui/query_bar'` | `import { QueryBarInput } from '../data/public'` | Directives are deprecated. |
| `import 'ui/search_bar'` | `import { SearchBar } from '../data/public'` | Directive is deprecated. |
Expand Down
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 9e16839

Please sign in to comment.