Improved search filtering (#940)

* Filter search by collectionId

* Improve spec, remove recursive import

* Add userId filter for documents.search

* 💚

* Search filter UI

* WIP UI

* Date filtering
Prevent dupe menu

* Refactor

* button

* Added year option, improved hover states

* Add new indexes

* Remove manual string interpolation in SQL construction

* Move dateFilter validation to controller

* Fixes: Double query when changing filter
Fixes: Visual jump between filters in dropdown

* Add option to clear filters

* More clearly define dropdowns in dark mode

* Checkbox -> Checkmark
This commit is contained in:
Tom Moor
2019-04-23 07:31:20 -07:00
committed by GitHub
parent a256eba856
commit da7fdfef0a
23 changed files with 679 additions and 76 deletions

View File

@ -1,5 +1,6 @@
// @flow
import * as React from 'react';
import Tooltip from 'components/Tooltip';
import distanceInWordsToNow from 'date-fns/distance_in_words_to_now';
import format from 'date-fns/format';
@ -11,9 +12,9 @@ type Props = {
function Time({ dateTime, children }: Props) {
const date = new Date(dateTime);
return (
<time dateTime={dateTime} title={format(date, 'MMMM Do, YYYY h:mm a')}>
{children || distanceInWordsToNow(date)}
</time>
<Tooltip tooltip={format(date, 'MMMM Do, YYYY h:mm a')} placement="bottom">
<time dateTime={dateTime}>{children || distanceInWordsToNow(date)}</time>
</Tooltip>
);
}