-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Site editor sidebar: add page details (#50767)
* setting the stage for page detail * fix padding issues * Filling in the details :) * This commit: - exports `getMediaDetails()` from the post-featured-image sidebar component and uses it if there's a featured image in the post record - cleans up components and unused functions - uses available wordcount and readtime functions - implements i18n strings - shuffles page-specific styles around - update package log after importing @wordpress/wordcount - truncating titles and other long excerpts - adding status icons - adding featured image description and loading placeholder * Adding SVG icons for status labels Removing duped/unused test expectations De-nesting BEM rules Remove unused comments i18n * Removing duped/unused test expectations De-nesting BEM rules Remove unused comments i18n * Displaying templates * We no longer need to pass down a className to SidebarNavigationScreen. Reverting. * style changes page detail site editor * Update colors * Ensuring that getFeaturedMediaDetails can be used locally. Importing getFeaturedMediaDetails into privateApis for the editor package. Removing unnecessary conditional checks Escaping HTML and other values for rendering in page and attributes - adding escape-html to package.json Don't render details when we don't have a record * Let's show password protected and private page status as well. --------- Co-authored-by: ramon <ramonjd@gmail.com> Co-authored-by: James Koster <james@jameskoster.co.uk>
- Loading branch information
1 parent
ce1ef42
commit d585d3f
Showing
18 changed files
with
617 additions
and
89 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/edit-site/src/components/sidebar-navigation-data-list/data-list-item.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
__experimentalHStack as HStack, | ||
__experimentalText as Text, | ||
} from '@wordpress/components'; | ||
|
||
export default function DataListItem( { label, value } ) { | ||
return ( | ||
<HStack | ||
className="edit-site-sidebar-navigation_data-list__item" | ||
key={ label } | ||
spacing={ 5 } | ||
alignment="left" | ||
> | ||
<Text className="edit-site-sidebar-navigation_data-list__label"> | ||
{ label } | ||
</Text> | ||
<Text className="edit-site-sidebar-navigation_data-list__value"> | ||
{ value } | ||
</Text> | ||
</HStack> | ||
); | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/edit-site/src/components/sidebar-navigation-data-list/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __experimentalVStack as VStack } from '@wordpress/components'; | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import DataListItem from './data-list-item'; | ||
|
||
export default function SidebarDetails( { details } ) { | ||
return ( | ||
<VStack | ||
className="edit-site-sidebar-navigation_data-list" | ||
spacing={ 5 } | ||
> | ||
{ details.map( ( detail ) => ( | ||
<DataListItem | ||
key={ detail.label } | ||
label={ detail.label } | ||
value={ detail.value } | ||
/> | ||
) ) } | ||
</VStack> | ||
); | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/edit-site/src/components/sidebar-navigation-data-list/style.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
|
||
.edit-site-sidebar-navigation_data-list__item { | ||
.edit-site-sidebar-navigation_data-list__label { | ||
color: $gray-600; | ||
width: 100px; | ||
} | ||
|
||
.edit-site-sidebar-navigation_data-list__value.edit-site-sidebar-navigation_data-list__value { | ||
color: $gray-200; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/style.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
d585d3f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flaky tests detected in d585d3f.
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/5087412158
📝 Reported issues:
specs/editor/plugins/meta-attribute-block.test.js