Spaces:
Running
Running
Avijit Ghosh
commited on
Commit
Β·
6e757fb
1
Parent(s):
08bd63d
eyes added
Browse files
app/evaluation/[id]/page.client.tsx
CHANGED
|
@@ -51,12 +51,16 @@ export default function EvaluationDetailsPage() {
|
|
| 51 |
const toggleCategoryVisibility = (id: string) => setVisibleCategories((p) => ({ ...p, [id]: !p[id] }))
|
| 52 |
const selectAll = () => {
|
| 53 |
const map: Record<string, boolean> = {}
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
setVisibleCategories(map)
|
| 56 |
}
|
| 57 |
const deselectAll = () => {
|
| 58 |
const map: Record<string, boolean> = {}
|
| 59 |
-
|
| 60 |
setVisibleCategories(map)
|
| 61 |
}
|
| 62 |
|
|
@@ -74,11 +78,13 @@ export default function EvaluationDetailsPage() {
|
|
| 74 |
// ignore
|
| 75 |
}
|
| 76 |
|
| 77 |
-
// if nothing saved, initialize defaults (visible)
|
| 78 |
-
if (evaluation
|
|
|
|
| 79 |
const init: Record<string, boolean> = {}
|
| 80 |
-
|
| 81 |
-
|
|
|
|
| 82 |
})
|
| 83 |
setVisibleCategories((p) => ({ ...init, ...p }))
|
| 84 |
}
|
|
@@ -192,8 +198,18 @@ export default function EvaluationDetailsPage() {
|
|
| 192 |
{/* Applicable Categories - split into Capabilities & Risks with visibility toggles */}
|
| 193 |
<Card className="mb-6">
|
| 194 |
<CardHeader>
|
| 195 |
-
|
| 196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
<div className="flex items-center gap-2">
|
| 198 |
<Button size="sm" variant="outline" onClick={selectAll}>
|
| 199 |
Select all
|
|
@@ -209,13 +225,11 @@ export default function EvaluationDetailsPage() {
|
|
| 209 |
<div>
|
| 210 |
<div className="text-sm font-medium mb-2">Capabilities</div>
|
| 211 |
<div className="flex flex-col gap-2">
|
| 212 |
-
{
|
| 213 |
-
|
| 214 |
-
.filter(Boolean)
|
| 215 |
-
.filter((c: any) => c.type === "capability")
|
| 216 |
-
.map((category: any) => {
|
| 217 |
const naReason = naReasonForCategory(category.id)
|
| 218 |
-
const
|
|
|
|
| 219 |
return (
|
| 220 |
<label key={category.id} className="flex items-center gap-2">
|
| 221 |
<Checkbox
|
|
@@ -234,7 +248,7 @@ export default function EvaluationDetailsPage() {
|
|
| 234 |
</span>
|
| 235 |
</TooltipTrigger>
|
| 236 |
<TooltipContent>
|
| 237 |
-
<p className="text-sm">{naReason}</p>
|
| 238 |
</TooltipContent>
|
| 239 |
</Tooltip>
|
| 240 |
</TooltipProvider>
|
|
@@ -252,13 +266,11 @@ export default function EvaluationDetailsPage() {
|
|
| 252 |
<div>
|
| 253 |
<div className="text-sm font-medium mb-2">Risks</div>
|
| 254 |
<div className="flex flex-col gap-2">
|
| 255 |
-
{
|
| 256 |
-
|
| 257 |
-
.filter(Boolean)
|
| 258 |
-
.filter((c: any) => c.type === "risk")
|
| 259 |
-
.map((category: any) => {
|
| 260 |
const naReason = naReasonForCategory(category.id)
|
| 261 |
-
const
|
|
|
|
| 262 |
return (
|
| 263 |
<label key={category.id} className="flex items-center gap-2">
|
| 264 |
<Checkbox
|
|
@@ -277,7 +289,7 @@ export default function EvaluationDetailsPage() {
|
|
| 277 |
</span>
|
| 278 |
</TooltipTrigger>
|
| 279 |
<TooltipContent>
|
| 280 |
-
<p className="text-sm">{naReason}</p>
|
| 281 |
</TooltipContent>
|
| 282 |
</Tooltip>
|
| 283 |
</TooltipProvider>
|
|
|
|
| 51 |
const toggleCategoryVisibility = (id: string) => setVisibleCategories((p) => ({ ...p, [id]: !p[id] }))
|
| 52 |
const selectAll = () => {
|
| 53 |
const map: Record<string, boolean> = {}
|
| 54 |
+
const sel = new Set(evaluation.selectedCategories || [])
|
| 55 |
+
CATEGORIES.forEach((c) => {
|
| 56 |
+
// only select categories that are part of the evaluation's selected list and not NA
|
| 57 |
+
map[c.id] = sel.has(c.id)
|
| 58 |
+
})
|
| 59 |
setVisibleCategories(map)
|
| 60 |
}
|
| 61 |
const deselectAll = () => {
|
| 62 |
const map: Record<string, boolean> = {}
|
| 63 |
+
CATEGORIES.forEach((c) => (map[c.id] = false))
|
| 64 |
setVisibleCategories(map)
|
| 65 |
}
|
| 66 |
|
|
|
|
| 78 |
// ignore
|
| 79 |
}
|
| 80 |
|
| 81 |
+
// if nothing saved, initialize defaults (visible for applicable categories)
|
| 82 |
+
if (evaluation) {
|
| 83 |
+
const sel = new Set(evaluation.selectedCategories || [])
|
| 84 |
const init: Record<string, boolean> = {}
|
| 85 |
+
CATEGORIES.forEach((c) => {
|
| 86 |
+
// default visibility: true for categories that are marked selected/applicable, false otherwise
|
| 87 |
+
init[c.id] = sel.has(c.id)
|
| 88 |
})
|
| 89 |
setVisibleCategories((p) => ({ ...init, ...p }))
|
| 90 |
}
|
|
|
|
| 198 |
{/* Applicable Categories - split into Capabilities & Risks with visibility toggles */}
|
| 199 |
<Card className="mb-6">
|
| 200 |
<CardHeader>
|
| 201 |
+
<div className="flex items-center justify-between w-full">
|
| 202 |
+
{/* compute applicable count as non-NA categories from the full CATEGORIES list */}
|
| 203 |
+
<CardTitle>
|
| 204 |
+
Applicable Categories ({
|
| 205 |
+
CATEGORIES.filter((c) => {
|
| 206 |
+
const sel = new Set(evaluation.selectedCategories || [])
|
| 207 |
+
// treat as applicable only when selected and not explicitly NA
|
| 208 |
+
const na = naReasonForCategory(c.id)
|
| 209 |
+
return sel.has(c.id) && !na
|
| 210 |
+
}).length
|
| 211 |
+
})
|
| 212 |
+
</CardTitle>
|
| 213 |
<div className="flex items-center gap-2">
|
| 214 |
<Button size="sm" variant="outline" onClick={selectAll}>
|
| 215 |
Select all
|
|
|
|
| 225 |
<div>
|
| 226 |
<div className="text-sm font-medium mb-2">Capabilities</div>
|
| 227 |
<div className="flex flex-col gap-2">
|
| 228 |
+
{CATEGORIES.filter((c: any) => c.type === "capability").map((category: any) => {
|
| 229 |
+
const sel = new Set(evaluation.selectedCategories || [])
|
|
|
|
|
|
|
|
|
|
| 230 |
const naReason = naReasonForCategory(category.id)
|
| 231 |
+
const isSelected = sel.has(category.id)
|
| 232 |
+
const isNA = !isSelected || !!naReason
|
| 233 |
return (
|
| 234 |
<label key={category.id} className="flex items-center gap-2">
|
| 235 |
<Checkbox
|
|
|
|
| 248 |
</span>
|
| 249 |
</TooltipTrigger>
|
| 250 |
<TooltipContent>
|
| 251 |
+
<p className="text-sm">{naReason ?? "Not applicable"}</p>
|
| 252 |
</TooltipContent>
|
| 253 |
</Tooltip>
|
| 254 |
</TooltipProvider>
|
|
|
|
| 266 |
<div>
|
| 267 |
<div className="text-sm font-medium mb-2">Risks</div>
|
| 268 |
<div className="flex flex-col gap-2">
|
| 269 |
+
{CATEGORIES.filter((c: any) => c.type === "risk").map((category: any) => {
|
| 270 |
+
const sel = new Set(evaluation.selectedCategories || [])
|
|
|
|
|
|
|
|
|
|
| 271 |
const naReason = naReasonForCategory(category.id)
|
| 272 |
+
const isSelected = sel.has(category.id)
|
| 273 |
+
const isNA = !isSelected || !!naReason
|
| 274 |
return (
|
| 275 |
<label key={category.id} className="flex items-center gap-2">
|
| 276 |
<Checkbox
|
|
|
|
| 289 |
</span>
|
| 290 |
</TooltipTrigger>
|
| 291 |
<TooltipContent>
|
| 292 |
+
<p className="text-sm">{naReason ?? "Not applicable"}</p>
|
| 293 |
</TooltipContent>
|
| 294 |
</Tooltip>
|
| 295 |
</TooltipProvider>
|
public/evaluations/fraud-detector.json
CHANGED
|
@@ -304,6 +304,63 @@
|
|
| 304 |
},
|
| 305 |
"additionalAspects": "Broad socio-economic analysis not included in this simplified fixture."
|
| 306 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
},
|
| 308 |
"overallStats": {
|
| 309 |
"totalApplicable": 12,
|
|
|
|
| 304 |
},
|
| 305 |
"additionalAspects": "Broad socio-economic analysis not included in this simplified fixture."
|
| 306 |
}
|
| 307 |
+
,
|
| 308 |
+
"social-intelligence": {
|
| 309 |
+
"benchmarkAnswers": { "A1": "N/A", "A2": "N/A", "A3": "N/A", "A4": "N/A", "A5": "N/A", "A6": "N/A" },
|
| 310 |
+
"processAnswers": { "B1": "N/A", "B2": "N/A", "B3": "N/A", "B4": "N/A", "B5": "N/A", "B6": "N/A" },
|
| 311 |
+
"benchmarkSources": {},
|
| 312 |
+
"processSources": {},
|
| 313 |
+
"additionalAspects": "Not applicable β social intelligence and interpersonal benchmarks are out of scope for this structured financial fraud detector demo."
|
| 314 |
+
},
|
| 315 |
+
"creativity-innovation": {
|
| 316 |
+
"benchmarkAnswers": { "A1": "N/A", "A2": "N/A", "A3": "N/A", "A4": "N/A", "A5": "N/A", "A6": "N/A" },
|
| 317 |
+
"processAnswers": { "B1": "N/A", "B2": "N/A", "B3": "N/A", "B4": "N/A", "B5": "N/A", "B6": "N/A" },
|
| 318 |
+
"benchmarkSources": {},
|
| 319 |
+
"processSources": {},
|
| 320 |
+
"additionalAspects": "Not applicable β creativity and open-ended generative benchmarks do not apply to this narrowly scoped transaction fraud detector."
|
| 321 |
+
},
|
| 322 |
+
"perception-vision": {
|
| 323 |
+
"benchmarkAnswers": { "A1": "N/A", "A2": "N/A", "A3": "N/A", "A4": "N/A", "A5": "N/A", "A6": "N/A" },
|
| 324 |
+
"processAnswers": { "B1": "N/A", "B2": "N/A", "B3": "N/A", "B4": "N/A", "B5": "N/A", "B6": "N/A" },
|
| 325 |
+
"benchmarkSources": {},
|
| 326 |
+
"processSources": {},
|
| 327 |
+
"additionalAspects": "Not applicable β vision and image benchmarks are irrelevant for this text/structured-data fraud detection system."
|
| 328 |
+
},
|
| 329 |
+
"physical-manipulation": {
|
| 330 |
+
"benchmarkAnswers": { "A1": "N/A", "A2": "N/A", "A3": "N/A", "A4": "N/A", "A5": "N/A", "A6": "N/A" },
|
| 331 |
+
"processAnswers": { "B1": "N/A", "B2": "N/A", "B3": "N/A", "B4": "N/A", "B5": "N/A", "B6": "N/A" },
|
| 332 |
+
"benchmarkSources": {},
|
| 333 |
+
"processSources": {},
|
| 334 |
+
"additionalAspects": "Not applicable β physical manipulation and robotics benchmarks are not relevant for this software-only financial detector."
|
| 335 |
+
},
|
| 336 |
+
"metacognition": {
|
| 337 |
+
"benchmarkAnswers": { "A1": "N/A", "A2": "N/A", "A3": "N/A", "A4": "N/A", "A5": "N/A", "A6": "N/A" },
|
| 338 |
+
"processAnswers": { "B1": "N/A", "B2": "N/A", "B3": "N/A", "B4": "N/A", "B5": "N/A", "B6": "N/A" },
|
| 339 |
+
"benchmarkSources": {},
|
| 340 |
+
"processSources": {},
|
| 341 |
+
"additionalAspects": "Not applicable β metacognitive self-assessment and calibration evaluations are out of scope for this demo fixture."
|
| 342 |
+
},
|
| 343 |
+
"robotic-intelligence": {
|
| 344 |
+
"benchmarkAnswers": { "A1": "N/A", "A2": "N/A", "A3": "N/A", "A4": "N/A", "A5": "N/A", "A6": "N/A" },
|
| 345 |
+
"processAnswers": { "B1": "N/A", "B2": "N/A", "B3": "N/A", "B4": "N/A", "B5": "N/A", "B6": "N/A" },
|
| 346 |
+
"benchmarkSources": {},
|
| 347 |
+
"processSources": {},
|
| 348 |
+
"additionalAspects": "Not applicable β robotic autonomy benchmarks are irrelevant for this cloud-hosted fraud detection model."
|
| 349 |
+
},
|
| 350 |
+
"environmental-impact": {
|
| 351 |
+
"benchmarkAnswers": { "A1": "N/A", "A2": "N/A", "A3": "N/A", "A4": "N/A", "A5": "N/A", "A6": "N/A" },
|
| 352 |
+
"processAnswers": { "B1": "N/A", "B2": "N/A", "B3": "N/A", "B4": "N/A", "B5": "N/A", "B6": "N/A" },
|
| 353 |
+
"benchmarkSources": {},
|
| 354 |
+
"processSources": {},
|
| 355 |
+
"additionalAspects": "Not applicable β environmental/resource impact assessment was not performed for this simplified demo evaluation."
|
| 356 |
+
},
|
| 357 |
+
"value-chain": {
|
| 358 |
+
"benchmarkAnswers": { "A1": "N/A", "A2": "N/A", "A3": "N/A", "A4": "N/A", "A5": "N/A", "A6": "N/A" },
|
| 359 |
+
"processAnswers": { "B1": "N/A", "B2": "N/A", "B3": "N/A", "B4": "N/A", "B5": "N/A", "B6": "N/A" },
|
| 360 |
+
"benchmarkSources": {},
|
| 361 |
+
"processSources": {},
|
| 362 |
+
"additionalAspects": "Not applicable β detailed value-chain and supply-chain risk analysis is beyond the scope of this demo fixture."
|
| 363 |
+
}
|
| 364 |
},
|
| 365 |
"overallStats": {
|
| 366 |
"totalApplicable": 12,
|