-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WEB-1680] dev: issue detail activity revamp and issue detail page im…
…provement (#5075) * chore: issue link activity message updated * chore: activity filter type constant added * dev: issue activity revamp and code refactor * chore: issue detail widget oreder updated in peek overview * chore: issue detail page padding improvement * fix: relation widget toast alert * fix: relation widget toast alert * fix: peek overview attachment delete modal * chore: code refactor * chore: code refactor * chore: code refactor * chore: code refactor * chore: issue detail sidebar parent field
- Loading branch information
1 parent
fd61079
commit 53e5d4b
Showing
14 changed files
with
207 additions
and
131 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
83 changes: 83 additions & 0 deletions
83
web/core/components/issues/issue-detail/issue-activity/activity-filter.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,83 @@ | ||
import React, { FC, Fragment } from "react"; | ||
import { observer } from "mobx-react"; | ||
import { Check, ListFilter } from "lucide-react"; | ||
import { Popover, Transition } from "@headlessui/react"; | ||
// ui | ||
import { Button } from "@plane/ui"; | ||
// constants | ||
import { ACTIVITY_FILTER_TYPE_OPTIONS, EActivityFilterType } from "@/constants/issue"; | ||
// helper | ||
import { cn } from "@/helpers/common.helper"; | ||
|
||
type Props = { | ||
selectedFilters: EActivityFilterType[]; | ||
toggleFilter: (filter: EActivityFilterType) => void; | ||
}; | ||
|
||
export const ActivityFilter: FC<Props> = observer((props) => { | ||
const { selectedFilters, toggleFilter } = props; | ||
return ( | ||
<Popover as="div" className="relative"> | ||
{({ open }) => ( | ||
<> | ||
<Popover.Button as={React.Fragment}> | ||
<Button | ||
variant="neutral-primary" | ||
size="sm" | ||
prependIcon={<ListFilter className="h-3 w-3" />} | ||
className="relative" | ||
> | ||
<span className={`${open ? "text-custom-text-100" : "text-custom-text-200"}`}>Filters</span> | ||
</Button> | ||
</Popover.Button> | ||
|
||
<Transition | ||
as={Fragment} | ||
enter="transition ease-out duration-200" | ||
enterFrom="opacity-0 translate-y-1" | ||
enterTo="opacity-100 translate-y-0" | ||
leave="transition ease-in duration-150" | ||
leaveFrom="opacity-100 translate-y-0" | ||
leaveTo="opacity-0 translate-y-1" | ||
> | ||
<Popover.Panel className="absolute mt-2 right-0 z-10 min-w-40"> | ||
<div className="p-2 rounded-md border border-custom-border-200 bg-custom-background-100"> | ||
{ACTIVITY_FILTER_TYPE_OPTIONS.map((filter) => { | ||
const isSelected = selectedFilters.includes(filter.value); | ||
return ( | ||
<div | ||
key={filter.value} | ||
className="flex items-center gap-2 text-sm cursor-pointer px-2 p-1 transition-all hover:bg-custom-background-80 rounded-sm" | ||
onClick={() => toggleFilter(filter.value)} | ||
> | ||
<div | ||
className={cn( | ||
"flex-shrink-0 w-3 h-3 flex justify-center items-center rounded-sm transition-all bg-custom-background-90", | ||
{ | ||
"bg-custom-primary text-white": isSelected, | ||
"bg-custom-background-80 text-custom-text-400": isSelected && selectedFilters.length === 1, | ||
"bg-custom-background-90": !isSelected, | ||
} | ||
)} | ||
> | ||
{isSelected && <Check className="h-2.5 w-2.5" />} | ||
</div> | ||
<div | ||
className={cn( | ||
"whitespace-nowrap", | ||
isSelected ? "text-custom-text-100" : "text-custom-text-200" | ||
)} | ||
> | ||
{filter.label} | ||
</div> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
</Popover.Panel> | ||
</Transition> | ||
</> | ||
)} | ||
</Popover> | ||
); | ||
}); |
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
Oops, something went wrong.