| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | import { UpdatePostStatusConfirm } from '@agent/workflows/content/components/UpdatePostStatusConfirm'; |
| 2 | +import { __ } from '@wordpress/i18n'; | |
| 2 | 3 | |
| 3 | 4 | const { context, abilities } = window.extAgentData; |
| 4 | 5 | |
| 5 | 6 | export default { |
| @@ -6,5 +7,32 @@ | ||
| 6 | 7 | available: () => |
| 7 | 8 | abilities?.canEditPosts && !context?.adminPage && context?.postId, |
| 8 | 9 | id: 'update-post-status', |
| 9 | 10 | whenFinished: { component: UpdatePostStatusConfirm }, |
| 11 | + example: { | |
| 12 | + text: __('Publish this page', 'extendify-local'), | |
| 13 | + agentResponse: { | |
| 14 | + // translators: Shown when the user clicks the "Publish this page" suggestion, above a confirm card. | |
| 15 | + reply: __('Ready to publish this page?', 'extendify-local'), | |
| 16 | + recommendations: [ | |
| 17 | + { | |
| 18 | + workflowId: 'add-post-to-menu', | |
| 19 | + label: __('Add this to the menu', 'extendify-local'), | |
| 20 | + icon: 'pencil', | |
| 21 | + }, | |
| 22 | + ], | |
| 23 | + whenFinishedTool: { | |
| 24 | + id: 'update-post-status', | |
| 25 | + inputs: { | |
| 26 | + postId: context?.postId, | |
| 27 | + postType: context?.postType, | |
| 28 | + updatedStatus: 'publish', | |
| 29 | + postStatus: context?.postStatus, | |
| 30 | + }, | |
| 31 | + labels: { | |
| 32 | + confirm: __('Published the page', 'extendify-local'), | |
| 33 | + cancel: __('Canceled publishing the page', 'extendify-local'), | |
| 34 | + }, | |
| 35 | + }, | |
| 36 | + }, | |
| 37 | + }, | |
| 10 | 38 | }; |