| 1 |
import { Redirect } from '@agent/workflows/theme/components/Redirect'; |
| 2 |
import { __ } from '@wordpress/i18n'; |
| 3 |
import { layout } from '@wordpress/icons'; |
| 4 |
import { SelectSiteDesign } from './components/change-site-design/SelectSiteDesign'; |
| 5 |
|
| 6 |
const { context, abilities } = window.extAgentData; |
| 7 |
|
| 8 |
const workflow = { |
| 9 |
available: () => |
| 10 |
abilities?.canEditThemes && |
| 11 |
!context?.adminPage && |
| 12 |
context?.postId && |
| 13 |
!context?.isBlogPage && |
| 14 |
context?.isBlockTheme, |
| 15 |
needsRedirect: () => !context?.isFrontPage, |
| 16 |
redirectComponent: () => |
| 17 |
Redirect( |
| 18 |
__( |
| 19 |
'It looks like you are trying to change your site design, but you are not on a page where we can do that.', |
| 20 |
'extendify-local', |
| 21 |
), |
| 22 |
), |
| 23 |
id: 'change-site-design', |
| 24 |
whenFinished: { |
| 25 |
component: SelectSiteDesign, |
| 26 |
}, |
| 27 |
example: { |
| 28 |
text: __('Change website design', 'extendify-local'), |
| 29 |
agentResponse: { |
| 30 |
// translators: This message show above a UI where the user can select a different site design. |
| 31 |
reply: __( |
| 32 |
'Below you can select a different design for your website.', |
| 33 |
'extendify-local', |
| 34 |
), |
| 35 |
recommendations: [ |
| 36 |
{ |
| 37 |
id: 'change-theme-colors', |
| 38 |
icon: 'styles', |
| 39 |
label: __('Change website colors', 'extendify-local'), |
| 40 |
workflowId: 'change-theme-variation', |
| 41 |
available: { context: ['hasThemeVariations'] }, |
| 42 |
}, |
| 43 |
{ |
| 44 |
id: 'change-site-title', |
| 45 |
icon: 'edit', |
| 46 |
label: __('Change website title', 'extendify-local'), |
| 47 |
workflowId: 'edit-wp-setting', |
| 48 |
available: { abilities: ['canEditSettings'] }, |
| 49 |
}, |
| 50 |
{ |
| 51 |
id: 'change-website-logo', |
| 52 |
icon: 'siteLogo', |
| 53 |
label: __('Change website logo', 'extendify-local'), |
| 54 |
workflowId: 'update-logo', |
| 55 |
available: { abilities: ['canEditSettings', 'canUploadMedia'] }, |
| 56 |
}, |
| 57 |
], |
| 58 |
whenFinishedTool: { |
| 59 |
id: 'change-site-design', |
| 60 |
labels: { |
| 61 |
confirm: __('Updated the website design', 'extendify-local'), |
| 62 |
cancel: __('Canceled the website design update', 'extendify-local'), |
| 63 |
}, |
| 64 |
}, |
| 65 |
}, |
| 66 |
}, |
| 67 |
icon: layout, |
| 68 |
}; |
| 69 |
|
| 70 |
export default workflow; |
| 71 |
|