-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #384 from msqd/filter-tpdex
Filter tpdex
- Loading branch information
Showing
27 changed files
with
870 additions
and
62 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
7 changes: 7 additions & 0 deletions
7
docs/reference/apps/harp_apps.dashboard.filters.transaction_tpdex.rst
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,7 @@ | ||
harp_apps.dashboard.filters.transaction_tpdex | ||
============================================= | ||
|
||
.. automodule:: harp_apps.dashboard.filters.transaction_tpdex | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
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 was deleted.
Oops, something went wrong.
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,6 +1,6 @@ | ||
from .base import AbstractFacet | ||
from .base import AbstractChoicesFacet | ||
|
||
|
||
class TransactionMethodFacet(AbstractFacet): | ||
class TransactionMethodFacet(AbstractChoicesFacet): | ||
name = "method" | ||
choices = {"GET", "POST", "PUT", "DELETE", "PATCH"} |
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,6 +1,6 @@ | ||
from .base import AbstractFacet | ||
from .base import AbstractChoicesFacet | ||
|
||
|
||
class TransactionStatusFacet(AbstractFacet): | ||
class TransactionStatusFacet(AbstractChoicesFacet): | ||
name = "status" | ||
choices = {"2xx", "3xx", "4xx", "5xx"} |
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,5 @@ | ||
from .base import AbstractMinMaxFacet | ||
|
||
|
||
class TransactionTpdexFacet(AbstractMinMaxFacet): | ||
name = "tpdex" |
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
62 changes: 62 additions & 0 deletions
62
harp_apps/dashboard/frontend/src/Pages/Transactions/Components/Facets/RangeSliderFacet.tsx
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,62 @@ | ||
import { ChevronDownIcon, ChevronUpIcon } from "@heroicons/react/24/outline" | ||
import { useState } from "react" | ||
|
||
import { MinMaxFilter } from "Types/filters" | ||
import { RangeSlider, Mark } from "ui/Components/Slider/RangeSlider.tsx" | ||
import { H5 } from "ui/Components/Typography" | ||
|
||
import { FacetInnerLightButton } from "./FacetInnerLightButton.tsx" | ||
|
||
interface RangeSliderFacetProps { | ||
title: string | ||
name: string | ||
type: "rangeSlider" | ||
defaultOpen?: boolean | ||
values?: MinMaxFilter | ||
setValues: (value?: MinMaxFilter) => void | ||
marks?: Mark[] | ||
min?: number | ||
max?: number | ||
} | ||
|
||
export function RangeSliderFacet({ | ||
title, | ||
name, | ||
values = undefined, | ||
setValues, | ||
defaultOpen = true, | ||
marks, | ||
min, | ||
max, | ||
}: RangeSliderFacetProps) { | ||
const [open, setOpen] = useState(defaultOpen) | ||
|
||
return ( | ||
<div className="px-4 py-3"> | ||
<fieldset name={name}> | ||
<H5 as="legend" padding="pt-0" className="flex w-full cursor-pointer" onClick={() => setOpen(!open)}> | ||
<span className="grow"> | ||
{title} | ||
{values ? <FacetInnerLightButton label="reset" handler={() => setValues(undefined)} /> : null} | ||
</span> | ||
{open ? ( | ||
<ChevronUpIcon className="h-4 w-4 text-gray-600" /> | ||
) : ( | ||
<ChevronDownIcon className="h-4 w-4 text-gray-600" /> | ||
)} | ||
</H5> | ||
<div className={"mt-2 space-y-2 " + (open ? "" : "hidden")}> | ||
<RangeSlider | ||
min={min} | ||
max={max} | ||
step={10} | ||
defaultValue={values} | ||
onPointerUp={setValues} | ||
marks={marks} | ||
thumbSize="8px" | ||
/> | ||
</div> | ||
</fieldset> | ||
</div> | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
harp_apps/dashboard/frontend/src/Pages/Transactions/Components/Facets/index.ts
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,2 +1,3 @@ | ||
export { Facet } from "./Facet" | ||
export { FacetLabel } from "./FacetLabel" | ||
export { RangeSliderFacet } from "./RangeSliderFacet" |
Oops, something went wrong.