-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
❇️ Subject priority score #287
Changes from all commits
e2e7786
a2d2c28
51f6d2c
90983bf
5c329d4
3961b5c
db2a1f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,27 @@ | ||||||||
import { LabelChip } from '@/common/labels' | ||||||||
import { classNames } from '@/lib/util' | ||||||||
import { HandRaisedIcon } from '@heroicons/react/24/solid' | ||||||||
|
||||||||
export const PriorityScore = ({ | ||||||||
priorityScore, | ||||||||
size, | ||||||||
}: { | ||||||||
priorityScore: number | ||||||||
size?: 'sm' | ||||||||
}) => { | ||||||||
if (!priorityScore) { | ||||||||
return null | ||||||||
} | ||||||||
Comment on lines
+12
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we don't have a use case where 0 priority score needs to be taken into account by mods so a non-positive integer does not need to be rendered. |
||||||||
return ( | ||||||||
<LabelChip | ||||||||
className={classNames( | ||||||||
'flex flex-row gap-1 items-center bg-orange-300 text-orange-800', | ||||||||
size === 'sm' ? 'text-xs px-1 py-0' : '', | ||||||||
)} | ||||||||
title={`This subject's priority score is set to ${priorityScore} out of 100. Subjects with higher score should be reviewed more urgently.`} | ||||||||
> | ||||||||
<HandRaisedIcon className="h-3 w-3" /> | ||||||||
{priorityScore} | ||||||||
</LabelChip> | ||||||||
) | ||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
0
means low priority ? If so, it might make sense to distinguishnull
here:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 means either we haven't set a priority or we have intentionally set it to 0. it always defaults to 0 either way and never null and we won't care
why
it's 0.