Skip to content

Commit

Permalink
Show "Complete Path" label for home page (#1408)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennyvivid authored Nov 23, 2023
1 parent f3d79cd commit 82122aa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/admin/cms-admin/src/pages/createEditPageNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export function createEditPageNode({
if (mode === "edit" && (loading || !data?.page)) {
return <Loading />;
}

return (
<div>
<FinalForm<FormValues>
Expand Down Expand Up @@ -312,10 +313,6 @@ export function createEditPageNode({
return null;
}

if (values.slug === "home") {
return <Typography>/</Typography>;
}

const numberOfDescendants = data?.page?.numberOfDescendants ?? 0;

return (
Expand All @@ -328,7 +325,11 @@ export function createEditPageNode({
variant="horizontal"
>
<Typography>
{parentPath}/{values.slug}
{values.slug === "home"
? "/"
: parentPath === null
? `/${values.slug}`
: `${parentPath}/${values.slug}`}
</Typography>
</FieldContainer>
{mode === "edit" && dirtyFields.slug && (
Expand Down

0 comments on commit 82122aa

Please sign in to comment.