Fix: Show Priority icon in custom analytics table. (#2744)

This commit is contained in:
Ankush Deshmukh 2023-11-10 13:06:23 +05:30 committed by GitHub
parent 884b219508
commit 2748133bd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 34 deletions

View File

@ -18,18 +18,21 @@ export const PriorityIcon: React.FC<IPriorityIcon> = ({
}) => { }) => {
if (!className || className === "") className = "h-3.5 w-3.5"; if (!className || className === "") className = "h-3.5 w-3.5";
// Convert to lowercase for string comparison
const lowercasePriority = priority?.toLowerCase();
return ( return (
<> <>
{priority === "urgent" ? ( {lowercasePriority === "urgent" ? (
<AlertCircle className={`${className}`} /> <AlertCircle className={`text-red-500 ${className}`} />
) : priority === "high" ? ( ) : lowercasePriority === "high" ? (
<SignalHigh className={`${className}`} /> <SignalHigh className={`text-orange-500 ${className}`} />
) : priority === "medium" ? ( ) : lowercasePriority === "medium" ? (
<SignalMedium className={`${className}`} /> <SignalMedium className={`text-yellow-500 ${className}`} />
) : priority === "low" ? ( ) : lowercasePriority === "low" ? (
<SignalLow className={`${className}`} /> <SignalLow className={`text-green-500 ${className}`} />
) : ( ) : (
<Ban className={`${className}`} /> <Ban className={`text-custom-text-200 ${className}`} />
)} )}
</> </>
); );

View File

@ -69,7 +69,6 @@ export const AnalyticsTable: React.FC<Props> = ({ analytics, barGraphData, param
}`} }`}
> >
{params.x_axis === "priority" ? ( {params.x_axis === "priority" ? (
// TODO: incorrect priority icon being rendered
<PriorityIcon priority={item.name as TIssuePriorities} /> <PriorityIcon priority={item.name as TIssuePriorities} />
) : ( ) : (
<span <span

View File

@ -45,13 +45,13 @@ export const InboxIssueCard: React.FC<Props> = (props) => {
<div <div
className={`grid h-6 w-6 place-items-center rounded border items-center shadow-sm ${ className={`grid h-6 w-6 place-items-center rounded border items-center shadow-sm ${
issue.priority === "urgent" issue.priority === "urgent"
? "border-red-500/20 bg-red-500/20 text-red-500" ? "border-red-500/20 bg-red-500/20"
: issue.priority === "high" : issue.priority === "high"
? "border-orange-500/20 bg-orange-500/20 text-orange-500" ? "border-orange-500/20 bg-orange-500/20"
: issue.priority === "medium" : issue.priority === "medium"
? "border-yellow-500/20 bg-yellow-500/20 text-yellow-500" ? "border-yellow-500/20 bg-yellow-500/20"
: issue.priority === "low" : issue.priority === "low"
? "border-green-500/20 bg-green-500/20 text-green-500" ? "border-green-500/20 bg-green-500/20"
: "border-custom-border-200" : "border-custom-border-200"
}`} }`}
> >

View File

@ -20,17 +20,7 @@ export const AppliedPriorityFilters: React.FC<Props> = observer((props) => {
<div key={priority} className="text-xs flex items-center gap-1 bg-custom-background-80 p-1 rounded"> <div key={priority} className="text-xs flex items-center gap-1 bg-custom-background-80 p-1 rounded">
<PriorityIcon <PriorityIcon
priority={priority as TIssuePriorities} priority={priority as TIssuePriorities}
className={`h-3 w-3 ${ className={`h-3 w-3`}
priority === "urgent"
? "text-red-500"
: priority === "high"
? "text-orange-500"
: priority === "medium"
? "text-yellow-500"
: priority === "low"
? "text-green-500"
: ""
}`}
/> />
{priority} {priority}
<button <button

View File

@ -74,15 +74,7 @@ export const PrioritySelect: React.FC<Props> = ({
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<PriorityIcon <PriorityIcon
priority={value} priority={value}
className={`h-3.5 w-3.5 ${ className={`h-3.5 w-3.5 ${value === "urgent" ? (highlightUrgentPriority ? "text-white" : "text-red-500") : ""}`}
value === "high"
? "text-orange-500"
: value === "medium"
? "text-yellow-500"
: value === "low"
? "text-green-500"
: "text-custom-text-200"
} ${value === "urgent" ? (highlightUrgentPriority ? "text-white" : "text-red-500") : ""}`}
/> />
{showTitle && <span className="capitalize text-xs">{value}</span>} {showTitle && <span className="capitalize text-xs">{value}</span>}
</div> </div>