Skip to content

Commit

Permalink
Allow filters without index
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza K committed Jun 4, 2020
1 parent 0493978 commit 2e4dc1d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/data/public/ui/filter_bar/filter_item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export function FilterItem(props: Props) {
setIndexPatternExists(false);
});
} else {
setIndexPatternExists(false);
// Allow filters without an index pattern and don't validate them.
setIndexPatternExists(true);
}
}, [props.filter.meta.index]);

Expand Down
5 changes: 5 additions & 0 deletions test/functional/apps/dashboard/dashboard_filter_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ export default function ({ getService, getPageObjects }) {
const hasWarningFieldFilter = await filterBar.hasFilter('extension', 'warn', true);
expect(hasWarningFieldFilter).to.be(true);
});

it('filter without an index pattern is rendred normally', async function () {
const noIndexPatternFilter = await filterBar.hasFilter('banana', 'yellow', true);
expect(noIndexPatternFilter).to.be(true);
});
});
});
}
Binary file not shown.

0 comments on commit 2e4dc1d

Please sign in to comment.