Skip to content

Commit

Permalink
Library: Rename template parts to library in nav (#50769)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw authored May 22, 2023
1 parent 2e40379 commit c40aad6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
.edit-site-sidebar-navigation-item__drilldown-indicator {
fill: $gray-700;
}

&:is(a) {
text-decoration: none;

&:focus {
box-shadow: none;
outline: none;
}
}
}

.edit-site-sidebar-navigation-screen__content .block-editor-list-view-block-select-button {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default function SidebarNavigationScreenMain() {
withChevron
icon={ symbol }
>
{ __( 'Template Parts' ) }
{ __( 'Library' ) }
</NavigatorButton>
</ItemGroup>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ const config = {
},
wp_template_part: {
labels: {
title: __( 'Template parts' ),
loading: __( 'Loading template parts' ),
notFound: __( 'No template parts found' ),
title: __( 'Library' ),
loading: __( 'Loading library' ),
notFound: __( 'No patterns found' ),
manage: __( 'Manage all template parts' ),
reusableBlocks: __( 'Manage reusable blocks' ),
description: __(
'Template Parts are small pieces of a layout that can be reused across multiple templates and always appear the same way. Common template parts include the site header, footer, or sidebar.'
'Manage what patterns are available when editing your site.'
),
},
},
Expand Down Expand Up @@ -128,14 +129,28 @@ export default function SidebarNavigationScreenTemplates() {
</TemplateItem>
) ) }
{ ! isMobileViewport && (
<SidebarNavigationItem
className="edit-site-sidebar-navigation-screen-templates__see-all"
{ ...browseAllLink }
children={
config[ postType ].labels.manage
}
withChevron
/>
<>
<SidebarNavigationItem
className="edit-site-sidebar-navigation-screen-templates__see-all"
withChevron
{ ...browseAllLink }
>
{ config[ postType ].labels.manage }
</SidebarNavigationItem>
{ !! config[ postType ].labels
.reusableBlocks && (
<SidebarNavigationItem
as="a"
href="edit.php?post_type=wp_block"
withChevron
>
{
config[ postType ].labels
.reusableBlocks
}
</SidebarNavigationItem>
) }
</>
) }
</ItemGroup>
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ test.describe( 'Site editor url navigation', () => {
page,
} ) => {
await admin.visitSiteEditor();
await page.click( 'role=button[name="Template Parts"i]' );
await page.click( 'role=button[name="Library"i]' );
await page.click( 'role=button[name="Add New"i]' );
// Fill in a name in the dialog that pops up.
await page.type(
Expand Down

1 comment on commit c40aad6

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in c40aad6.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5041889018
📝 Reported issues:

Please sign in to comment.