Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web-report/src/components/EndpointAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const EndpointAccordion: React.FC<IEndpointAccordionProps> = ({
setIsFault(true);
}}
className={`${faultColors[index % faultColors.length]} ${getSelectedStyle(fault.code, true)} hover:bg-red-400 cursor-pointer text-white text-base font-mono border-2 border-black shadow-[2px_2px_0px_0px_rgba(0,0,0,1)]`}>
{fault.code}
F{fault.code}
</Badge>
))
}
Expand Down
3 changes: 0 additions & 3 deletions web-report/src/components/StatusCodeFilterButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ export function StatusCodeFilterButton({ code, initialState = "inactive", onChan
const toggleState = () => {
const newState: FilterState = state === "inactive" ? "active" : state === "active" ? "removed" : "inactive"
setState(newState)
if(isFault){
onChange(code, newState)
}
onChange(code, newState)
}

Expand Down
34 changes: 32 additions & 2 deletions web-report/src/components/StatusCodeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ export function StatusCodeModal({ isOpen, onClose, statusCode }: StatusCodeModal
const getCategoryName = (category: number): string => {
switch (category) {
case 100:
return "HTTP Issues"
return "REST/HTTP Faults"
case 200:
return "Schema Issues"
return "Security Faults"
case 300:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove the 300 to 800, as currently they are not defined (that was an early classification that no longer applies)

return "GraphQL Issues"
case 400:
Expand All @@ -65,6 +65,8 @@ export function StatusCodeModal({ isOpen, onClose, statusCode }: StatusCodeModal
return "Web Issues"
case 800:
return "Security Issues"
case 900:
return "Custom Faults"
default:
return "Other Issues"
}
Expand All @@ -84,11 +86,15 @@ export function StatusCodeModal({ isOpen, onClose, statusCode }: StatusCodeModal
return "5xx"
case 800:
return "8xx"
case 900:
return "9xx"
default:
return "xxx"
}
}

const isCustomCode = statusCode >= 900 && statusCode <= 999

const toggleExpanded = (code: number) => {
setExpandedCode(expandedCode === code ? null : code)
}
Expand Down Expand Up @@ -171,6 +177,30 @@ export function StatusCodeModal({ isOpen, onClose, statusCode }: StatusCodeModal
</div>
</div>
))}

{/* 9XX Custom Code Section */}
{isCustomCode && (
<div className="border rounded-lg overflow-hidden">
<div className="p-3 font-medium bg-blue-100 text-blue-800">
Custom Faults (9xx)
</div>
<div className="divide-y">
<div id={`fault-code-${statusCode}`}>
<div
ref={selectedCodeRef}
className="p-3 flex items-center bg-blue-50"
>
<div className="w-16 font-mono">{statusCode}</div>
<div className="flex-1">Custom Code</div>
<div className="flex items-center gap-2">
<div className="w-3 h-3 rounded-full bg-blue-500"></div>
</div>
</div>

</div>
</div>
</div>
)}
</div>
</div>
</div>
Expand Down
Loading