Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .changeset/friendly-dodos-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystatic/core': patch
---

Fix entries with a slug of `header` breaking the collection table
14 changes: 10 additions & 4 deletions packages/keystatic/src/app/CollectionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,13 @@ function CollectionTable(
overflowMode="truncate"
prominence="low"
onAction={key => {
router.push(getItemPath(props.basePath, props.collection, key));
router.push(
getItemPath(
props.basePath,
props.collection,
key.toString().slice('key:'.length)
)
);
}}
renderEmptyState={() => (
<EmptyState
Expand Down Expand Up @@ -554,7 +560,7 @@ function CollectionTable(
);
if (collection.columns?.length) {
return (
<Row key={item.name}>
<Row key={'key:' + item.name}>
{[
...(hideStatusColumn ? [] : [statusCell]),
nameCell,
Expand All @@ -578,9 +584,9 @@ function CollectionTable(
);
}
return hideStatusColumn ? (
<Row key={item.name}>{nameCell}</Row>
<Row key={'key:' + item.name}>{nameCell}</Row>
) : (
<Row key={item.name}>
<Row key={'key:' + item.name}>
{statusCell}
{nameCell}
</Row>
Expand Down