mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-04 05:39:57 -05:00
User can select from/to years when searching files. Indexing doc and docx files.
This commit is contained in:
parent
758ff8e810
commit
00fe799b8f
40 changed files with 880 additions and 159 deletions
|
|
@ -32,9 +32,9 @@ import {
|
|||
useTitle
|
||||
} from "./Common";
|
||||
import {
|
||||
useAllQuery,
|
||||
useFilesProgressInterval,
|
||||
usePages,
|
||||
useQuery,
|
||||
useSearchFiles,
|
||||
useSearchFilter,
|
||||
useSearchView,
|
||||
|
|
@ -149,7 +149,7 @@ function FileCard({file}) {
|
|||
</ExternalCardLink>
|
||||
</CardHeader>
|
||||
{author && <b {...s}>{author}</b>}
|
||||
<p>{isoDatetimeToString(file.modified)}</p>
|
||||
<p>{isoDatetimeToString(file.published_datetime) || isoDatetimeToString(file.modified)}</p>
|
||||
<p>{size}</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
|
@ -403,6 +403,9 @@ export function SearchFilter({filters = [], modalHeader, size = 'medium'}) {
|
|||
</Form.Field>
|
||||
);
|
||||
|
||||
// Use violet color when filter has been applied.
|
||||
const buttonColor = filter ? 'violet' : 'grey';
|
||||
|
||||
if (filters && filters.length > 0) {
|
||||
return <>
|
||||
<Modal open={open} onOpen={() => handleOpen()} onClose={() => setOpen(false)} closeIcon>
|
||||
|
|
@ -420,7 +423,7 @@ export function SearchFilter({filters = [], modalHeader, size = 'medium'}) {
|
|||
<Button
|
||||
icon='filter'
|
||||
onClick={handleOpen}
|
||||
primary={!!filter}
|
||||
color={buttonColor}
|
||||
size={size}
|
||||
/>
|
||||
</>
|
||||
|
|
@ -430,12 +433,11 @@ export function SearchFilter({filters = [], modalHeader, size = 'medium'}) {
|
|||
}
|
||||
|
||||
export function TagsQuerySelector({onChange}) {
|
||||
// Creates dropdown that the User can use to manipulate the tag query.
|
||||
const {searchParams, updateQuery} = useQuery();
|
||||
const activeTags = searchParams.getAll('tag');
|
||||
// Creates modal that the User can use to manipulate the tag query.
|
||||
const [activeTags, setActiveTags] = useAllQuery('tag');
|
||||
|
||||
const localOnChange = (tagNames) => {
|
||||
updateQuery({'tag': tagNames});
|
||||
setActiveTags(tagNames);
|
||||
if (onChange) {
|
||||
onChange(tagNames);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue