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 24 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.

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.

14 changes: 7 additions & 7 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,13 @@ import {
reorderPage,
exportPattern,
permanentlyDeletePost,
restorePost,
trashPost,
renamePost,
resetTemplateAction,
deletePost,
} 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,8 +117,8 @@ export const registerPostTypeActions =
? reorderPage
: undefined,
postTypeConfig.slug === 'wp_block' ? exportPattern : undefined,
resetPost,
restorePost,
resetTemplateAction,
deletePost,
trashPost,
permanentlyDeletePost,
Expand Down
20 changes: 20 additions & 0 deletions packages/fields/README.md
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In a dedicated PR, I will improve documentation.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ npm install @wordpress/fields --save

<!-- START TOKEN(Autogenerated API docs) -->

### deletePost

Undocumented declaration.

### duplicatePattern

Undocumented declaration.
Expand Down Expand Up @@ -42,6 +46,10 @@ Undocumented declaration.

Undocumented declaration.

### renamePost

Undocumented declaration.

### reorderPage

Undocumented declaration.
Expand All @@ -50,10 +58,22 @@ Undocumented declaration.

Undocumented declaration.

### resetTemplateAction

Undocumented declaration.

### restorePost

Undocumented declaration.

### titleField

Undocumented declaration.

### trashPost

Undocumented declaration.

### viewPost

Undocumented declaration.
Expand Down
1 change: 1 addition & 0 deletions packages/fields/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
],
"dependencies": {
"@babel/runtime": "^7.16.0",
"@wordpress/api-fetch": "file:../api-fetch",
"@wordpress/blob": "file:../blob",
"@wordpress/blocks": "file:../blocks",
"@wordpress/components": "file:../components",
Expand Down
1 change: 1 addition & 0 deletions packages/fields/src/actions/base-post/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export { default as reorderPage } from './reorder-page';
export { default as reorderPageNative } from './reorder-page.native';
export { default as duplicatePost } from './duplicate-post';
export { default as duplicatePostNative } from './duplicate-post.native';
export { default as renamePost } from './rename-post';
Loading
Loading