Fix vendor risk tier always show same color

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-03-13 08:22:50 +01:00
parent 759c508363
commit fb6c5dbf37
2 changed files with 30 additions and 6 deletions

View File

@@ -84,8 +84,10 @@ const createVendorMutation = graphql`
node {
id
name
description
createdAt
updatedAt
riskTier
}
}
}
@@ -332,9 +334,15 @@ function VendorListContent({
<div className="flex items-center gap-2">
<Badge
variant="secondary"
className="bg-lime-9 text-white rounded-full px-3 py-0.5 text-xs font-medium"
className={
vendor.riskTier === "CRITICAL"
? "bg-red-100 text-red-900 rounded-full px-3 py-0.5 text-xs font-medium"
: vendor?.riskTier === "SIGNIFICANT"
? "bg-yellow-100 text-yellow-900 rounded-full px-3 py-0.5 text-xs font-medium"
: "bg-green-100 text-green-900 rounded-full px-3 py-0.5 text-xs font-medium"
}
>
{vendor?.riskTier}
{vendor.riskTier}
</Badge>
<Button
variant="ghost"

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<03490b3e2c1e510c108108be2aabdb60>>
* @generated SignedSource<<1e5aa858fdcd0179ebfd8ffba00b6bd7>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -32,8 +32,10 @@ export type VendorListPageCreateVendorMutation$data = {
readonly vendorEdge: {
readonly node: {
readonly createdAt: string;
readonly description: string;
readonly id: string;
readonly name: string;
readonly riskTier: RiskTier;
readonly updatedAt: string;
};
};
@@ -92,6 +94,13 @@ v3 = {
"name": "name",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "description",
"storageKey": null
},
{
"alias": null,
"args": null,
@@ -105,6 +114,13 @@ v3 = {
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "riskTier",
"storageKey": null
}
],
"storageKey": null
@@ -178,16 +194,16 @@ return {
]
},
"params": {
"cacheID": "ddfddd8b4266631b16341e6fe2e04cb5",
"cacheID": "7ab96ef77e598ee748273b37bb9b42d2",
"id": null,
"metadata": {},
"name": "VendorListPageCreateVendorMutation",
"operationKind": "mutation",
"text": "mutation VendorListPageCreateVendorMutation(\n $input: CreateVendorInput!\n) {\n createVendor(input: $input) {\n vendorEdge {\n node {\n id\n name\n createdAt\n updatedAt\n }\n }\n }\n}\n"
"text": "mutation VendorListPageCreateVendorMutation(\n $input: CreateVendorInput!\n) {\n createVendor(input: $input) {\n vendorEdge {\n node {\n id\n name\n description\n createdAt\n updatedAt\n riskTier\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "03c48ba8f1db919da507322208e5e136";
(node as any).hash = "603ba3f92a342a8e1fb20057612b7c79";
export default node;