tangled
alpha
login
or
join now
retr0.id
/
pdsls
forked from
pds.ls/pdsls
1
fork
atom
atproto explorer
1
fork
atom
overview
issues
pulls
pipelines
fix empty properties object
juli.ee
4 months ago
18e51c93
3d3ca0fc
verified
This commit was signed with the committer's
known signature
.
juli.ee
SSH Key Fingerprint:
SHA256:mBrT4x0JdzLpbVR95g1hjI1aaErfC02kmLRkPXwsYCk=
+23
-8
1 changed file
expand all
collapse all
unified
split
src
components
lexicon-schema.tsx
+23
-8
src/components/lexicon-schema.tsx
···
83
83
const isLocalRef = () => props.refType?.startsWith("#");
84
84
const isExternalRef = () => props.refType && !props.refType.startsWith("#");
85
85
86
86
-
const handleClick = async (e: MouseEvent) => {
87
87
-
e.preventDefault();
86
86
+
const handleClick = async () => {
88
87
if (isLocalRef()) {
89
88
const defName = props.refType!.slice(1);
90
89
window.history.replaceState(null, "", `#schema:${defName}`);
···
287
286
props.def.closed ||
288
287
props.def.items;
289
288
290
290
-
const handleHeaderClick = (e: MouseEvent) => {
291
291
-
e.preventDefault();
289
289
+
const handleHeaderClick = () => {
292
290
window.history.replaceState(null, "", `#schema:${props.name}`);
293
291
const element = document.getElementById(`def-${props.name}`);
294
292
if (element) {
···
334
332
</Show>
335
333
336
334
{/* Properties (for record/object types) */}
337
337
-
<Show when={props.def.properties || props.def.record?.properties}>
335
335
+
<Show
336
336
+
when={Object.keys(props.def.properties || props.def.record?.properties || {}).length > 0}
337
337
+
>
338
338
<div class="flex flex-col gap-2">
339
339
<h4 class="text-sm font-semibold text-neutral-600 uppercase dark:text-neutral-400">
340
340
Properties
···
354
354
</Show>
355
355
356
356
{/* Parameters (for query/procedure) */}
357
357
-
<Show when={props.def.parameters?.properties}>
357
357
+
<Show
358
358
+
when={
359
359
+
props.def.parameters?.properties &&
360
360
+
Object.keys(props.def.parameters.properties).length > 0
361
361
+
}
362
362
+
>
358
363
<div class="flex flex-col gap-2">
359
364
<h4 class="text-sm font-semibold text-neutral-600 uppercase dark:text-neutral-400">
360
365
Parameters
···
398
403
<UnionBadges refs={props.def.input!.schema!.refs!} />
399
404
</div>
400
405
</Show>
401
401
-
<Show when={props.def.input!.schema?.properties}>
406
406
+
<Show
407
407
+
when={
408
408
+
props.def.input!.schema?.properties &&
409
409
+
Object.keys(props.def.input!.schema.properties).length > 0
410
410
+
}
411
411
+
>
402
412
<div class="divide-y divide-neutral-200 rounded-lg border border-neutral-200 bg-neutral-50/50 px-3 dark:divide-neutral-700 dark:border-neutral-700 dark:bg-neutral-800/30">
403
413
<For each={Object.entries(props.def.input!.schema!.properties!)}>
404
414
{([name, property]) => (
···
440
450
<UnionBadges refs={props.def.output!.schema!.refs!} />
441
451
</div>
442
452
</Show>
443
443
-
<Show when={props.def.output!.schema?.properties}>
453
453
+
<Show
454
454
+
when={
455
455
+
props.def.output!.schema?.properties &&
456
456
+
Object.keys(props.def.output!.schema.properties).length > 0
457
457
+
}
458
458
+
>
444
459
<div class="divide-y divide-neutral-200 rounded-lg border border-neutral-200 bg-neutral-50/50 px-3 dark:divide-neutral-700 dark:border-neutral-700 dark:bg-neutral-800/30">
445
460
<For each={Object.entries(props.def.output!.schema!.properties!)}>
446
461
{([name, property]) => (