diff --git a/.changeset/friendly-dodos-punch.md b/.changeset/friendly-dodos-punch.md new file mode 100644 index 000000000..1ac2769d1 --- /dev/null +++ b/.changeset/friendly-dodos-punch.md @@ -0,0 +1,5 @@ +--- +'@keystatic/core': patch +--- + +Fix entries with a slug of `header` breaking the collection table diff --git a/packages/keystatic/src/app/CollectionPage.tsx b/packages/keystatic/src/app/CollectionPage.tsx index 2cfa7b57d..2d086dd03 100644 --- a/packages/keystatic/src/app/CollectionPage.tsx +++ b/packages/keystatic/src/app/CollectionPage.tsx @@ -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={() => ( + {[ ...(hideStatusColumn ? [] : [statusCell]), nameCell, @@ -578,9 +584,9 @@ function CollectionTable( ); } return hideStatusColumn ? ( - {nameCell} + {nameCell} ) : ( - + {statusCell} {nameCell}