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

Migrate store/actions from editor package to fields package #65289

Merged
merged 26 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
67ff043
Migrate store and actions from editor package to fields package
gigitux Sep 12, 2024
a71e726
fix documentation
gigitux Sep 12, 2024
0141d8c
fix import
gigitux Sep 12, 2024
f21a974
remove duplicate code
gigitux Sep 12, 2024
7063ee8
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Sep 12, 2024
644dab1
update package-lock
gigitux Sep 12, 2024
3616964
refactor PR
gigitux Sep 12, 2024
f7f1d4d
fix mobile build
gigitux Sep 12, 2024
ae0efeb
update package.json
gigitux Sep 12, 2024
4356a42
migrate actions to @wordpress/fields package
gigitux Sep 12, 2024
bf1462a
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Sep 12, 2024
63adf35
reduce change
gigitux Sep 13, 2024
c938a15
register new action
gigitux Sep 13, 2024
66479da
improve code
gigitux Sep 13, 2024
0bf760d
fix actionId
gigitux Sep 13, 2024
08bb03d
update package-lock.json
gigitux Sep 13, 2024
b599c42
remove comment
gigitux Sep 13, 2024
337b3e5
rename function
gigitux Sep 13, 2024
1016ef8
rename functions
gigitux Sep 13, 2024
39d25d1
improve code
gigitux Sep 13, 2024
dc03f57
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Sep 16, 2024
60e7a58
Merge branch 'trunk' of github.com:WordPress/gutenberg into add/actio…
gigitux Sep 17, 2024
0316536
restore delete post action
gigitux Sep 18, 2024
485237f
fix import order
gigitux Sep 18, 2024
5a4fb59
move to a flat structure
gigitux Sep 18, 2024
0deeed3
remove not necessary file
gigitux Sep 18, 2024
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
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion packages/edit-site/src/components/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,14 @@ export default function EditSiteEditor( { isPostsList = false } ) {
( actionId, items ) => {
switch ( actionId ) {
case 'move-to-trash':
case 'delete-post':
case 'delete-template':
{
history.push( {
postType: items[ 0 ].type,
} );
}
break;
case 'delete-pattern':
{
history.push( {
postType: items[ 0 ].type,
Expand Down
109 changes: 0 additions & 109 deletions packages/editor/src/dataviews/actions/delete-post.tsx
youknowriad marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

147 changes: 0 additions & 147 deletions packages/editor/src/dataviews/actions/reset-post.tsx
Copy link
Contributor Author

@gigitux gigitux Sep 13, 2024

Choose a reason for hiding this comment

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

This action has been renamed into reset-template.

This file was deleted.

26 changes: 0 additions & 26 deletions packages/editor/src/dataviews/fields/index.ts
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These fields are already available in @wordpress/fields package.

This file was deleted.

19 changes: 11 additions & 8 deletions packages/editor/src/dataviews/store/private-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import { doAction } from '@wordpress/hooks';
/**
* Internal dependencies
*/
import duplicateTemplatePart from '../actions/duplicate-template-part';
import resetPost from '../actions/reset-post';
import trashPost from '../actions/trash-post';
import renamePost from '../actions/rename-post';
import restorePost from '../actions/restore-post';
import type { PostType } from '../types';
import { store as editorStore } from '../../store';
import { unlock } from '../../lock-unlock';
Expand All @@ -24,8 +19,14 @@ import {
reorderPage,
exportPattern,
permanentlyDeletePost,
restorePost,
trashPost,
renamePost,
deletePatternAction,
resetTemplateAction,
deleteTemplateAction,
} from '@wordpress/fields';
import deletePost from '../actions/delete-post';
import duplicateTemplatePart from '../actions/duplicate-template-part';

export function registerEntityAction< Item >(
kind: string,
Expand Down Expand Up @@ -117,9 +118,11 @@ export const registerPostTypeActions =
? reorderPage
: undefined,
postTypeConfig.slug === 'wp_block' ? exportPattern : undefined,
resetPost,
deletePatternAction,
resetTemplateAction,
restorePost,
deletePost,
resetTemplateAction,
deleteTemplateAction,
trashPost,
permanentlyDeletePost,
];
Expand Down
Loading
Loading