Skip to content

Commit

Permalink
fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwizp committed Apr 13, 2020
1 parent 82e3788 commit 4304089
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

import React, { useState, useCallback } from 'react';
import PropTypes from 'prop-types';

import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
Expand Down Expand Up @@ -62,7 +61,3 @@ export const AddFilter = ({ onAddFilter }: AddFilterProps) => {
</EuiFlexGroup>
);
};

AddFilter.propTypes = {
onAddFilter: PropTypes.func.isRequired,
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

import React, { Component } from 'react';
import PropTypes from 'prop-types';

import {
keyCodes,
Expand Down Expand Up @@ -84,15 +83,6 @@ export interface TableState {
}

export class Table extends Component<TableProps, TableState> {
static propTypes = {
indexPattern: PropTypes.object.isRequired,
items: PropTypes.array.isRequired,
deleteFilter: PropTypes.func.isRequired,
fieldWildcardMatcher: PropTypes.func.isRequired,
saveFilter: PropTypes.func.isRequired,
isSaving: PropTypes.bool.isRequired,
};

constructor(props: TableProps) {
super(props);
this.state = {
Expand Down Expand Up @@ -155,16 +145,13 @@ export class Table extends Component<TableProps, TableState> {
dataType: 'string',
sortable: true,
render: (value, filter) => {
const wildcardMatcher = fieldWildcardMatcher([
this.state.editingFilterId === filter.clientId ? this.state.editingFilterValue : value,
]);
const matches = indexPattern
.getNonScriptedFields()
.map((currentFilter: any) => currentFilter.name)
.filter(
fieldWildcardMatcher([
this.state.editingFilterId === filter.clientId
? this.state.editingFilterValue
: value,
])
)
.filter(wildcardMatcher)
.sort();

if (matches.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { createSelector } from 'reselect';

import { EuiSpacer } from '@elastic/eui';
Expand All @@ -44,13 +43,6 @@ export class SourceFiltersTable extends Component<
SourceFiltersTableProps,
SourceFiltersTableState
> {
static propTypes = {
indexPattern: PropTypes.object.isRequired,
filterFilter: PropTypes.string,
fieldWildcardMatcher: PropTypes.func.isRequired,
onAddOrRemoveFilter: PropTypes.func,
};

// Source filters do not have any unique ids, only the value is stored.
// To ensure we can create a consistent and expected UX when managing
// source filters, we are assigning a unique id to each filter on the
Expand Down

0 comments on commit 4304089

Please sign in to comment.