Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library: Rename template parts to library #50769

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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
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 @@ -36,12 +36,13 @@ const config = {
},
wp_template_part: {
labels: {
title: __( 'Template parts' ),
loading: __( 'Loading template parts' ),
notFound: __( 'No template parts found' ),
manage: __( 'Manage all template parts' ),
title: __( 'Library' ),
loading: __( 'Loading library' ),
notFound: __( 'No patterns found' ),
manage: __( 'Manage all patterns' ),
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 @@ -123,14 +124,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