-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WEB-2688] chore: added icons and splitted issue header (#6195)
* chore: added icons and splitted issue header * fix: added ee filler component * fix: component name fixed * fix: removed dupes * fix: casing
- Loading branch information
Showing
16 changed files
with
341 additions
and
133 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./project_filters"; | ||
export * from "./projects"; | ||
export * from "./project_link"; |
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,22 @@ | ||
export type TProjectLinkEditableFields = { | ||
title: string; | ||
url: string; | ||
}; | ||
|
||
export type TProjectLink = TProjectLinkEditableFields & { | ||
created_by_id: string; | ||
id: string; | ||
metadata: any; | ||
project_id: string; | ||
|
||
//need | ||
created_at: Date; | ||
}; | ||
|
||
export type TProjectLinkMap = { | ||
[project_id: string]: TProjectLink; | ||
}; | ||
|
||
export type TProjectLinkIdMap = { | ||
[project_id: string]: string[]; | ||
}; |
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,22 @@ | ||
import * as React from "react"; | ||
|
||
import { ISvgIcons } from "./type"; | ||
|
||
export const ActivityIcon: React.FC<ISvgIcons> = ({ className = "text-current", ...rest }) => ( | ||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<g clip-path="url(#clip0_15681_9387)"> | ||
<path | ||
d="M14.6666 8.00001H13.0133C12.7219 7.99939 12.4384 8.09421 12.206 8.26999C11.9736 8.44576 11.8053 8.69281 11.7266 8.97334L10.1599 14.5467C10.1498 14.5813 10.1288 14.6117 10.0999 14.6333C10.0711 14.655 10.036 14.6667 9.99992 14.6667C9.96386 14.6667 9.92877 14.655 9.89992 14.6333C9.87107 14.6117 9.85002 14.5813 9.83992 14.5467L6.15992 1.45334C6.14982 1.41872 6.12877 1.38831 6.09992 1.36668C6.07107 1.34504 6.03598 1.33334 5.99992 1.33334C5.96386 1.33334 5.92877 1.34504 5.89992 1.36668C5.87107 1.38831 5.85002 1.41872 5.83992 1.45334L4.27325 7.02668C4.1949 7.30611 4.02751 7.55235 3.79649 7.72802C3.56548 7.90368 3.28347 7.99918 2.99325 8.00001H1.33325" | ||
stroke="#8591AD" | ||
stroke-width="2" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
/> | ||
</g> | ||
<defs> | ||
<clipPath id="clip0_15681_9387"> | ||
<rect width="16" height="16" fill="white" /> | ||
</clipPath> | ||
</defs> | ||
</svg> | ||
); |
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,30 @@ | ||
import * as React from "react"; | ||
|
||
import { ISvgIcons } from "./type"; | ||
|
||
export const AtRiskIcon: React.FC<ISvgIcons> = ({ width = "16", height = "16" }) => ( | ||
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
d="M16 1C7.71573 1 1 7.71573 1 16C1 24.2843 7.71573 31 16 31C24.2843 31 31 24.2843 31 16C31 7.71573 24.2843 1 16 1Z" | ||
fill="#CC7700" | ||
/> | ||
<path | ||
d="M16 1C7.71573 1 1 7.71573 1 16C1 24.2843 7.71573 31 16 31C24.2843 31 31 24.2843 31 16C31 7.71573 24.2843 1 16 1Z" | ||
stroke="#F3F4F7" | ||
stroke-width="2" | ||
/> | ||
<g clip-path="url(#clip0_21157_25600)"> | ||
<path | ||
fill-rule="evenodd" | ||
clip-rule="evenodd" | ||
d="M10.0369 15.3346H10.667C11.0352 15.3346 11.3337 15.6331 11.3337 16.0013C11.3337 16.3695 11.0352 16.668 10.667 16.668H10.0369C10.3686 19.6679 12.912 22.0013 16.0003 22.0013C19.0887 22.0013 21.6321 19.6679 21.9637 16.668H21.3337C20.9655 16.668 20.667 16.3695 20.667 16.0013C20.667 15.6331 20.9655 15.3346 21.3337 15.3346H21.9637C21.6321 12.3347 19.0887 10.0013 16.0003 10.0013C12.912 10.0013 10.3686 12.3347 10.0369 15.3346ZM8.66699 16.0013C8.66699 11.9512 11.9502 8.66797 16.0003 8.66797C20.0504 8.66797 23.3337 11.9512 23.3337 16.0013C23.3337 20.0514 20.0504 23.3346 16.0003 23.3346C11.9502 23.3346 8.66699 20.0514 8.66699 16.0013ZM16.0003 12.668C16.3685 12.668 16.667 12.9664 16.667 13.3346V16.0013C16.667 16.3695 16.3685 16.668 16.0003 16.668C15.6321 16.668 15.3337 16.3695 15.3337 16.0013V13.3346C15.3337 12.9664 15.6321 12.668 16.0003 12.668ZM15.3337 18.668C15.3337 18.2998 15.6321 18.0013 16.0003 18.0013H16.007C16.3752 18.0013 16.6737 18.2998 16.6737 18.668C16.6737 19.0362 16.3752 19.3346 16.007 19.3346H16.0003C15.6321 19.3346 15.3337 19.0362 15.3337 18.668Z" | ||
fill="white" | ||
/> | ||
</g> | ||
<defs> | ||
<clipPath id="clip0_21157_25600"> | ||
<rect width="16" height="16" fill="white" transform="translate(8 8)" /> | ||
</clipPath> | ||
</defs> | ||
</svg> | ||
); |
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,30 @@ | ||
import * as React from "react"; | ||
|
||
import { ISvgIcons } from "./type"; | ||
|
||
export const OffTrackIcon: React.FC<ISvgIcons> = ({ width = "16", height = "16" }) => ( | ||
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
d="M16 1C7.71573 1 1 7.71573 1 16C1 24.2843 7.71573 31 16 31C24.2843 31 31 24.2843 31 16C31 7.71573 24.2843 1 16 1Z" | ||
fill="#CC0000" | ||
/> | ||
<path | ||
d="M16 1C7.71573 1 1 7.71573 1 16C1 24.2843 7.71573 31 16 31C24.2843 31 31 24.2843 31 16C31 7.71573 24.2843 1 16 1Z" | ||
stroke="#F3F4F7" | ||
stroke-width="2" | ||
/> | ||
<g clip-path="url(#clip0_21157_78200)"> | ||
<path | ||
fill-rule="evenodd" | ||
clip-rule="evenodd" | ||
d="M10.0369 15.3346H10.667C11.0352 15.3346 11.3337 15.6331 11.3337 16.0013C11.3337 16.3695 11.0352 16.668 10.667 16.668H10.0369C10.3686 19.6679 12.912 22.0013 16.0003 22.0013C19.0887 22.0013 21.6321 19.6679 21.9637 16.668H21.3337C20.9655 16.668 20.667 16.3695 20.667 16.0013C20.667 15.6331 20.9655 15.3346 21.3337 15.3346H21.9637C21.6321 12.3347 19.0887 10.0013 16.0003 10.0013C12.912 10.0013 10.3686 12.3347 10.0369 15.3346ZM8.66699 16.0013C8.66699 11.9512 11.9502 8.66797 16.0003 8.66797C20.0504 8.66797 23.3337 11.9512 23.3337 16.0013C23.3337 20.0514 20.0504 23.3346 16.0003 23.3346C11.9502 23.3346 8.66699 20.0514 8.66699 16.0013ZM14.667 12.668C15.0352 12.668 15.3337 12.9664 15.3337 13.3346V16.0013C15.3337 16.3695 15.0352 16.668 14.667 16.668C14.2988 16.668 14.0003 16.3695 14.0003 16.0013V13.3346C14.0003 12.9664 14.2988 12.668 14.667 12.668ZM17.3337 12.668C17.7018 12.668 18.0003 12.9664 18.0003 13.3346V16.0013C18.0003 16.3695 17.7018 16.668 17.3337 16.668C16.9655 16.668 16.667 16.3695 16.667 16.0013V13.3346C16.667 12.9664 16.9655 12.668 17.3337 12.668ZM14.0003 18.668C14.0003 18.2998 14.2988 18.0013 14.667 18.0013H14.6737C15.0418 18.0013 15.3403 18.2998 15.3403 18.668C15.3403 19.0362 15.0418 19.3346 14.6737 19.3346H14.667C14.2988 19.3346 14.0003 19.0362 14.0003 18.668ZM16.667 18.668C16.667 18.2998 16.9655 18.0013 17.3337 18.0013H17.3403C17.7085 18.0013 18.007 18.2998 18.007 18.668C18.007 19.0362 17.7085 19.3346 17.3403 19.3346H17.3337C16.9655 19.3346 16.667 19.0362 16.667 18.668Z" | ||
fill="white" | ||
/> | ||
</g> | ||
<defs> | ||
<clipPath id="clip0_21157_78200"> | ||
<rect width="16" height="16" fill="white" transform="translate(8 8)" /> | ||
</clipPath> | ||
</defs> | ||
</svg> | ||
); |
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,48 @@ | ||
import * as React from "react"; | ||
|
||
import { ISvgIcons } from "./type"; | ||
|
||
export const OnTrackIcon: React.FC<ISvgIcons> = ({ width = "16", height = "16" }) => ( | ||
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
d="M16 1C7.71573 1 1 7.71573 1 16C1 24.2843 7.71573 31 16 31C24.2843 31 31 24.2843 31 16C31 7.71573 24.2843 1 16 1Z" | ||
fill="#1FAD40" | ||
/> | ||
<path | ||
d="M16 1C7.71573 1 1 7.71573 1 16C1 24.2843 7.71573 31 16 31C24.2843 31 31 24.2843 31 16C31 7.71573 24.2843 1 16 1Z" | ||
stroke="#F3F4F7" | ||
stroke-width="2" | ||
/> | ||
<g clip-path="url(#clip0_21157_107468)"> | ||
<path | ||
fill-rule="evenodd" | ||
clip-rule="evenodd" | ||
d="M19.0005 10.8004C17.8118 10.1146 16.4238 9.85693 15.0681 10.0705C13.7124 10.2841 12.4709 10.956 11.5507 11.9741C10.6304 12.9923 10.087 14.2952 10.0111 15.6655C9.93516 17.0358 10.3313 18.3907 11.1334 19.5043C11.9356 20.6179 13.0953 21.4228 14.4191 21.7849C15.7429 22.1469 17.1508 22.0442 18.408 21.4938C19.6652 20.9435 20.6958 19.9787 21.3278 18.7605C21.9598 17.5423 22.1551 16.1442 21.8811 14.7994C21.8076 14.4387 22.0404 14.0866 22.4012 14.0131C22.762 13.9396 23.1141 14.1725 23.1876 14.5332C23.5225 16.1768 23.2838 17.8856 22.5113 19.3745C21.7389 20.8635 20.4793 22.0426 18.9427 22.7153C17.4061 23.3879 15.6853 23.5135 14.0673 23.071C12.4493 22.6285 11.032 21.6447 10.0516 20.2836C9.07117 18.9226 8.58699 17.2665 8.67979 15.5917C8.77259 13.9169 9.43675 12.3245 10.5615 11.0801C11.6863 9.83568 13.2037 9.01448 14.8606 8.75343C16.5176 8.49238 18.2139 8.80726 19.6668 9.64556C19.9857 9.82957 20.0951 10.2373 19.9111 10.5562C19.7271 10.8751 19.3194 10.9845 19.0005 10.8004ZM23.1384 10.1949C23.3987 10.4553 23.3987 10.8774 23.1384 11.1377L16.4717 17.8044C16.2114 18.0648 15.7893 18.0648 15.5289 17.8044L13.5289 15.8044C13.2686 15.5441 13.2686 15.1219 13.5289 14.8616C13.7893 14.6012 14.2114 14.6012 14.4717 14.8616L16.0003 16.3902L22.1956 10.1949C22.4559 9.93458 22.878 9.93458 23.1384 10.1949Z" | ||
fill="white" | ||
/> | ||
<path | ||
fill-rule="evenodd" | ||
clip-rule="evenodd" | ||
d="M16.0003 23.333C15.6321 23.333 15.3337 23.0345 15.3337 22.6663V21.333C15.3337 20.9648 15.6321 20.6663 16.0003 20.6663C16.3685 20.6663 16.667 20.9648 16.667 21.333V22.6663C16.667 23.0345 16.3685 23.333 16.0003 23.333Z" | ||
fill="white" | ||
/> | ||
<path | ||
fill-rule="evenodd" | ||
clip-rule="evenodd" | ||
d="M16.0003 11.333C15.6321 11.333 15.3337 11.0345 15.3337 10.6663V9.333C15.3337 8.96481 15.6321 8.66634 16.0003 8.66634C16.3685 8.66634 16.667 8.96481 16.667 9.333V10.6663C16.667 11.0345 16.3685 11.333 16.0003 11.333Z" | ||
fill="white" | ||
/> | ||
<path | ||
fill-rule="evenodd" | ||
clip-rule="evenodd" | ||
d="M11.3337 15.9997C11.3337 16.3679 11.0352 16.6663 10.667 16.6663H9.33366C8.96547 16.6663 8.66699 16.3679 8.66699 15.9997C8.66699 15.6315 8.96547 15.333 9.33366 15.333H10.667C11.0352 15.333 11.3337 15.6315 11.3337 15.9997Z" | ||
fill="white" | ||
/> | ||
</g> | ||
<defs> | ||
<clipPath id="clip0_21157_107468"> | ||
<rect width="16" height="16" fill="white" transform="translate(8 8)" /> | ||
</clipPath> | ||
</defs> | ||
</svg> | ||
); |
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,21 @@ | ||
import * as React from "react"; | ||
|
||
import { ISvgIcons } from "./type"; | ||
|
||
export const OverviewIcon: React.FC<ISvgIcons> = ({ width = "16", height = "16", className = "" }) => ( | ||
<svg | ||
width={width} | ||
height={height} | ||
className={className} | ||
viewBox="0 0 16 16" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
fill-rule="evenodd" | ||
clip-rule="evenodd" | ||
d="M2.5 3C2.5 2.86739 2.55268 2.74021 2.64645 2.64645C2.74021 2.55268 2.86739 2.5 3 2.5H3.5C9.02267 2.5 13.5 6.97733 13.5 12.5V13C13.5 13.1326 13.4473 13.2598 13.3536 13.3536C13.2598 13.4473 13.1326 13.5 13 13.5H12.5C12.3674 13.5 12.2402 13.4473 12.1464 13.3536C12.0527 13.2598 12 13.1326 12 13V12.5C12 7.80533 8.19467 4 3.5 4H3C2.86739 4 2.74021 3.94732 2.64645 3.85355C2.55268 3.75979 2.5 3.63261 2.5 3.5V3ZM2.5 7.5C2.5 7.36739 2.55268 7.24022 2.64645 7.14645C2.74021 7.05268 2.86739 7 3 7H3.5C4.22227 7 4.93747 7.14226 5.60476 7.41866C6.27205 7.69506 6.87837 8.10019 7.38909 8.61091C7.89981 9.12164 8.30494 9.72795 8.58134 10.3952C8.85774 11.0625 9 11.7777 9 12.5V13C9 13.1326 8.94732 13.2598 8.85355 13.3536C8.75978 13.4473 8.63261 13.5 8.5 13.5H8C7.86739 13.5 7.74022 13.4473 7.64645 13.3536C7.55268 13.2598 7.5 13.1326 7.5 13V12.5C7.5 11.4391 7.07857 10.4217 6.32843 9.67157C5.57828 8.92143 4.56087 8.5 3.5 8.5H3C2.86739 8.5 2.74021 8.44732 2.64645 8.35355C2.55268 8.25978 2.5 8.13261 2.5 8V7.5ZM2.5 12.5C2.5 12.2348 2.60536 11.9804 2.79289 11.7929C2.98043 11.6054 3.23478 11.5 3.5 11.5C3.76522 11.5 4.01957 11.6054 4.20711 11.7929C4.39464 11.9804 4.5 12.2348 4.5 12.5C4.5 12.7652 4.39464 13.0196 4.20711 13.2071C4.01957 13.3946 3.76522 13.5 3.5 13.5C3.23478 13.5 2.98043 13.3946 2.79289 13.2071C2.60536 13.0196 2.5 12.7652 2.5 12.5Z" | ||
fill="#455068" | ||
/> | ||
</svg> | ||
); |
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 @@ | ||
import * as React from "react"; | ||
|
||
import { ISvgIcons } from "./type"; | ||
|
||
export const UpdatesIcon: React.FC<ISvgIcons> = ({ className = "text-current", ...rest }) => ( | ||
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
fill-rule="evenodd" | ||
clip-rule="evenodd" | ||
d="M6.54325 5.056C8.46325 2.58867 11.4633 1 14.8333 1C14.9659 1 15.093 1.05268 15.1868 1.14645C15.2806 1.24021 15.3333 1.36739 15.3333 1.5C15.3333 4.87067 13.7446 7.87 11.2773 9.79067C11.3799 10.4335 11.3418 11.0909 11.1656 11.7176C10.9895 12.3443 10.6795 12.9253 10.257 13.4205C9.83454 13.9158 9.30964 14.3135 8.71854 14.5862C8.12744 14.8588 7.48422 15 6.83325 15C6.70064 15 6.57347 14.9473 6.4797 14.8536C6.38593 14.7598 6.33325 14.6326 6.33325 14.5V11.746C5.6852 11.2342 5.09942 10.6482 4.58792 10H1.83325C1.70064 10 1.57347 9.94732 1.4797 9.85355C1.38593 9.75979 1.33325 9.63261 1.33325 9.5C1.3332 8.84897 1.47441 8.20568 1.74713 7.61453C2.01986 7.02337 2.41761 6.49843 2.91293 6.07594C3.40824 5.65345 3.98934 5.34346 4.6161 5.16737C5.24287 4.99128 5.90038 4.95328 6.54325 5.056ZM10.3333 4.5C9.93543 4.5 9.5539 4.65804 9.27259 4.93934C8.99129 5.22064 8.83325 5.60218 8.83325 6C8.83325 6.39782 8.99129 6.77936 9.27259 7.06066C9.5539 7.34196 9.93543 7.5 10.3333 7.5C10.7311 7.5 11.1126 7.34196 11.3939 7.06066C11.6752 6.77936 11.8333 6.39782 11.8333 6C11.8333 5.60218 11.6752 5.22064 11.3939 4.93934C11.1126 4.65804 10.7311 4.5 10.3333 4.5Z" | ||
fill="#8591AD" | ||
/> | ||
<path | ||
d="M3.83994 11.4947C3.8926 11.4554 3.93701 11.4062 3.97064 11.3497C4.00426 11.2933 4.02645 11.2308 4.03592 11.1658C4.04539 11.1008 4.04197 11.0346 4.02584 10.9709C4.00972 10.9072 3.98121 10.8473 3.94194 10.7947C3.90268 10.742 3.85342 10.6976 3.797 10.664C3.74057 10.6304 3.67807 10.6082 3.61307 10.5987C3.54807 10.5892 3.48184 10.5927 3.41816 10.6088C3.35448 10.6249 3.2946 10.6534 3.24194 10.6927C2.73054 11.0731 2.33288 11.5861 2.092 12.1762C1.85111 12.7663 1.77617 13.4111 1.87528 14.0407C1.89139 14.1455 1.94045 14.2426 2.01536 14.3177C2.09026 14.3929 2.18713 14.4422 2.29194 14.4587C2.92163 14.5577 3.56641 14.4827 4.15652 14.2417C4.74664 14.0007 5.25961 13.6029 5.63994 13.0913C5.68047 13.0388 5.71015 12.9788 5.72723 12.9147C5.74432 12.8506 5.74848 12.7837 5.73948 12.718C5.73047 12.6522 5.70847 12.589 5.67476 12.5318C5.64105 12.4747 5.59631 12.4248 5.54315 12.3852C5.48998 12.3455 5.42945 12.3168 5.36508 12.3007C5.30071 12.2847 5.23379 12.2816 5.16821 12.2917C5.10264 12.3017 5.03973 12.3248 4.98314 12.3594C4.92655 12.394 4.87742 12.4395 4.83861 12.4933C4.60612 12.806 4.30366 13.0599 3.95544 13.2347C3.60722 13.4095 3.22291 13.5004 2.83328 13.5C2.83328 12.68 3.22794 11.9513 3.83994 11.4947Z" | ||
fill="#8591AD" | ||
/> | ||
</svg> | ||
); |
131 changes: 2 additions & 129 deletions
131
web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(list)/header.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 |
---|---|---|
@@ -1,130 +1,3 @@ | ||
"use client"; | ||
import { IssuesHeader } from "@/plane-web/components/issues"; | ||
|
||
import { observer } from "mobx-react"; | ||
import { useParams } from "next/navigation"; | ||
// icons | ||
import { Briefcase, Circle, ExternalLink } from "lucide-react"; | ||
// ui | ||
import { Breadcrumbs, Button, LayersIcon, Tooltip, Header } from "@plane/ui"; | ||
// components | ||
import { BreadcrumbLink, CountChip, Logo } from "@/components/common"; | ||
// constants | ||
import HeaderFilters from "@/components/issues/filters"; | ||
import { EIssuesStoreType } from "@/constants/issue"; | ||
// helpers | ||
import { SPACE_BASE_PATH, SPACE_BASE_URL } from "@/helpers/common.helper"; | ||
// hooks | ||
import { useEventTracker, useProject, useCommandPalette, useUserPermissions } from "@/hooks/store"; | ||
import { useIssues } from "@/hooks/store/use-issues"; | ||
import { useAppRouter } from "@/hooks/use-app-router"; | ||
import { usePlatformOS } from "@/hooks/use-platform-os"; | ||
import { EUserPermissions, EUserPermissionsLevel } from "@/plane-web/constants/user-permissions"; | ||
|
||
export const ProjectIssuesHeader = observer(() => { | ||
// router | ||
const router = useAppRouter(); | ||
const { workspaceSlug, projectId } = useParams() as { workspaceSlug: string; projectId: string }; | ||
// store hooks | ||
const { | ||
issues: { getGroupIssueCount }, | ||
} = useIssues(EIssuesStoreType.PROJECT); | ||
|
||
const { currentProjectDetails, loader } = useProject(); | ||
|
||
const { toggleCreateIssueModal } = useCommandPalette(); | ||
const { setTrackElement } = useEventTracker(); | ||
const { allowPermissions } = useUserPermissions(); | ||
const { isMobile } = usePlatformOS(); | ||
|
||
const SPACE_APP_URL = (SPACE_BASE_URL.trim() === "" ? window.location.origin : SPACE_BASE_URL) + SPACE_BASE_PATH; | ||
const publishedURL = `${SPACE_APP_URL}/issues/${currentProjectDetails?.anchor}`; | ||
|
||
const issuesCount = getGroupIssueCount(undefined, undefined, false); | ||
const canUserCreateIssue = allowPermissions( | ||
[EUserPermissions.ADMIN, EUserPermissions.MEMBER], | ||
EUserPermissionsLevel.PROJECT | ||
); | ||
|
||
return ( | ||
<Header> | ||
<Header.LeftItem> | ||
<div className="flex items-center gap-2.5"> | ||
<Breadcrumbs onBack={() => router.back()} isLoading={loader}> | ||
<Breadcrumbs.BreadcrumbItem | ||
type="text" | ||
link={ | ||
<BreadcrumbLink | ||
label={currentProjectDetails?.name ?? "Project"} | ||
icon={ | ||
currentProjectDetails ? ( | ||
currentProjectDetails && ( | ||
<span className="grid place-items-center flex-shrink-0 h-4 w-4"> | ||
<Logo logo={currentProjectDetails?.logo_props} size={16} /> | ||
</span> | ||
) | ||
) : ( | ||
<span className="grid h-7 w-7 flex-shrink-0 place-items-center rounded uppercase"> | ||
<Briefcase className="h-4 w-4" /> | ||
</span> | ||
) | ||
} | ||
/> | ||
} | ||
/> | ||
|
||
<Breadcrumbs.BreadcrumbItem | ||
type="text" | ||
link={<BreadcrumbLink label="Issues" icon={<LayersIcon className="h-4 w-4 text-custom-text-300" />} />} | ||
/> | ||
</Breadcrumbs> | ||
{issuesCount && issuesCount > 0 ? ( | ||
<Tooltip | ||
isMobile={isMobile} | ||
tooltipContent={`There are ${issuesCount} ${issuesCount > 1 ? "issues" : "issue"} in this project`} | ||
position="bottom" | ||
> | ||
<CountChip count={issuesCount} /> | ||
</Tooltip> | ||
) : null} | ||
</div> | ||
{currentProjectDetails?.anchor ? ( | ||
<a | ||
href={publishedURL} | ||
className="group flex items-center gap-1.5 rounded bg-custom-primary-100/10 px-2.5 py-1 text-xs font-medium text-custom-primary-100" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<Circle className="h-1.5 w-1.5 fill-custom-primary-100" strokeWidth={2} /> | ||
Public | ||
<ExternalLink className="hidden h-3 w-3 group-hover:block" strokeWidth={2} /> | ||
</a> | ||
) : ( | ||
<></> | ||
)} | ||
</Header.LeftItem> | ||
<Header.RightItem> | ||
<div className="hidden gap-3 md:flex"> | ||
<HeaderFilters | ||
projectId={projectId} | ||
currentProjectDetails={currentProjectDetails} | ||
workspaceSlug={workspaceSlug} | ||
canUserCreateIssue={canUserCreateIssue} | ||
/> | ||
</div> | ||
{canUserCreateIssue ? ( | ||
<Button | ||
onClick={() => { | ||
setTrackElement("Project issues page"); | ||
toggleCreateIssueModal(true, EIssuesStoreType.PROJECT); | ||
}} | ||
size="sm" | ||
> | ||
<div className="hidden sm:block">Add</div> Issue | ||
</Button> | ||
) : ( | ||
<></> | ||
)} | ||
</Header.RightItem> | ||
</Header> | ||
); | ||
}); | ||
export const ProjectIssuesHeader = () => <IssuesHeader />; |
Oops, something went wrong.