Skip to content

Commit

Permalink
Show columns of other entries on the collection page when some entrie…
Browse files Browse the repository at this point in the history
…s fail to parse
  • Loading branch information
emmatown committed Oct 14, 2024
1 parent f005ab2 commit c83bcdf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-emus-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystatic/core': patch
---

Show columns of other entries on the collection page when some entries fail to parse
12 changes: 7 additions & 5 deletions packages/keystatic/src/app/CollectionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,9 @@ function CollectionTable(
);
const glob = getSlugGlobForCollection(props.config, props.collection);
const rootSchema = { kind: 'object' as const, fields: collection.schema };
return new Map(
entries.map(([slug, dataFile]) => {
const parsedEntries = new Map<string, Record<string, unknown>>();
for (const [slug, dataFile] of entries) {
try {
const { loaded } = loadDataFile(dataFile, formatInfo);
const validated = parseProps(
rootSchema,
Expand Down Expand Up @@ -394,9 +395,10 @@ function CollectionTable(
},
true
);
return [slug, validated as Record<string, unknown>] as const;
})
);
parsedEntries.set(slug, validated as Record<string, unknown>);
} catch {}
}
return parsedEntries;
}, [
collection,
props.config,
Expand Down

0 comments on commit c83bcdf

Please sign in to comment.