-
-
Notifications
You must be signed in to change notification settings - Fork 579
fix: add background color to TLP badges and include TLP in job API. C… #3284
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
Changes from 3 commits
d5ee7a8
bacebc7
7927e3b
93c1928
2cc5161
d03ad72
ce70068
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 |
|---|---|---|
|
|
@@ -5,11 +5,20 @@ | |
| import { TLPDescriptions } from "../../constants/miscConst"; | ||
| import { TlpChoices } from "../../constants/advancedSettingsConst"; | ||
|
|
||
| let idCounter = 0; | ||
|
|
||
| export function TLPTag(props) { | ||
| const { value, ...rest } = props; | ||
| const badgeId = `tlptag-badge__${value}`; | ||
| const uniqueId = React.useRef(idCounter++).current; | ||
| const badgeId = `tlptag-badge__${value}__${uniqueId}`; | ||
| const color = TLPColors?.[value] || "#dfe1e2"; | ||
| const tooltipText = TLPDescriptions?.[value] || "invalid"; | ||
| const textColorMap = { | ||
| CLEAR: "#000000", | ||
| GREEN: "#000000", | ||
| AMBER: "#000000", | ||
| }; | ||
| const textColor = textColorMap[value] || "#FFFFFF"; | ||
|
|
||
| return value ? ( | ||
| <Badge | ||
|
|
@@ -18,7 +27,9 @@ | |
| style={{ | ||
| borderRadius: 5, | ||
| userSelect: "none", | ||
| backgroundColor: color, | ||
| border: `1px solid ${color}`, | ||
| color: textColor, | ||
|
Comment on lines
17
to
33
|
||
| }} | ||
| {...rest} | ||
| > | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,81 @@ | ||||||
| import React from "react"; | ||||||
| import "@testing-library/jest-dom"; | ||||||
| import { render, screen } from "@testing-library/react"; | ||||||
|
||||||
| import { render, screen } from "@testing-library/react"; | |
| import { render } from "@testing-library/react"; |
Outdated
Copilot
AI
Feb 7, 2026
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.
The tests hardcode TLP hex colors instead of asserting against the shared TLPColors constant. Using the constant (or another shared source of truth) would reduce duplication and keep the test aligned if the palette ever changes.
Uh oh!
There was an error while loading. Please reload this page.