Skip to content

Commit

Permalink
Add missing viewRevisions action
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Apr 11, 2024
1 parent 051a8f8 commit 0aa81bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/edit-site/src/components/page-patterns/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,17 @@ export default function DataviewsPatterns() {
},
[ history ]
);
const [ editAction ] = usePostActions( onActionPerformed, [ 'edit-post' ] );
const [ editAction, viewRevisionsAction ] = usePostActions(
onActionPerformed,
[ 'edit-post', 'view-post-revisions' ]
);
const actions = useMemo( () => {
if ( type === TEMPLATE_PART_POST_TYPE ) {
return [
editAction,
renameAction,
duplicateTemplatePartAction,
viewRevisionsAction,
resetAction,
deleteAction,
];
Expand All @@ -477,7 +481,7 @@ export default function DataviewsPatterns() {
resetAction,
deleteAction,
];
}, [ type, editAction ] );
}, [ type, editAction, viewRevisionsAction ] );
const onChangeView = useCallback(
( newView ) => {
if ( newView.type !== view.type ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const templatePartToPattern = ( templatePart ) => ( {
name: createTemplatePartId( templatePart.theme, templatePart.slug ),
title: decodeEntities( templatePart.title.rendered ),
type: templatePart.type,
_links: templatePart._links,
templatePart,
} );

Expand Down

0 comments on commit 0aa81bd

Please sign in to comment.