Skip to content

Commit

Permalink
Update handling of data properties and oneOf
Browse files Browse the repository at this point in the history
  • Loading branch information
haideriqbal committed Nov 4, 2024
1 parent f5c8976 commit 05b6297
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
7 changes: 6 additions & 1 deletion frontend/src/components/ClassExpression.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,19 @@ export default function ClassExpression({
</span>,
];

for (const subExpr of oneOf) {
for (let subExpr of oneOf) {
if (nodes.length > 1) {
nodes.push(
<span key={randomString()} className="text-neutral-default">
&#44;&nbsp;
</span>
);
}

if (typeof subExpr === "number") {
subExpr = subExpr.toString();
}

nodes.push(
<ClassExpression
key={randomString()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ export default function IndividualPropertyAssertionsSection({
linkedEntities={linkedEntities}
/>
&thinsp;
{
<span>
{typeof v === "string" && v.includes("http") ? (
<span>
<span className="pr-1 text-sm" style={{ color: "gray" }}>
&#9656;
</span>
Expand All @@ -107,7 +107,21 @@ export default function IndividualPropertyAssertionsSection({
linkedEntities={linkedEntities}
/>
</span>
}
) : (
<Tooltip
title={
typeof v === "string"
? v
: typeof v === "object" && !Array.isArray(v) && v.value
? JSON.stringify(v.value)
: JSON.stringify(v)
}
placement="top"
arrow
>
<i className="icon icon-common icon-info text-neutral-default text-sm ml-1" />
</Tooltip>
)}
</span>
);
}
Expand Down

0 comments on commit 05b6297

Please sign in to comment.