-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Column sort asc/desc for tag list (#581)
- Loading branch information
Showing
9 changed files
with
353 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from enum import Enum | ||
|
||
from papermerge.core.types import PaginatedQueryParams as BaseParams | ||
|
||
|
||
class OrderBy(str, Enum): | ||
name_asc = "name" | ||
name_desc = "-name" | ||
pinned_asc = "pinned" | ||
pinned_desc = "-pinned" | ||
description_asc = "description" | ||
description_desc = "-description" | ||
id_asc = "ID" | ||
id_desc = "-ID" | ||
|
||
|
||
class PaginatedQueryParams(BaseParams): | ||
order_by: OrderBy | None = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,40 @@ | ||
import QuickFilter from "@/components/QuickFilter" | ||
import {selectFilterText, selectSelectedIds} from "@/features/tags/tagsSlice" | ||
import {Group, Loader} from "@mantine/core" | ||
import {useSelector} from "react-redux" | ||
import {Group} from "@mantine/core" | ||
import {selectSelectedIds} from "@/features/tags/tagsSlice" | ||
import NewButton from "./NewButton" | ||
import EditButton from "./EditButton" | ||
import {DeleteTagsButton} from "./DeleteButton" | ||
import EditButton from "./EditButton" | ||
import NewButton from "./NewButton" | ||
|
||
interface Args { | ||
isFetching?: boolean | ||
onQuickFilterChange: (value: string) => void | ||
onQuickFilterClear: () => void | ||
} | ||
|
||
export default function ActionButtons() { | ||
export default function ActionButtons({ | ||
isFetching, | ||
onQuickFilterChange, | ||
onQuickFilterClear | ||
}: Args) { | ||
const selectedIds = useSelector(selectSelectedIds) | ||
const filterText = useSelector(selectFilterText) | ||
|
||
return ( | ||
<Group> | ||
<NewButton /> | ||
{selectedIds.length == 1 ? <EditButton tagId={selectedIds[0]} /> : ""} | ||
{selectedIds.length >= 1 ? <DeleteTagsButton /> : ""} | ||
<Group justify="space-between"> | ||
<Group> | ||
<NewButton /> | ||
{selectedIds.length == 1 ? <EditButton tagId={selectedIds[0]} /> : ""} | ||
{selectedIds.length >= 1 ? <DeleteTagsButton /> : ""} | ||
{isFetching && <Loader size={"sm"} />} | ||
</Group> | ||
<Group> | ||
<QuickFilter | ||
onChange={onQuickFilterChange} | ||
onClear={onQuickFilterClear} | ||
filterText={filterText} | ||
/> | ||
</Group> | ||
</Group> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.