Fix financial taxonomy snapshot normalization
This commit is contained in:
@@ -31,8 +31,8 @@ function InspectorCard(props: {
|
||||
);
|
||||
}
|
||||
|
||||
function renderList(values: string[]) {
|
||||
return values.length > 0 ? values.join(', ') : 'n/a';
|
||||
function renderList(values: string[] | null | undefined) {
|
||||
return (values ?? []).length > 0 ? (values ?? []).join(', ') : 'n/a';
|
||||
}
|
||||
|
||||
export function StatementRowInspector(props: StatementRowInspectorProps) {
|
||||
@@ -64,7 +64,7 @@ export function StatementRowInspector(props: StatementRowInspectorProps) {
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 gap-3 md:grid-cols-2">
|
||||
<InspectorCard label="Source Fact IDs" value={selection.row.sourceFactIds.length > 0 ? selection.row.sourceFactIds.join(', ') : 'n/a'} />
|
||||
<InspectorCard label="Source Fact IDs" value={(selection.row.sourceFactIds ?? []).length > 0 ? (selection.row.sourceFactIds ?? []).join(', ') : 'n/a'} />
|
||||
<InspectorCard label="Warning Codes" value={renderList(selection.row.warningCodes ?? [])} />
|
||||
</div>
|
||||
|
||||
@@ -136,7 +136,7 @@ export function StatementRowInspector(props: StatementRowInspectorProps) {
|
||||
|
||||
<div className="grid grid-cols-1 gap-3 md:grid-cols-2">
|
||||
<InspectorCard label="Local Name" value={selection.row.localName} />
|
||||
<InspectorCard label="Source Fact IDs" value={selection.row.sourceFactIds.length > 0 ? selection.row.sourceFactIds.join(', ') : 'n/a'} />
|
||||
<InspectorCard label="Source Fact IDs" value={(selection.row.sourceFactIds ?? []).length > 0 ? (selection.row.sourceFactIds ?? []).join(', ') : 'n/a'} />
|
||||
</div>
|
||||
|
||||
<div className="rounded-lg border border-[color:var(--line-weak)] bg-[color:var(--panel-soft)] px-3 py-2">
|
||||
|
||||
Reference in New Issue
Block a user