Compare commits

...

686 Commits

Author SHA1 Message Date
d3ee265122 Release 4.6.0 2023-01-31 10:09:16 +01:00
10dcc4f45d Fix failing test due to a changed DMARC policy
It seems that the DMARC policy for automattic.com was changed from
"quarantine" to "reject".

[MAILPOET-5038]
2023-01-30 14:40:17 -03:00
3237351450 Move code to handle tracking source of wizard to its own file
Doing this based on feedback during the PR review: https://github.com/mailpoet/mailpoet/pull/4660/files#r1073420154

[MAILPOET-4814]
2023-01-30 15:01:42 +01:00
8d57e81b99 Use return type hint instead of docblock to tell PHP the return type
[MAILPOET-4814]
2023-01-30 15:01:42 +01:00
e37daa6c66 Delete setting instead of updating it when tracking wizard source
[MAILPOET-4814]
2023-01-30 15:01:42 +01:00
ad4247a241 Add API endpoint to delete a setting
[MAILPOET-4814]
2023-01-30 15:01:42 +01:00
8a4f5c13da Add tracking for users arriving to the wizard from WooCommerce
MailPoet adds a link to the WooCommerce task list pointing to its own
welcome wizard. We want to track users that arrive to the MP wizard from
WooCommerce but at this point tracking is not enabled. So we store the
information in a setting, and send the tracking event to Mixpanel, if it
is enabled, after the user completes the wizard.

[MAILPOET-4814]
2023-01-30 15:01:42 +01:00
1161e6f3f6 Add MailPoet task to WooCommerce homepage
[MAILPOET-4814]
2023-01-30 15:01:42 +01:00
e5d5e20efd Add escaping into rendering homepage_link shortcode
[MAILPOET-4936]
2023-01-30 14:39:35 +01:00
9fcb9afa9d Add site:homepage_url shortcode to helper
[MAILPOET-4936]
2023-01-30 14:39:35 +01:00
b24b7b86fd Update homepage link in default settings for confirmation email
[MAILPOET-4936]
2023-01-30 14:39:35 +01:00
ddca94891d Unify rendering site:homepate_link shortcode with value from helper
[MAILPOET-4936]
2023-01-30 14:39:35 +01:00
9f14f3cc08 Change inserted text in shortcode helper for Homepage link
[MAILPOET-4936]
2023-01-30 14:39:35 +01:00
6b3fc309cc Add new shortcode [site:homepage_url]
[MAILPOET-4936]
2023-01-30 14:39:35 +01:00
60d933b39a Fix capitalization of MSS
[MAILPOET-5030]
2023-01-30 14:25:41 +01:00
ea57fd9c11 Update pronouns in a string from "his/her" to "their"
[MAILPOET-5028]
2023-01-30 14:24:21 +01:00
a9788b04d4 Remove Code Sniffer ignore
[MAILPOET-4900]
2023-01-30 14:13:33 +01:00
46c45d9bef Fix consolidation/robo PHP 8.2 deprecation notices
[MAILPOET-4900]

When a new robo version with a fix for 'self' in callables is released,
this patch can be removed. Check here:
https://github.com/consolidation/robo/issues/1135
2023-01-30 14:13:33 +01:00
3282e2f063 Update robo and its dependency to PHP 8.2 compatible versions
[MAILPOET-4900]
2023-01-30 14:13:33 +01:00
05e941e449 Allow dynamic genration of coupon code for some newsletters
Those newsletters that allow updating their body html should
persist the couponId along side the Coupon block settings so
that on the next rendering attempt the same coupon code is
used

[MAILPOET-4763]
2023-01-30 12:46:38 +01:00
6a14a3f7b1 Stop saving invalid input values
MAILPOET-4762
2023-01-30 11:48:48 +01:00
b858f1159a Update tests and remove unused variables
MAILPOET-4762
2023-01-30 11:48:48 +01:00
f3d73aae03 Escape the content for placeholder
MAILPOET-4762
2023-01-30 11:48:48 +01:00
494723c818 Use WooCommerce decimal separators when validating input fields
We need to use the decimal separators selected by the user for our validation. We are also using the validation used on the adding/editing coupon page

MAILPOET-4762
2023-01-30 11:48:48 +01:00
93af9d491d Add validation for some fields
MAILPOET-4762
2023-01-30 11:48:48 +01:00
b07d34ee23 Fix tests
MAILPOET-4762
2023-01-30 11:48:48 +01:00
4b2b94db9e Add Products and Exclude products Usage restriction fields
MAILPOET-4762
2023-01-30 11:48:48 +01:00
77b9cea62c Add Product categories and Exclude categories Usage restriction fields
MAILPOET-4762
2023-01-30 11:48:48 +01:00
e2dc137b59 Add Usage limit fields and half of Usage restriction fields
MAILPOET-4762
2023-01-30 11:48:48 +01:00
2da4f5f3b9 Add basic accordion to group coupon data and free shipping field
MAILPOET-4762
2023-01-30 11:48:48 +01:00
7549ed7f0f Add other WooCommerce coupon option methods
MAILPOET-4762
2023-01-30 11:48:48 +01:00
0719f3c4e3 Add small code style improvements
[MAILPOET-4761]
2023-01-30 09:36:21 +01:00
ba055b4278 Move static variable into a property
[MAILPOET-4761]
2023-01-30 09:36:21 +01:00
0b5a809883 Extend CouponPreProcessor unit test
[MAILPOET-4761]
2023-01-30 09:36:21 +01:00
a4f7a05bff Disable coupon generating when coupon id is set
[MAILPOET-4761]
2023-01-30 09:36:21 +01:00
1730578a23 Use coupon id instead of text
[MAILPOET-4761]
2023-01-30 09:36:21 +01:00
f88623e48d Add settings code and resetting placeholder
[MAILPOET-4761]
2023-01-30 09:36:21 +01:00
46fdd8eeb3 Add select with existing coupons
[MAILPOET-4761]
2023-01-30 09:36:21 +01:00
40f4216ff8 Add method for getting WC coupons
[MAILPOET-4761]
2023-01-30 09:36:21 +01:00
fe536fcdd0 Add coupon source switch
[MAILPOET-4761]
2023-01-30 09:36:21 +01:00
62cff7b388 Refactor analytics data campaigns_count to be more future proof
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
b24beb1dae Track only revenue data in the current shop currency
This is a protection against an edge case when a shop changes
the currency. We want to make sure we don't mix currencies.
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
b52c53f7f5 Add comment about revenue being tracked once per purchase
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
f66be1b947 Improve typehints and doctypes for the woo revenue tracking
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
5d3b26bb58 Remove unnecessary tracking enabled check
Registering the hook doesn't cost us much and it makes sense to register
it even when the tracking is disabled so that the data are always loaded
when calling: wp wc tracker snapshot --format=yaml
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
55b64d0354 Flatten array campaigns revenue tracking data
This format will be more suitable for further processing for Looker.
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
7ce1b6eb6c Cast numeric revenue tracking data
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
97b42a4a91 Add currency of the store to the tracking data
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
bedde323bd Add proper test group for the tracker integration test
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
0cf2787937 Add email campaigns count to WC tracker data
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
f0bc53766b Catch and log errors when fetching data in MailPoet Woo Tracker
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
f7fc2c16c1 Add Woo revenues to test/dev data generator for Woo revenues
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
f6d80b6e8b Fix type error in Woo orders data generator script
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
17d3f66316 Register filter for tracking revenue data
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
23e08ecb44 Add method for fetching revenue data for the WC Tracker
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
4dfdfc8423 Add dummy Woo Tracker class
[MAILPOET-5014]
2023-01-30 09:21:39 +01:00
5cdce529b5 Create integration docker containers prior running tests
This fixes Error response from daemon: Conflict. The container name "/wordpress_0".
which occasionally occurs when integration tests start.
We applied the same fix for the acceptance tests and it fixed the issue.
[MAILPOET-4947]
2023-01-30 09:15:23 +01:00
522b8a87db Fix flaky MailerLog testItTruncatesOutdatedEntriesWhenIncrementingSentCount
The test was setting the value that was later checked to the very edge of the allowed interval.
So if the tested method was executed a second later test failed.
This commit sets the tested value a second before the end or the interval so
there should be enough time for the method to run with the expected outcome.
[MAILPOET-4866]
2023-01-30 09:32:31 +02:00
6e8660dcc4 Update Readme with the remaining info
[MAILPOET-4944]
2023-01-26 16:46:58 +01:00
936b7fed74 Update Readme with test environment
[MAILPOET-4944]
2023-01-26 16:46:58 +01:00
d87794aa1f Reorder tests structure
[MAILPOET-4944]
2023-01-26 16:46:58 +01:00
8675aaef6e Update Readme with headless info 2023-01-26 16:46:58 +01:00
824e097639 Update Readme file 2023-01-26 16:46:58 +01:00
dce8e94f8e Add Readme file
[MAILPOET-4944]
2023-01-26 16:46:58 +01:00
e22ffcb5e3 Establishing k6 into mailpoet env
[MAILPOET-4944]
2023-01-26 16:46:58 +01:00
8f94096cdd Hide unnecessary close button, that causes vertical scrollbars in form editor on desktops
[MAILPOET-4607]
2023-01-26 14:45:33 +01:00
faa17b0d5c Add animation on close button in form editor
[MAILPOET-4607]
2023-01-26 14:45:33 +01:00
c4d4a6e594 Add bottom padding so the HelpScout icon never overlays editor's UI
[MAILPOET-4605]
2023-01-26 14:27:55 +01:00
9937bcc2d5 Remove custom HelpScout position in form editor
[MAILPOET-4605]
2023-01-26 14:27:55 +01:00
031c7d9866 Expose external link component
[PREMIUM-215]
2023-01-26 14:12:22 +01:00
0e84ddb957 Fix error styles for radio inputs
[PREMIUM-215]
2023-01-26 14:12:22 +01:00
5672823472 Export automation config for reuse
[PREMIUM-215]
2023-01-26 14:12:22 +01:00
d03e11f938 Use detected locale in localized strings
[PREMIUM-215]
2023-01-26 14:12:22 +01:00
3dbd91bfef Add Intl.Locale detection for formatting localized strings
[PREMIUM-215]
2023-01-26 14:12:22 +01:00
d0ff2a9eae Process also day format for custom fields
Although not currently offered in the UI, day format is partially implemented and passes validation.

[PREMIUM-215]
2023-01-26 14:12:22 +01:00
78314944aa Do not require default props in the premium plugin
This aligns the configuration with the free plugin.

[PREMIUM-215]
2023-01-26 14:12:22 +01:00
872bf07b25 Remove hover effect from plain titles
This is consisteng with Gutenberg editor behavior.

[PREMIUM-215]
2023-01-26 14:12:22 +01:00
17b79ee29f Expose textarea, radio, and select components
[PREMIUM-215]
2023-01-26 14:12:22 +01:00
f5b411e2ae Use plugin context for segments in automation UI
[PREMIUM-215]
2023-01-26 14:12:22 +01:00
e3e865eac5 Use plugin context to load list of segments
[PREMIUM-215]
2023-01-26 14:12:22 +01:00
6b7ffbc4ad Allow plugins to add their own context data for automation editor
[PREMIUM-215]
2023-01-26 14:12:22 +01:00
4ddcc14eee Rename context to registry
This will align better with the backend naming as well as free up "context" for other purposes.

[PREMIUM-215]
2023-01-26 14:12:22 +01:00
7bca78e268 Add placeholder step for subscriber update action
[PREMIUM-215]
2023-01-26 14:12:22 +01:00
82159dd4c5 Hide Screen options from Landing Page
[MAILPOET-5017]
2023-01-26 09:31:27 +01:00
1e76b214ea Don't load HelpScout Beacon on Dotcom Ecommerce plan
[MAILPOET-5017]
2023-01-26 09:31:27 +01:00
8c44364dab Hide Screen options from Welcome Wizard
[MAILPOET-5017]
2023-01-26 09:31:27 +01:00
7aea3528c4 Allow full-site-editing and wpcomsh plugins in ConflictResolver
[MAILPOET-5017]
2023-01-26 09:31:27 +01:00
b7809608d1 Fix distorted website icon on Dotcom
[MAILPOET-5017]
2023-01-26 09:31:27 +01:00
19bb957ae7 Fix confirmation link text
[MAILPOET-4931]
2023-01-25 20:22:08 +01:00
6e5ba84aab Disable visual editor for confirmation email in acceptance test
[MAILPOET-4931]
2023-01-25 20:22:08 +01:00
1a20f53916 Allow confirmation emails preview
[MAILPOET-4931]
2023-01-25 20:22:08 +01:00
57d364d142 Enable visual confirmation emails by default
[MAILPOET-4931]
2023-01-25 20:22:08 +01:00
89f76f67ca Rename old migrations
Because we expect that our plugin can recover from an invalid DB state.
We rename old migrations that ensure both migrations are executed again.
[MAILPOET-4962]
2023-01-25 20:21:13 +01:00
5e589cd5e3 Release 4.5.2 2023-01-25 13:52:19 -03:00
139fb2f1ad Hide Automations and Upgrade in landingpage
[MAILPOET-5019]
2023-01-25 13:42:43 +01:00
5e7ece1e87 Add mailpoet-landingpage to avoid redirection
[MAILPOET-5019]
2023-01-25 13:42:43 +01:00
47a4e3b4e9 Hide menu entries when not setup yet
[MAILPOET-5019]
2023-01-25 13:42:43 +01:00
0019ad110e Update DisplayFormInWPContent::display method type and add more tests
MAILPOET-4885
MAILPOET-4820
2023-01-25 13:15:08 +01:00
62325dc096 Fix multiple forms display on pages with Woocommerce [products] shortcode
MAILPOET-4885
2023-01-25 13:15:08 +01:00
290aceb0e9 Update copy of list visibility setting
[MAILPOET-4906]
2023-01-25 08:59:29 +01:00
a9f4e47fe0 Release 4.5.1 2023-01-24 11:47:42 -03:00
ede135c2b4 Update pnpm to the latest version
[MAILPOET-5016]
2023-01-24 15:51:21 +02:00
8ba6739356 Remove forgotten console.log
[MAILPOET-4686]
2023-01-23 17:01:13 +01:00
cef5959fff Add small code improvements
I added small code style fixes based on the code review.
[MAILPOET-4686]
2023-01-23 17:01:13 +01:00
9f81b2c787 Hide modal with poll in test
[MAILPOET-4686]
2023-01-23 17:01:13 +01:00
5885bd7f84 Add deactivation poll initialization
[MAILPOET-4686]
2023-01-23 17:01:13 +01:00
f1d8ba51df Add deactivation poll config wrapper
[MAILPOET-4686]
2023-01-23 17:01:13 +01:00
39a9bf8e4c Add semantic markup for homepage section component
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
8dfb36cc3c Remove unused classname from product discovery list
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
fdbd25c513 Refactor always use camel case within homepage data passed to JS
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
ef5ec6367e Extend homepage acceptance test to check also product discovery section
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
c5b181949b Make complete tasks in product discovery non clickable
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
03d7306611 Add check from automation flows with welcome emails
This commit improves the check that a user has set a welcome email campaign (a task in product discovery task list)
by checking also for automation flows that are triggered by new subscriber or user and contain
send email action.
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
fd5e8b6855 Add tracking of homepage discovery tasks clicks
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
47e46aeebe Improve mixpanel track wrapper to support options and callback params
When tracking links we need to use callback parameter to ensure the event is tracked
before the page is redirected to the link.
See https://developer.mixpanel.com/docs/javascript-full-api-reference#mixpaneltrack
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
56aae5cc99 Add dismiss product discovery CTA when all tasks are done
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
84df282c0a Add css for small screens for product discovery
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
a95c5bd1e9 Style product discovery section
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
c1b552b5ff Display proper product discovery tasks if Woo is active
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
18c2e53af8 Display different message when discovery task is done
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
e3808f7a61 Display product discovery tasks status in UI
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
68187a0fb6 Add product discovery status detection to homepage data service
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
f50dcd3bd1 Fetch task list status only when task list is displayed
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
ce8191ad6c Add test for HomepageDataController
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
5fe02fcc3e Refactor homepage data fetching to a new service
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
f31086f790 Refactor section hiding from specific homepage sections to parent component
This was done so that we can safely skip loading data for hidden sections.
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
be20537587 Refactor homepage contents to an extra component
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
708813c6cb Display illustrations in product discovery tasks
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
3b3cd055df Add illustration assets for product discovery tasks
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
4b438242ab Add simple product discovery tasks
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
722e6f9d27 Add functionality for hiding the product discovery section
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
7b431d9291 Add basic product discovery component
[MAILPOET-4827]
2023-01-23 16:48:52 +01:00
30c6e6f769 Set reasonable default values until validation is built
[MAILPOET-4678]
2023-01-23 16:37:55 +01:00
8b2b8c3d48 Reduce standalone wait time from 10s to 2s.
We plan to increase this wait time if the test gets flakier

MAILPOET-4881
2023-01-23 16:23:30 +01:00
0b5c65d568 Fix ManageSegmentsCest:deleteExistingSegment
MAILPOET-4881
2023-01-23 16:23:30 +01:00
49b2f5528f Remove Migration class
Remove from container, test factory and PHPStan baselines.

[MAILPOET-4478]
2023-01-23 15:35:50 +01:00
6bc58e23c9 Remove Migration worker
[MAILPOET-4478]
2023-01-23 15:35:50 +01:00
7e66adcc0b Remove check for active migration
[MAILPOET-4478]
2023-01-23 15:35:50 +01:00
24b906a738 Use Bounce instead of Migration in test
[MAILPOET-4478]
2023-01-23 15:35:50 +01:00
ddbce0d636 Remove migration test cases
Remove also the function to enable the migration.

[MAILPOET-4478]
2023-01-23 15:35:50 +01:00
277f870178 Remove migration test
[MAILPOET-4478]
2023-01-23 15:35:50 +01:00
4be7f37bbc Remove the feature flag from Landing page
MAILPOET-4803
2023-01-23 15:13:38 +01:00
9ac18ab69e Update styling and use semantic HTML
MAILPOET-4799
2023-01-23 14:09:16 +01:00
1bec3b4637 Remove image assets from plugin directory
MAILPOET-4799
2023-01-23 14:09:16 +01:00
33e74bb0dd Fix mobile issues for FAQ section
MAILPOET-4799
2023-01-23 14:09:16 +01:00
89d5f108e4 Design the landing page
Add the content and images for the landing page

MAILPOET-4799
2023-01-23 14:09:16 +01:00
e4d00171b4 Fix issue in test where string was set to newsletter body
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
9f070f1914 Check blockDefaults.coupon when trying to delete its props
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
94b5803337 Cleanup coupon data from template on save
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
9a2d4e83b2 Change NewsletterCoupon::cleanupSensitiveData signature
This change allows passing body array and retuning body array
so that NewsletterEntity instance doesn't need to get passed
around

[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
59d91ff7ef Fix failing unit test
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
bfe658fc86 Replace coupon code with code placeholder when duplicationg
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
7ced42a494 Fix bug when duplicated newsletter uses the source's coupon
On duplication, the sensitive data of the coupon were
inherited from the source

[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
6164a92b9f Cleanup coupon sensitive data from blockDefaults
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
7b11962bf2 Update translators hint for the coupon description
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
3c7f1021b6 Re-adjust percent sign positioning
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
644412998a Adjust percent sign positioning
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
c1afee57e9 Fix bug causing the percent sign to move on scroll
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
ac1d014562 Fix bug in validating on render
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
71322ee512 Add newsletter id to the coupon description
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
dc2638a3ab Augment comment for CouponPreProcessor::shouldPersist
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
41b23b24b9 Add Coupon block feature flag
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
9c8afa85d4 Add more unit tests for CouponPreProcessor
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
18c3424f03 Add validation to expiry days field of coupon block
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
1b1ee34acf Adjust styling and add validation to coupon amount
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
d963bb4e7d Update coupon setting view styling
Adds percentage sign when the discount type is of percentage
type, adjusts the width and view of coupon amount field

[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
b1f42bbeba Add unit tests for CouponPreProcessor
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
dcdb447578 Properly check for existance of code in coupon block setting
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
39d22bdd62 Move Coupon instantiation to MailPoet\WooCommerce\Helper
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
e4c9d037b1 Add missing strict_types to Coupon.php
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
d1ad7fecd7 Fix mistake in comment
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
4b92a9a4a5 Allow coupon generation per render for automatic emails
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
9d65fe8d5e Persist coupon block expiration in WC_Coupon
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
c353830163 Make sure coupon code placeholder doesn't generate coupon
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
6dd87b0dec Add functionality to update coupon when block settings change
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
fa3216be9b Set missing parameters when creating coupon
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
31201eb3cc Generate coupon code for each coupon block missing the code
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
48c075b730 Add WC helper function to retrieve coupon code from id
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
14c85e3380 Pass Coupon code placeholder from PHP and unify
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
f551d4388c Add CouponPreprocessor to create coupons before rendering
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
751dc539f6 Add information overlay to Coupon block
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
d305680ba5 Remove coupon code input from the settings sidebar
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
bb7775f87b Render Coupon block in email body
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
54d9b517dd Adjust coupon block styling in editor
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
199910a52f Add coupon block config
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
983102c094 Add Coupon block setting pane
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
0d330e08b4 Bootstrap Coupon block and make it function
[MAILPOET-4678]
2023-01-23 13:31:34 +01:00
ccd1a5363d Fix typo in variable
[MAILPOET-4510]
2023-01-19 10:52:51 +01:00
c368b130b8 Add wait calls to prevent calling translations API too quickly
This commit is an attempt to prevent 429 "Too manu requests" errors
we sometimes experience during the Switching languages test.
[MAILPOET-4969]
2023-01-17 14:21:59 +01:00
3ffe99d5ab Release 4.5.0 2023-01-17 15:14:55 +02:00
339068c086 Set isBusy state for OptionButton
[MAILPOET-4918]
2023-01-16 14:15:23 +01:00
dad40e262f Set isBusy state for FromScratch buttons
[MAILPOET-4918]
2023-01-16 14:15:23 +01:00
0bbd65ac61 Sanitize segment data when persisty via public API
[MAILPOET-4942]
2023-01-16 13:59:30 +01:00
1a7b7d1936 Escape segment name for usage in html select
[MAILPOET-4942]
2023-01-16 13:59:30 +01:00
2bbaa246d7 Sanitize name and description of segment when saving
[MAILPOET-4942]
2023-01-16 13:59:30 +01:00
296ec54c3e Add function preparing error response
[MAILPOET-4639]
2023-01-16 13:46:07 +01:00
579de1cc86 Reduce the count of constants
[MAILPOET-4639]
2023-01-16 13:46:07 +01:00
da88250fe1 Update integration tests
[MAILPOET-4639]
2023-01-16 13:46:07 +01:00
ad831316ab Remove unused constants
[MAILPOET-4639]
2023-01-16 13:46:07 +01:00
2e97cb6924 Fix tests after last changes
[MAILPOET-4639]
2023-01-16 13:46:07 +01:00
c79787c677 Extract domain creation error messages from bridge to strings
As a part of those changes I tried to unify the array key with error messages.
[MAILPOET-4639]
2023-01-16 13:46:07 +01:00
07954dd968 Extract domain verification error messages from bridge to strings
As a part of those changes I tried to unify the array key with error messages.
[MAILPOET-4639]
2023-01-16 13:46:07 +01:00
2ace6da75b Extract email authorization error messages from bridge to strings
As a part of those changes I tried to unify the array key with error messages.
[MAILPOET-4639]
2023-01-16 13:46:07 +01:00
982568445b Extract sending error messages from bridge to strings
The original error is stored under a new key for easier handling an error state.
[MAILPOET-4639]
2023-01-16 13:46:07 +01:00
a53e446583 Add request cache to TranslationUpdater
WP may call the action we hook into more times during one request.
This commit adds simple caching to prevent multiple requests.
[MAILPOET-4909]
2023-01-12 14:08:31 +01:00
b033d7d92f Add error logging when fetching language packs info
[MAILPOET-4909]
2023-01-12 14:08:31 +01:00
1190d61ca3 Update mailpoet_shortcodes tinyMce extension to work with v6
[MAILPOET-4963]
2023-01-11 14:19:03 +01:00
7da5cc847f Make completed tasks in task list not interact-able
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
2778244faf Use nicer name for property that indicates complete task
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
3789379084 Add error boundaries to the homepage app
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
72e3c87190 Add basic acceptance test for the homepage task list
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
38640e65e4 Add complete state task titles and additional task contents
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
e0718f11ea Add message when task list is complete
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
eb7cc97ca2 Add styles for task list heading
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
24d3c0b13b Display WooCommerce import task based on customers count
We use the same logic in WooCommerce setup page
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
ec0b1d4de8 Highlight current task in task list on homepage
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
56c90ef452 Add styles and links for homepage task list
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
5f0ac0ec7e Render simple task list items with state info
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
8c767af5c6 Store homepage task list was dismissed to DB
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
b0e8263e2f Hide the task list and store the state in the store
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
be592dbf9b Add an empty wordpress/data store to homepage
We plan to add more dynamic sections to the homepage so I want to set up and use the
store from the beginning.
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
3679320483 Add dummy hide list button
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
51ab4523f8 Add basic task list component for homepage
[MAILPOET-4826]
2023-01-11 11:30:10 +01:00
60abe14c7a Remove text-domain rule from shared-ruleset
[MAILPOET-4913]
2023-01-11 07:46:57 +02:00
f58b5e61b0 Use new ruleset for free plugin
[MAILPOET-4913]
2023-01-11 07:46:57 +02:00
dbb972ec3f Create ruleset for free and premium and a shared ruleset
[MAILPOET-4913]
2023-01-11 07:46:57 +02:00
1930410754 Release 4.4.0 2023-01-10 15:45:22 +01:00
539df2a994 Switch to @wordpress/i18n and clean up
MAILPOET-4798
2023-01-10 15:23:50 +01:00
ad41ef2f5e Add FAQ accordion and contents
MAILPOET-4798
2023-01-10 15:23:50 +01:00
7ed0a92eda Add padding class to header and footer
MAILPOET-4798
2023-01-10 15:23:50 +01:00
9471314917 Add Landingpage Faq component and text
MAILPOET-4798
2023-01-10 15:23:50 +01:00
69440ec2a6 Add migration with a fix for inconsistent MailerLog data
[MAILPOET-4940]
2023-01-09 20:01:47 +01:00
0bbdf4b47f Add error log when pausing sending due an error
[MAILPOET-4940]
2023-01-09 20:01:47 +01:00
f11aca925f Do not attempt to send a confirmation email when sending is paused
When sending is paused due to some MSS configuration error the confirmation
email error may cause that the important error from MSS gets overwritten
event reset in case the mail is accidentally sent.
[MAILPOET-4940]
2023-01-09 20:01:47 +01:00
e4029a607a Adopt logging test to warning instead of error
[MAILPOET-4639]
2023-01-09 15:23:48 +01:00
eb53973799 Remove logEntity cleanup
[MAILPOET-4639]
2023-01-09 15:23:48 +01:00
aab8281af0 Remove request data from logged context
[MAILPOET-4639]
2023-01-09 15:23:48 +01:00
3df00548ab Change logged error to warning
[MAILPOET-4639]
2023-01-09 15:23:48 +01:00
ada346f4ef Add logging to php error log
[MAILPOET-4104]
2023-01-09 15:23:48 +01:00
b3691a4625 Detach invalid entity
[MAILPOET-4104]
2023-01-09 15:23:48 +01:00
e02b631172 Add log entities cleanup
[MAILPOET-4104]
2023-01-09 15:23:48 +01:00
2200411455 Add test case for logged error
[MAILPOET-4104]
2023-01-09 15:23:48 +01:00
b0ab2f404f Add logging errors to the log table
[MAILPOET-4104]
2023-01-09 15:23:48 +01:00
4195428643 Add API topic
[MAILPOET-4104]
2023-01-09 15:23:48 +01:00
1692c9bef5 Fix typo in strings
MAILPOET-4797
2023-01-09 14:38:09 +01:00
cb25cf2944 Handle redirect to welcome wizard with named function
MAILPOET-4797
2023-01-09 14:38:09 +01:00
794c5ce2d5 Extract landing page content into Header and Footer components
MAILPOET-4797
2023-01-09 14:38:09 +01:00
974d2d5a59 Add welcome_wizard_url variable
MAILPOET-4797
2023-01-09 14:38:09 +01:00
2ebcad1468 Exclude Notices from landingpage
MAILPOET-4797
2023-01-09 14:38:09 +01:00
671c7eed7d Add React landingpage component
MAILPOET-4797
2023-01-09 14:38:09 +01:00
72de76fe9b Fix multi site tests 2023-01-09 10:49:24 +01:00
53cc357632 Fix step info being rendered inside inserter popover
[MAILPOET-4922]
2023-01-06 18:31:36 +01:00
47d3472fef Fix acceptance tests error and add acceptance test for landing page
MAILPOET-4795
2023-01-06 18:29:46 +01:00
05c5b46089 Redirect to landingpage when welcome wizard is not filled
MAILPOET-4795
2023-01-06 18:29:46 +01:00
f85bd8622f Add comment explaining the usage of the method
MAILPOET-4795
2023-01-06 18:29:46 +01:00
503cf61c0f Do not redirect when activated with bulk activation mode
MAILPOET-4795
2023-01-06 18:29:46 +01:00
d9eca55189 Redirect to Landing page after plugin activation
MAILPOET-4795
2023-01-06 18:29:46 +01:00
e850eaa90c Add Landing page and hide behind feature flag
MAILPOET-4795
2023-01-06 18:29:46 +01:00
478eab61e4 Add Landingpage feature flag
MAILPOET-4795
2023-01-06 18:29:46 +01:00
ea53728799 Add period at the end of delay action description
[MAILPOET-4928]
2023-01-06 18:26:30 +01:00
914d0d37c0 Add periods at the end of automation action descriptions
[MAILPOET-4928]
2023-01-06 18:26:30 +01:00
c1aae2c192 Update usage of settings inside tinymce callbacks
Settings are now accesable via this.options.get
[MAILPOET-4213]
2023-01-04 14:46:59 +01:00
03cdcb30f8 Add missing tinymce DOM model
[MAILPOET-4213]
2023-01-04 14:46:59 +01:00
a462e72b30 Update name of the used plugin from formatselect to blocks
In v6 formatselect is renamed to blocks
[MAILPOET-4213]
2023-01-04 14:46:59 +01:00
83db3db90d Remove explicit addition of paste plugin as it's added to core
[MAILPOET-4213]
2023-01-04 14:46:59 +01:00
9495a40900 Convert TextEditorBehavior.js to TS
[MAILPOET-4213]
2023-01-04 14:46:59 +01:00
dbc2c9c240 Update tinymce package
[MAILPOET-4213]
2023-01-04 14:46:59 +01:00
d6bd1a5527 Release 4.3.1 2023-01-03 13:58:02 -06:00
c5cd863f15 Use database() value for column existing detection
[MAILPOET-4916]
2023-01-02 14:37:33 +01:00
8ef1bfaf24 Add acceptance test for homepage basic functionality
[MAILPOET-4825]
2023-01-02 14:13:53 +01:00
abac8d7147 Move MailerError notice component to notices namespace
[MAILPOET-4825]
2023-01-02 14:13:53 +01:00
367bcaf233 Refactor MailerError notice props to camel case
[MAILPOET-4825]
2023-01-02 14:13:53 +01:00
fdbb9428d9 Refactor MailerError notice to Typescript
[MAILPOET-4825]
2023-01-02 14:13:53 +01:00
bd047a0108 Automatically hide MailerError notice after resuming sending
[MAILPOET-4825]
2023-01-02 14:13:53 +01:00
05202d572f Add Mailer Error notice to homepage
This commit reuses the MailerError component to render important errors related to issues in sending.

I needed to slightly modify the MailerError notice component to be able to render as inline notice.
When rendered as non-inline WordPress JS code grabbed it and moved in DOM breaking all callbacks.
[MAILPOET-4825]
2023-01-02 14:13:53 +01:00
a698e416ad Allow all permanent notices on all pages except the wizard page
[MAILPOET-4825]
2023-01-02 14:13:53 +01:00
1efc417f82 Add TransactionalEmailsProposeOptInNotice on homepage
[MAILPOET-4825]
2023-01-02 14:13:53 +01:00
4dc31bbdb0 Add InvalidMssKeyNotice to homepage
[MAILPOET-4825]
2023-01-02 14:13:53 +01:00
12dc727fda Refactor SubscribersLimitNotice to TS
[MAILPOET-4825]
2023-01-02 14:13:53 +01:00
6602103d0f Add email volume limit notice
[MAILPOET-4825]
2023-01-02 14:13:53 +01:00
f3e8fb8ae2 Add subscribers limit notice to homepage
[MAILPOET-4825]
2023-01-02 14:13:53 +01:00
a205d4d7f4 Add basic support for dynamic notices
[MAILPOET-4825]
2023-01-02 14:13:53 +01:00
1783ca6e42 Add basic top bar with beamer at homepage
[MAILPOET-4825]
2023-01-02 14:13:53 +01:00
6555833fb6 Add test case for scheduled tasks
[MAILPOET-3995]
2023-01-02 12:07:24 +01:00
ce3b9b2b7b Remove redundant variables
[MAILPOET-3995]
2023-01-02 12:07:24 +01:00
1a653c5676 Add small code style improvements
[MAILPOET-3995]
2023-01-02 12:07:24 +01:00
85a8d8aedb Move more specific conditions into private methods
[MAILPOET-3995]
2023-01-02 12:07:24 +01:00
5c453fcd54 Add list of simple workers
To avoid code repetition I added a const with a list of simple workers that was used in a loop.
[MAILPOET-3995]
2023-01-02 12:07:24 +01:00
ec9adf8a6c Add missing test cases
[MAILPOET-3995]
2023-01-02 12:07:24 +01:00
b5064ca46f Remove old model from WordPressTest
[MAILPOET-3995]
2023-01-02 12:07:24 +01:00
84b97ead76 Make parameter scheduledAt optional
[MAILPOET-3995]
2023-01-02 12:07:24 +01:00
4e578238f7 Improve code style in WordPressTest
[MAILPOET-3995]
2023-01-02 12:07:24 +01:00
bb6d6137aa Stop checking if website is on HTTPS for 1-click-unsubscribe
[MAILPOET-4859]
2022-12-29 11:18:25 +01:00
74c7728e3a Fix issue with passing too few params to tested class 2022-12-28 20:02:36 +03:00
e13113e38b Fix condition for pausing sending when confirmation emails fail
[MAILPOET-4736]
2022-12-28 14:25:56 +01:00
68db0dbefe Don't process soft sending errors via MailerLog in confirmation mailer
Soft errors are usually related to the particular email address. We don't want to
pause sending due soft errors.
[MAILPOET-4736]
2022-12-28 14:25:56 +01:00
e015302a94 Update the confirmation email error message
[MAILPOET-4736]
2022-12-28 14:25:56 +01:00
20fcf23f8f Add processing of sending errors to the confirmation mailer
[MAILPOET-4736]
2022-12-28 14:25:56 +01:00
11beebf74d Add MailerLog method for handling transactional emails errors
The new method allows processing sending errors that happen when sending from other places of plugin
then from the Sending Queue worker.
After three failed attempts it pauses the sending and admin user will see an notice.
[MAILPOET-4736]
2022-12-28 14:25:56 +01:00
5a53406d33 Show error in form if confirmation email fails
[MAILPOET-4736]
2022-12-28 14:25:56 +01:00
ee83e4d748 Refactor SubscriberActions:subscribe to return status of confirmation email
We need to pass the error or success info about the confirmation email
in order to be able to be able to display the error message.
[MAILPOET-4736]
2022-12-28 14:25:56 +01:00
970db8f0d8 Prevent undefined function request_filesystem_credentials error
The function request_filesystem_credentials was not loaded when
running translation update during regular page load.
This commit ensures the function is loaded.
[MAILPOET-4902]
2022-12-28 13:24:47 +01:00
71828f9f6e Fix WC Checkout test by stoping to toggle removed setting
Starting from wc@7.2 the WC Blocks compatible version's
Checkout block doesn't offer the option to enable/disable
creating checkout on checkout, and this is only controllled
via the WC settings page

[MAILPOET-4925]
2022-12-23 10:28:35 +01:00
0525dd0f56 Update cerdic/css-tidy to version 2.0.3 to remove PHP 8.2 warnings
PHP 8.2 deprecates dynamic properties. The version of the Composer package cerdic/css-tidy that we are using relies on dynamic properties and thus MailPoet is generating a few deprecation warnings when running with PHP 8.2. Updating cerdic/css-tidy to the latest version remove those warnings as this was already fixed by the package maintainers.

[MAILPOET-4857]
2022-12-21 10:50:05 +01:00
e3ba525195 Unify inheritance with other processors
[MAILPOET-4735]
2022-12-21 10:07:35 +01:00
1eed55cbce Indicate optional processors
[MAILPOET-4735]
2022-12-21 10:07:35 +01:00
fd1331e602 Add plugins version to logs
[MAILPOET-4735]
2022-12-21 10:07:35 +01:00
02b82c04f3 Release 4.3.0 2022-12-20 16:25:45 +01:00
ad5ef6ebbc Fix ESLint errors after rebasing PR
Use async/await for promisses. Similar to what was discussed here: https://github.com/mailpoet/mailpoet/pull/4603#discussion_r1048950706

This is the ESLint error that started happening after the rebase:

```
mailpoet/assets/js/src/wizard/woocommerce_controller.tsx
  71:11  error  Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator  @typescript-eslint/no-floating-promises
```

[MAILPOET-4815]
2022-12-19 21:37:42 +01:00
3c5bc5b384 Fix issue in wizard.tsx with using Route.render
Route.render expects other types than the one coming out of
withBoundary, replacing it with Route.component fixes the
typing issue

[MAILPOET-4815]
2022-12-19 21:37:42 +01:00
f229df0383 Replace void with async/await based on input from PR reviewer
See https://github.com/mailpoet/mailpoet/pull/4603#discussion_r1048950706

[MAILPOET-4815]
2022-12-19 21:37:42 +01:00
9092f892d0 Refactor webpack_admin_index.jsx to TypeScript
[MAILPOET-4815]
2022-12-19 21:37:42 +01:00
9c3fb0856f Refactor wizard.jsx to TypeScript
[MAILPOET-4815]
2022-12-19 21:37:42 +01:00
2a8c665e12 Refactor welcome_wizard_controller.jsx to TypeScript
[MAILPOET-4815]
2022-12-19 21:37:42 +01:00
9b1942ce48 Refactor sender_step.jsx to TypeScript
[MAILPOET-4815]
2022-12-19 21:37:42 +01:00
932b4532f0 Change ReinstallFromScratch test now that the Welcome Wizard is mandatory
This commit updates the ReinstallFromScratch test now that the logic for
displaying the Welcome Wizard changed in
afba41ad27b8b72e892892fe386b48b5a6f59b9b. Before just loading the wizard
once was enough to dismiss it, now it is necessary to complete it. In
this commit, an utility function was created and it is used to dismiss
the wizard twice in the modified test.

[MAILPOET-4815]
2022-12-19 21:37:42 +01:00
6533a1444d Display submenu entries only after the Welcome Wizard is completed
[MAILPOET-4815]
2022-12-19 21:37:42 +01:00
05a109dcf4 Force users to complete the Welcome Wizard
This commit changes the behavior of the Welcome Wizard. Up until now,
the wizard would load once and users could opt to complete or skip it.
Now it is mandatory for the users to complete the wizard. Before we
saved the setting "version" the first time the first step of the wizard
was loaded and now we saved it when the wizard is completed.

[MAILPOET-4815]
2022-12-19 21:37:42 +01:00
5b5b7856c6 Use DI container to get an instance of Menu to simplify MenuTest
By using the DI container to get an instance of Menu we simplify
MenuTest and avoid the need to change MenuTest::getMenu() every time the
signature of the constructor of the Menu class changes, which will
happen in a subsequent commit.

[MAILPOET-4815]
2022-12-19 21:37:42 +01:00
4ceb508218 Fix typo 2022-12-19 21:37:42 +01:00
3afc7dc140 Change button in the first step of the welcome wizard
This commit changes the button "Finish later" of the first step of the
welcome wizard to "Skip this step". Both the label and the functionality
of the button changed.

[MAILPOET-4815]
2022-12-19 21:37:42 +01:00
1c1058667b Change copy of the first step of the welcome wizard
[MAILPOET-4815]
2022-12-19 21:37:42 +01:00
129aed2ae9 Add minimal error boundary to Automation app
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
f8c7adf5a6 Add error boundary to common components
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
6346d39507 Add erro boundary to newsletter app
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
1b76f3b862 Add error boundary to form editor app
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
40c140a631 Add error boundary to wizard app
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
7fd11d4fb5 Add error boundary to subscriber import/export app
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
7fa694314b Add error boundary to logs namespace
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
080e385b02 Add error boundary to experimental_features.jsx
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
7c0b625793 Add error boundaries to logs.tsx
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
f0b858b1f8 Add error boundery to underlying components in forms/forms.jsx
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
b218663e7e Add error boundary to segments/segments.jsx
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
d8ea29423d Add error boundary to newsletters_editor/initialize.jsx
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
ff038a1c56 Wrap inner components of newsletters.jsx in erro boundary
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
588e8fca6b Use withBoundary HOC in subscribers.jsx
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
8d9f23d5f8 Define error boundary and relevant HOC
[MAILPOET-4706]
2022-12-19 17:02:00 +01:00
ea4637c740 Add the possibility to skip hooks when subscribing to segments
[PREMIUM-214]
2022-12-19 12:04:28 +01:00
c0e56a4f92 Expose checkbox control
[PREMIUM-214]
2022-12-19 12:04:28 +01:00
53a4722e91 Add remove-from-list step placeholder
[PREMIUM-214]
2022-12-19 12:04:28 +01:00
d175870adf Add add-to-list step placeholder
[PREMIUM-214]
2022-12-19 12:04:28 +01:00
a64229f688 Fix automation template variables being loaded too late
[PREMIUM-214]
2022-12-19 12:04:28 +01:00
cd69e1e7b9 Refactor woocommerce_controller.jsx to TypeScript
[MAILPOET-4817]
2022-12-17 13:16:30 +01:00
321db0b004 Refactor woo_commerce_step.jsx to TypeScript
While renaming the file, I also opted to remove the underscore in
between "woo" and "commerce" as it is more common to spell "woocommerce"
without the underscore in file names and we already have at least
woocommerce_controller.jsx.

[MAILPOET-4817]
2022-12-17 13:16:30 +01:00
aaf01475b0 Simplify code to redirect to next step based on review feedback
See https://github.com/mailpoet/mailpoet/pull/4605#discussion_r1044404486

[MAILPOET-4817]
2022-12-17 13:16:30 +01:00
1cd38a396e Add parent container to the list of options in the WooCommerce step
This parent container is needed so that the last-child CSS pseudo
selector that was added in #4602 works to remove the horizontal line
from the last .mailpoet-wizard-woocommerce-option.

[MAILPOET-4817]
2022-12-17 13:16:30 +01:00
1f1c9dd077 Update copy of the Woo step of the Welcome Wizard
[MAILPOET-4817]
2022-12-17 13:16:30 +01:00
0da6d84309 Welcome Wizard: invert the order of the Woo and MSS steps
Now the Woo step comes first and then the MSS step which is always the
last step.

[MAILPOET-4817]
2022-12-17 13:16:30 +01:00
3a05598166 Improve comparison stability in test
[MAILPOET-4886]
2022-12-16 15:39:43 +01:00
5035d64298 Update the layout of the horizontal lines in the second step of the Welcome Wizard
In the second step of the wizard, it was necessary to add a <div> as a
container for all of the options, so that we could use the CSS
pseudo-class `last-child` to remove the horizontal line from the last
option.

[MAILPOET-4816]
2022-12-16 14:54:46 +01:00
56f6d20244 Update copy of the title of the second step of the Welcome Wizard
[MAILPOET-4816]
2022-12-16 14:54:46 +01:00
650d730c3f Fix lowercased captcha on built-in CAPTCHA buttons
[MAILPOET-4915]
2022-12-16 14:27:49 +01:00
decaa0f636 Fix typos
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
c2b9e33b79 Show error background in FormTokenField
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
34347f241d Add RemoveTag action stub
[PREMIUM-216]
2022-12-16 14:11:34 +01:00
5802f2132d Use badRequest method instead of throwing an InvalidState exception
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
8e502e5f50 Rename save method to create
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
0187f0cede change date keys
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
8457aa7e2b Remove ToDo comments
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
67156b7c6f Expose wordpress/components/spinner
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
f9250b66a9 Export wordpress/data-controls
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
1fcdccaa33 Expost json api endpoint
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
5b93b88f46 Add Tags endpoint
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
cbd41cd1be Remove unnecessary styles
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
95a8943b7e Use span instead of paragraph
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
dd363370f6 Remove white space
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
1027a6a676 Move FormTokenField to editor components
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
0fd93b0ff9 Show Upsell and LockedBadge
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
bfade87b62 Add Badge with locked symbol
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
26d9030544 Expose PanelBody via @wordpress/components
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
5688a0daea Rename filter to mailpoet.automation.register_step_type
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
92996ac781 Make mailpoet_tags available globally
[MAILPOET-4423]
2022-12-16 14:11:34 +01:00
1f471782ab Add Action stub 'Add Tag'
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
320459eaab Add filter mailpoet.register_step_type
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
e65b2cce02 Expose components for premium
[PREMIUM-213]
2022-12-16 14:11:34 +01:00
520ee981d3 Fix autosaving when activation link is missing
MAILPOET-4649
2022-12-15 18:15:01 +01:00
f100ef72da Add tracking and reporting information
MAILPOET-4649
2022-12-15 18:15:01 +01:00
146e1c871f Remove preview button
The preview button is a nice addition to the confirmation email template, but it's currently not part of the Jira ticket spec.

MAILPOET-4649
2022-12-15 18:15:01 +01:00
669367c9c6 Update texts and fix editor saving template with missing activation link
MAILPOET-4649
2022-12-15 18:15:01 +01:00
77d62c431a Fix coding style issues
MAILPOET-4649
2022-12-15 18:15:01 +01:00
4a5fc507ca Add tests for ConfirmationEmailCustomizer
MAILPOET-4649
2022-12-15 18:15:01 +01:00
06f59dd320 Update JS tests
MAILPOET-4649
2022-12-15 18:15:01 +01:00
4367f44449 Add support for confirmation email in newsletter editor
MAILPOET-4649
2022-12-15 18:15:01 +01:00
856e0f69d3 Add text contents and data required for confirmation email editor
MAILPOET-4649
2022-12-15 18:15:01 +01:00
c4bd2acd84 Update tests
MAILPOET-4649
2022-12-15 18:15:01 +01:00
210c240aab Update ConfirmationEmailMailer to support custom confirmation email created with the email editor from template
Setup confirmation email customizer in ConfirmationEmailMailer and trigger confirmation email template creation when visual subscription confirmation emails is enabled from settings

MAILPOET-4649
2022-12-15 18:15:01 +01:00
d19f5dc732 Add ConfirmationEmailCustomizer class and confirmation email template
MAILPOET-4649
2022-12-15 18:15:01 +01:00
6541c20466 Hide both “Email subject” and “Email content” when ConfirmationEmailCustomizer is enabled
MAILPOET-4649
2022-12-15 18:15:01 +01:00
3952484848 Add openEmailCustomizer action used by the ConfirmationEmailCustomizer component
MAILPOET-4649
2022-12-15 18:15:01 +01:00
7d918604c3 Add ConfirmationEmailCustomizer component and setup types
MAILPOET-4649
2022-12-15 18:15:01 +01:00
ffaf5b88b6 Configure integration tests oldest to use MYISAM and MySQL 5.5
[MAILPOET-4832]
2022-12-14 12:00:49 +01:00
eca4a9e923 Add integration test to ensure correct unique varchar indexes
[MAILPOET-4832]
2022-12-14 12:00:49 +01:00
1cee4e67e8 Print DB tables with engine and collation on test env star
[MAILPOET-4832]
2022-12-14 12:00:49 +01:00
b1c35b60d8 Configure acceptance tests oldest to use MYISAM db engine
[MAILPOET-4832]
2022-12-14 12:00:49 +01:00
1e5cfb4eaf Switch acceptance tests oldest to MYSQL 5.5
[MAILPOET-4832]
2022-12-14 12:00:49 +01:00
5e5956420f Release 4.2.0 2022-12-13 13:34:21 +01:00
78446d174a Fix quotes in a queries processed by $wpdb
These queries failed when ANSI_QUOTES mode is enabled
[MAILPOET-4887]
2022-12-12 13:59:09 +01:00
917d64a3e3 Print sql_mode when starting test environment
[MAILPOET-4887]
2022-12-12 13:59:09 +01:00
a3d51b2b08 Add ANSI and ONLY_FULL_GROUP_BY to sql_mode for tests environment
The default modes shipped with the mysql or mariaDB docker containers are
STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
In this commit I added ANSI, ONLY_FULL_GROUP_BY so that we are sure that we don't break compatibility with those modes
[MAILPOET-4887]
2022-12-12 13:59:09 +01:00
3ffbd6e236 Add ANSI and ONLY_FULL_GROUP_BY to sql_mode for dev environment
The default modes shipped with the mysql or mariaDB docker containers are
STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
in this commit I added ANSI, ONLY_FULL_GROUP_BY so that we are sure that we don't break compatibility with those modes
[MAILPOET-4887]
2022-12-12 13:59:09 +01:00
9753331d52 Improve sql_mode replace code to support both ANSI and ANSI_QUOTES
[MAILPOET-4887]
2022-12-12 13:59:09 +01:00
b266edb8e7 Make initial migration ANSI_QUOTES compatible
We run the initial migrations via dbDelta which internally uses
$wpdb. ANSI_QUOTES is not on the list of WPDB's incompatible modes
(767bdad516/wp-includes/class-wpdb.php (L648-L655))
So we need to make sure SQL queries we run through wpdb are ANSI_QUOTES compatible.
This commit makes initial migrations compatible with the ANSI_QUETES mode.
[MAILPOET-4887]
2022-12-12 13:59:09 +01:00
f1899055b8 Drop StepType from mailpoet.automation.step.more-controls filter
[MAILPOET-4889]
2022-12-12 12:23:52 +01:00
c3f0a36665 Make it possible to display the MP logo without a link
[MAILPOET-4819]
2022-12-08 13:30:12 +01:00
88efb1f3d1 Move logo to the top bar in the welcome wizard
[MAILPOET-4819]
2022-12-08 13:30:12 +01:00
146f5881f7 Adjustments to the layout of the welcome wizard layout
[MAILPOET-4819]
2022-12-08 13:30:12 +01:00
3279fb1154 Move regexes out of KeyActivation to avoid rerunning them in every render
[MAILPOET-4749]
2022-12-08 11:00:09 +01:00
5f5efbe876 Change title and description of the key activation settings tab
This commit changes the text of the title and the description of the key
activation settings tab to hopefully make it more clear the meaning of the
key and what they should do if they don't have one or if they are unsure
where they can get their key.

[MAILPOET-4749]
2022-12-08 11:00:09 +01:00
12afcfb656 Improve readability
[MAILPOET-3487]
2022-12-07 11:53:48 +01:00
0aac9e9d60 Test language switches in newsletters
[MAILPOET-3487]
2022-12-07 11:53:48 +01:00
4e3b1527cd If no translation for the current language exists, return 'en'
[MAILPOET-3487]
2022-12-07 11:53:48 +01:00
b27dcdd40a Use new language function in twig email templates
[MAILPOET-3487]
2022-12-07 11:53:48 +01:00
7b584dd482 Add language function to twig
[MAILPOET-3487]
2022-12-07 11:53:48 +01:00
5e71d94b62 Use website language for newsletters
[MAILPOET-3487]
2022-12-07 11:53:48 +01:00
8bb4338627 Inject WPFunctions
[MAILPOET-3487]
2022-12-07 11:53:48 +01:00
4bcd4a2cf2 Add single const to expose shortcodes for unsubscribe link
[MAILPOET-4862]
2022-12-07 10:52:07 +01:00
ea7971cb3b Translate the shortcode for instance unsubscribe link
The [link:subscription_instant_unsubscribe_url] shown on
stats page was not translated

[MAILPOET-4862]
2022-12-07 10:52:07 +01:00
9036b210a0 Add test for click stat recording for 1-click
[MAILPOET-4862]
2022-12-07 10:52:07 +01:00
f337ac388b Fix wrong assertions in PagesTest
[MAILPOET-4862]
2022-12-07 10:52:07 +01:00
b0ae21ec60 Record click stat for 1-click unsubscribe
[MAILPOET-4862]
2022-12-07 10:52:07 +01:00
7d11eeeddd Add triggering of the actionScheduler
[MAILPOET-4899]
2022-12-07 07:42:03 +01:00
4577ca5476 Fix tests
[MAILPOET-3982]
2022-12-06 14:17:49 +01:00
846794b60d Improve Cron error message
This commit gives more context to the maximum execution limit error

[MAILPOET-3982]
2022-12-06 14:17:49 +01:00
5757af95aa Release 4.1.1 2022-12-06 13:04:01 +01:00
b8c3b38652 Skip SwitchingLanguagesCest on release branch
The test would fail because the translations packs are not ready
at the time when we prepare the release.
[MAILPOET-4863]
2022-12-05 12:02:15 +01:00
3d21e4f35e Increase retries when waiting for languages update to be available
[MAILPOET-4863]
2022-12-05 12:02:15 +01:00
73ce89d051 Mention both forms and emails when describing 3rd-party libraries and Google Fonts
[MAILPOET-4888]
2022-12-05 11:59:48 +01:00
49d9dd666b Fix coding styles issues in DisableMailFunctionNotice
[MAILPOET-4760]
2022-12-05 11:59:16 +01:00
53dda33c02 Update method and constant name
MAILPOET-4760
2022-12-05 10:25:28 +01:00
9b9f61bf13 Only queue test mail for sending when the mailpoet sending method is updated
MAILPOET-4760
2022-12-05 10:25:28 +01:00
651e2d3c56 Update tests and refactor method name
MAILPOET-4760
2022-12-05 10:25:28 +01:00
0bd627d3b1 Add support for checking misconfiguration of the PHP mail function
Some hosts do perform intentional misconfiguration of the mail function, causing it not to work.

When the mail function is misconfigured, we can still access and execute the mail function from within the codebase, but we get an error.

There’s no accurate way to know the PHP mail function is misconfigured. Unless we execute the function with all the proper parameters and check the exception error message against this error `Could not instantiate mail function.`

MAILPOET-4760
2022-12-05 10:25:28 +01:00
99d0eede80 Add tests for DisabledMailFunctionNotice
MAILPOET-4760
2022-12-05 10:25:28 +01:00
d09b4ca409 Add check for mail function and display notice if disabled
MAILPOET-4760
2022-12-05 10:25:28 +01:00
caa76983e4 Ensure action scheduler jobs are done
[MAILPOET-4864]
2022-12-02 14:58:48 +01:00
7b6bbb0bc3 Remove unnecessary integration test job for woo
After the release of HPOS we no longer need to install the special Woo build and
that caused that integration_test_woocommerce job and integration_test_woo_cot_off job
have completely same configuration.
This commit removes one of those job.
[MAILPOET-4880]
2022-12-01 12:20:42 -03:00
cdf7c81a94 Remove unnecessary acceptance_tests_woo_cot_off job
The same set of tests run within acceptance_tests_base_and_woo_cot_off job
[MAILPOET-4880]
2022-12-01 12:20:42 -03:00
86812c5259 Rename acceptance test job to contain info about HPOS configuration
[MAILPOET-4880]
2022-12-01 12:20:42 -03:00
657302b720 Simplify <Tags> component and add wrapper components
[MAILPOET-4628]
2022-12-01 13:36:18 +01:00
172b5215d2 Fix strict types definition spacing
[MAILPOET-4879]
2022-11-30 12:39:19 +01:00
52a9d9f76c Remove redundant name from package.json 2022-11-30 12:30:52 +01:00
8eb7a48d3e Fix display of Text option in the editor sidebar
[MAILPOET-4808]
2022-11-30 12:30:52 +01:00
a8bceffc9c Add forgotten strict_types to Homepage page class
[MAILPOET-4824]
2022-11-30 11:42:41 +01:00
2c728c793a Redirect to main page instead of emails page from logo and after reinstall
[MAILPOET-4824]
2022-11-30 11:42:41 +01:00
8d974d8147 Add mainPageSlug to MailPoet module
In some places we hardcode emails page as the main page.
This property is meant to be used in places where we want to link
to main plugin page so that the links change when homepage is active
[MAILPOET-4824]
2022-11-30 11:42:41 +01:00
8fbc5c270a Place home at the first position in submenu
[MAILPOET-4824]
2022-11-30 11:42:41 +01:00
92dc5921df Set main page to homepage in case the feature is active
[MAILPOET-4824]
2022-11-30 11:42:41 +01:00
3c3ce37720 Temporarily add static property for MAIN_PAGE_SLUG
We need to be able to change it when homepage feature is active.
When we remove the feature flag will switch back to using constant.
Note I also kept the constant in case a third party plugin uses it.
[MAILPOET-4824]
2022-11-30 11:42:41 +01:00
f369e399ed Distinguish main page and emails page
There are some cases where we link or redirect to main page but
actually we want to redirect to emails page. It happens that currently they are
the same page, but we need to distinguish these cases for the future when
we switch the main page to new homepage.
[MAILPOET-4824]
2022-11-30 11:42:41 +01:00
01aa1e1e52 Refactor page slugs into constants
[MAILPOET-4824]
2022-11-30 11:42:41 +01:00
2bbc1b7063 Add homepage page and submenu item hidden behind feature flag
[MAILPOET-4824]
2022-11-30 11:42:41 +01:00
04b8a0ed73 Add feature flag for homepage
[MAILPOET-4824]
2022-11-30 11:42:41 +01:00
761f7c6537 Prevent issues if other plugins define WC function
It's possible that other plugins might define wc_get_page_id, so it's
more important to know that WC is installed/active than to know if the
function itself exists.

For good measure I'm including a cast to int even though the WC version
of the function always returns an integer. This is probably unnecessary
but it protects us from the possibility of the WC version of the
function returning something other than an integer in the future.

[MAILPOET-4834]
2022-11-30 11:03:40 +01:00
723dc2c9d3 Fix type errors in tests
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
d66fbb1c20 Fix confirmed IP value in tests
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
c2107b8d59 Enable strict types rule for all files
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
926620e8f8 Ignore strict types rule in all existing files that don't have it
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
82aeb89854 Use strict types in tests
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
c67c58709b Unify spacing of declare statements
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
75b5958a53 Release 4.1.0 2022-11-29 13:56:02 +01:00
bba5101669 Replace switching groups' tab by a new function
[MAILPOET-4861]
2022-11-29 10:58:11 +01:00
b9c5dddbaf Try switch group multiple times
[MAILPOET-4861]
2022-11-29 10:58:11 +01:00
0566b3f5fa Fix remaining code style issues
[MAILPOET-4850]
2022-11-28 22:24:54 +01:00
ac4adac1ab Fix test class name
[MAILPOET-4850]
2022-11-28 22:24:54 +01:00
33a9097719 Fix trim(null) issue
[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
08c74cdf8b Fix SlevomatCodingStandard.Namespaces.UnusedUses.MismatchingCaseSensitivity
[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
8c5222d850 Fix WordPress.Security.ValidatedSanitizedInput.InputNotSanitized and related errors
[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
08c76a46af Fix Squiz.Classes.ClassFileName.NoMatch and related errors
[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
3d24cb1deb Fix Generic.Classes.DuplicateClassName.Found
[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
a151f93be1 Fix Generic.CodeAnalysis.JumbledIncrementer.Found
[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
bce6a06c15 Fix Sniffs.ControlSignature.Found
[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
10a6e387f3 Fix Squiz.Scope.MethodScope.Missing
[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
b6a37f274c Fix Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
2cdbc68643 Fix Squiz.Classes.ValidClassName.NotCamelCaps
[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
7db40b27b5 Fix errors automatically with phpcbf
[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
b1760ff676 Add MinimalPluginStandard to lint-staged command
[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
293eef2c78 Add MinimalPluginStandard to Robofile
./do qa:minimal-plugin-standard will not execute the MinimalPluginStandard phpcs sniffs
./do qa:php has been extended to include the sniffs as well

[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
299c6b779e Remove MinimalPluginStandard from ruleset
[MAILPOET-4850]
2022-11-28 22:54:13 +03:00
842f435976 Add default value for method to StatisticsUnsubscribeEntity
When entity is created the default value is not set and it may causes
failures when it is not set additionally.
This commit sets default value and also defines a constant for the default value.
[PREMIUM-211]
2022-11-28 18:21:52 +01:00
11faf925cc Refactor time assertions in AutomaticEmailTest to use assert with delta
Carbon:setTestNow was not working because we are instantiating the new Carbon instance with value.
This commit updates all DateTime assertions to use the new assertEqualDateTimes method
[MAILPOET-4867]
2022-11-28 14:19:30 +01:00
1295aa21cc Skip congratulatory email if we know it will fail
[MAILPOET-4641]
2022-11-28 14:12:50 +01:00
84cd137c76 Don't switch to MSS when activating key without sending
[MAILPOET-4641]
2022-11-28 14:12:50 +01:00
37067dff67 Add state to MSS key check response
[MAILPOET-4641]
2022-11-28 14:12:50 +01:00
c7f850e1ba Declare strict types
[MAILPOET-4842]
2022-11-28 13:03:06 +01:00
b25f2cd5f4 Enable a Trigger to activate a second automation
[MAILPOET-4842]
2022-11-28 13:03:06 +01:00
af95080b67 Add test for TriggerHandler
[MAILPOET-4842]
2022-11-28 13:03:06 +01:00
6b8c35d5fe Fix Manage Sender Domain modal hides underneath Preview newsletter modal
MAILPOET-4812
2022-11-28 12:14:52 +01:00
a35e0dced4 Accept null opt-in values for in Woo Blocks integration
[MAILPOET-4804]
2022-11-28 11:51:27 +01:00
c6259eb185 Create acceptance test container upfront with one retry
This is and attempt to fix random issue with
Error response from daemon: Conflict. The container name "/wordpress_X" is already in use
[MAILPOET-4851]
2022-11-28 09:14:56 +01:00
670017b342 Update nesbot/carbon to the latest version
This is needed for MailPoet to work well with the upcoming PHP 8.2.

nesbot/carbon versions previous to 2.62.1 could cause issues when used
with PHP 8.2, see this PR for more information:
https://github.com/briannesbitt/Carbon/pull/2663

Without this update MailPoet users will see the following fatal error
when using PHP 8.2:

```
TypeError
MailPoetVendor\Carbon\Carbon::setLastErrors(): Argument #1 ($lastErrors) must be of type array, bool given, called in /srv/www/mp/public_html/wp-content/plugins/mailpoet/vendor-prefixed/nesbot/carbon/src/Carbon/Traits/Creator.php on line 567
```

[MAILPOET-4838]
2022-11-26 09:38:05 +01:00
ce7b210da9 Bump tested up to
[MAILPOET-4841]
2022-11-26 09:09:00 +01:00
1a2d8b8d40 Add saving nicename for created WP users
[MAILPOET-4841]
2022-11-26 09:09:00 +01:00
fe2df00a8c Use the latest WP version as default for acceptance tests
[MAILPOET-4841]
2022-11-26 09:09:00 +01:00
20577d974f Replace custom createSubscriber method with common factory method
[MAILPOET-4860]
2022-11-25 17:17:48 +01:00
7369465a3a Add subscribers cleanup to stats notification worker test
The test creates subscribers and there was not cleanup so this was increasing
probability of conflict in subscribers email.
[MAILPOET-4860]
2022-11-25 17:17:48 +01:00
5769fa45f5 Use helper methods for method column migration
This fixes issues with MailPoet in multiple schemas on the same MySQL instance as well
as simplifies the code. The migration was also renamed to a newer date. Additionally, the
edit of the initial MailPoet migration was reverted as this is not needed.

[MAILPOET-4733]
2022-11-25 14:51:57 +01:00
193b4cbf98 Set missing unsubscribe method for failing tests
[MAILPOET-4733]
2022-11-25 14:51:57 +01:00
461df1a560 Adjust strict_types & method typehint based on PR feedback
[MAILPOET-4733]
2022-11-25 14:51:57 +01:00
d5f78680eb Add integration test for unsubscibe properties
[MAILPOET-4733]
2022-11-25 14:51:57 +01:00
96dde7107b Expose unsubscribe analytics properperties
[MAILPOET-4733]
2022-11-25 14:51:57 +01:00
3e756bfadd Add test to assert correct unsubscription method is saved
[MAILPOET-4733]
2022-11-25 14:51:57 +01:00
82c755200e Augment track persister test with method as meta
[MAILPOET-4733]
2022-11-25 14:51:57 +01:00
735d33d05b Add method of tracking when tracking unsubscriptions
[MAILPOET-4733]
2022-11-25 14:51:57 +01:00
90c8e5b2c9 Introduce method column to statistics_unsubscribes table
[MAILPOET-4733]
2022-11-25 14:51:57 +01:00
cd1f06b116 Forbid assert() in code base
[MAILPOET-4258]
2022-11-25 14:32:34 +01:00
173f347431 Fix assert in Helper
[MAILPOET-4258]
2022-11-25 14:32:34 +01:00
353d3389cd Fix assert in data factories
[MAILPOET-4258]
2022-11-25 14:32:34 +01:00
fe364978a1 Fix usage of assert in acceptance tests
[MAILPOET-4258]
2022-11-25 14:32:34 +01:00
cd512bbb01 Fix instanceOf assertions in unit tests
[MAILPOET-4258]
2022-11-25 14:32:34 +01:00
f5193df721 Fix not null assertions in integration tests
[MAILPOET-4258]
2022-11-25 14:32:34 +01:00
25b5d24867 Fix is_array assertion in integration tests
[MAILPOET-4258]
2022-11-25 14:32:34 +01:00
1d99ff0943 Fix all is_string assertions in integration tests
[MAILPOET-4258]
2022-11-25 14:32:34 +01:00
99d6d96b05 Fix all is_numeric asserts in integration tests
[MAILPOET-4258]
2022-11-25 14:32:34 +01:00
6ddfe2c605 Remove ignores no longer needed
[MAILPOET-4258]
2022-11-25 14:32:34 +01:00
d2ec7bba42 Replace instance_of asserts in integration tests
[MAILPOET-4258]
2022-11-25 14:32:34 +01:00
2557171953 Fix assert() in lib
[MAILPOET-4258]
2022-11-25 14:32:34 +01:00
0d7e45ea03 Fix filename that is removed by fix-monolog.php
The following error is being thrown when running composer commands:

```
> php fix-monolog.php
rm: cannot remove 'mailpoet/mailpoet/prefixer/../vendor-prefixed/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php': No such file or directory
```

This is happening because in commit 9b71a7804c
we updated Monolog from v1 to v2. v2 renamed the file ElasticSearchHandler.php
to ElasticsearchHandler.php (see
4c7795d310).
Note that search is not spelled with a capital S anymore. We didn’t update
fix-monolog.php to reflect this change.

This commit updates fix-monolog.php to use the new file name and to remove
the error.

[MAILPOET-4856]
2022-11-25 13:47:24 +01:00
e677169a51 Update Mysql image for integration and acceptance tests
[MAILPOET-4851]
2022-11-25 13:37:08 +01:00
e268eac378 Add healthcheck for mysql service in the test environment
This is replacement for custom wait scripts and also should ensure
that DB is ready before starting the wordpress serive container,
which was missing the check.
[MAILPOET-4851]
2022-11-25 13:37:08 +01:00
375f2b13c5 Try select option in select 2 multiple times
[MAILPOET-4555]
2022-11-25 13:21:42 +01:00
34406a2f72 Fix flaky WooCommercePurchaseTest
[MAILPOET-4854]
2022-11-25 13:10:30 +01:00
cc658bcc3d Split one big test case into three smaller
[MAILPOET-4846]
2022-11-25 13:04:46 +01:00
973aefe7ae Hide black Friday notice in acceptance tests
[MAILPOET-4846]
2022-11-25 13:04:46 +01:00
34e91251e8 Add waiting on clickable trash button
[MAILPOET-4846]
2022-11-25 13:04:46 +01:00
882402645d Do not wrap automations beta badge, make it a bit smaller
[MAILPOET-4840]
2022-11-25 09:55:11 +01:00
d9d4dccc09 Make instruction on how to test with different PHP versions more generic
This commit just updates the README file so that it doesn't mention
specific PHP versions. This way we don't have to update it every time we
add a new version to the dev environment.

[MAILPOET-4855]
2022-11-25 09:33:39 +01:00
9d2fcccbf5 Add option to run the dev env with PHP 8.2RC6
[MAILPOET-4855]
2022-11-25 09:33:39 +01:00
c4fdd881e6 Retry language updates if they are not scheduled yet
[MAILPOET-4849]
2022-11-24 16:58:18 +01:00
83f7eee8ae Early return to make the migration idempotent
[MAILPOET-4852]
2022-11-24 16:04:29 +01:00
dc1f63d8bb Rename segments migration to be executed again
[MAILPOET-4852]
2022-11-24 16:04:29 +01:00
3e2425abd8 Rewrite segments migration to use helper methods, Doctrine DBAL, and lower number of queries
[MAILPOET-4852]
2022-11-24 16:04:29 +01:00
65e78c7990 Add helper to determine whether a column exists
[MAILPOET-4852]
2022-11-24 16:04:29 +01:00
2bdc5d3683 Add helper to get current table name
[MAILPOET-4852]
2022-11-24 16:04:29 +01:00
1de276378f Use different container names for different parallel runs
[MAILPOET-4851]
2022-11-24 15:48:43 +01:00
cc76fe77f0 Ensure that docker caching on CircleCi is disabled
[MAILPOET-4851]
2022-11-24 13:29:20 +01:00
c8636aac6f Update selenium and chrome image
[MAILPOET-4848]
2022-11-24 10:34:59 +01:00
a09f41143e Update codeception, webdriver and lucatume/browser
[MAILPOET-4848]
2022-11-24 10:34:59 +01:00
8b29694446 Compare scheduledAt with delta 2022-11-24 10:06:59 +01:00
5e0e89408c Test CaptchaFormRenderer
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
86076547c3 Raise aria-live level
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
b1bbabe14d early return when no audioCaptcha element was found
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
f5c678ec2d Initialize session when no ID exists
[MAILPOET-4514]
2022-11-24 09:20:39 +01:00
223625bd9b Use constant for endpoint
[MAILPOET-4514]
2022-11-24 09:20:39 +01:00
fbd7cf8cc7 Use SubscriberEntity instead of the Model
[MAILPOET-4514]
2022-11-24 09:20:39 +01:00
26c7e4d1cc Use null instead of empty string
[MAILPOET-4514]
2022-11-24 09:20:39 +01:00
4832771185 Refactor the captcha system
The current Captcha class has a lot of responsibilities. It renders the captcha
image, can check if a certain captcha type is a Google captcha, if a captcha is
required for a certain email. The SubscriberSubscribeController is not only in
charge of "controlling" the subscription process but also validates, whether a
captcha is correct or not. This architecture made it difficult to extend the
functionality and introduce the audio captcha feature.

Therefore this commit refactors the captcha architecture and tries to seperate
the different concerns into several classes and objects. Validation is now done
by validators.

The CaptchaPhrase now is in charge of keeping the captcha phrase consistent
between the image and the new audio, so that you can renew the captcha and both
captchas are in sync.

[MAILPOET-4514]
2022-11-24 09:20:39 +01:00
7fb8d64628 Rename CaptchaRenderer to CaptchaFormRenderer
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
36fed3bbf8 Enable output of audio captcha when image captcha has not yet been generated
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
8ab738b315 Use classes instead of ids for captcha elements
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
b84b9606e9 Remove type residual from audio captcha url building
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
aa68b7e148 Bust caching when building the audio captcha url
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
ca44339512 Fix typo in button cursor property
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
91f5376dfc Apply prettier
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
d51ef70db6 Add audio assets
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
c164268c20 Change file name to lower case
and codestyle
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
4c7c94c75d Update JavaScript for captcha audio player
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
ccf141b279 Add button icons
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
e42808f22d Update Captcha UI to add audio button
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
75a4b2c538 Add Captcha Audio endpoint to Router
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
f1d64c0572 Add Captcha styles
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
25c57bf9fe Fix flaky acceptance test for tag filter
[MAILPOET-4844]
2022-11-23 16:38:49 +01:00
079c90dbba Add acceptance test for switching languages
[MAILPOET-4147]
2022-11-23 12:50:32 +01:00
0fc342ee4c Release 4.0.1 2022-11-22 13:57:46 +01:00
7570c9fa0e Make automations Beta badge smaller
[MAILPOET-4836]
2022-11-22 09:23:57 +01:00
7642c4da4f Update machine executor images
[MAILPOET-4833]
2022-11-21 16:06:58 -03:00
dce13e5b8e Update sentence, add full stop.
MAILPOET-4669
2022-11-21 15:21:29 +01:00
8b922681b6 Use boolean instead of integer for displayInManageSubscriptionPage column
MAILPOET-4669
2022-11-21 15:21:29 +01:00
bd33cdbc24 Add new migration file for DisplayInManageSubscriptionPage column
MAILPOET-4669
2022-11-21 15:21:29 +01:00
bc04ad2528 Enable default checked state for standard lists checkbox
MAILPOET-4669
2022-11-21 15:21:29 +01:00
c54a5213b3 Update tests
MAILPOET-4669
2022-11-21 15:21:29 +01:00
07cf0cd79b Remove list management from settings page
MAILPOET-4669
2022-11-21 15:21:29 +01:00
e64dc1669f Add support for segment displayInManageSubscriptionPage on Subscription management page
MAILPOET-4669
2022-11-21 15:21:29 +01:00
48181994d8 Handle saving and loading list page. Add support for showInManageSubscriptionPage checkbox input
MAILPOET-4669
2022-11-21 15:21:29 +01:00
31c2915075 Add showInManageSubscriptionPage checkbox to edit list page
MAILPOET-4669
2022-11-21 15:21:29 +01:00
67f05ecfe2 Prefix forgotten Twig call in generated template code
[MAILPOET-4718]
2022-11-21 12:47:19 +01:00
c121c60e8c Fix condition for the running status
[MAILPOET-4664]
2022-11-21 12:45:28 +01:00
110859508e Fix tasks order on the status page
[MAILPOET-4664]
2022-11-21 12:45:28 +01:00
efd3377ecd Fix count of tasks on the status page
[MAILPOET-4664]
2022-11-21 12:45:28 +01:00
a7c1d8431d Update tests for [subscriber:count] shortcode
MAILPOET-4527
2022-11-21 12:36:12 +01:00
127f3e6363 Fix [subscriber:count] counts only subscribed subscribers
MAILPOET-4527
2022-11-21 12:36:12 +01:00
6bec12c762 Use helper function to create migration tables
[MAILPOET-4835]
2022-11-21 12:15:10 +01:00
d1df2d4f42 Add a helper function to create new table
[MAILPOET-4835]
2022-11-21 12:15:10 +01:00
5598f0af19 Fixing small typo
Automatoin should be automation
2022-11-21 11:23:01 +01:00
8dd80ce0f2 Fix the circle rerun command output
[PREMIUM-207]
2022-11-18 16:05:18 +01:00
e45510e064 Add rerunning premium workflow into the prepare command
[PREMIUM-207]
2022-11-18 16:05:18 +01:00
bfafff132a Make the project parameter optional
[PREMIUM-207]
2022-11-18 16:05:18 +01:00
d6748fe979 Add command for rerunning circle workflow
[PREMIUM-207]
2022-11-18 16:05:18 +01:00
2169522818 Add methods for rerunning Circle workflow
[PREMIUM-207]
2022-11-18 16:05:18 +01:00
06cfa3fc60 Shorten test and run action-scheduler group
[MAILPOET-4746]
2022-11-17 22:25:52 +01:00
f9e507eb15 Use latest WooCommerce version for Woo HPOS related tests
Before WooCommerce 7.1.0 was released, we were defining a specific
version of Woo that included HPOS to be used when running HPOS related
tests. Now that 7.1.0 was released and since we started using it by
default in bd51822b961a6f8ad10d3454cde912917acac0b6, we don't need to
specify a different Woo version for the HPOS tests.

[MAILPOET-4801]
2022-11-17 14:55:38 +01:00
90332a23b3 Use latest WooCommerce version in the CircleCI jobs
[MAILPOET-4801]
2022-11-17 14:55:38 +01:00
a82a810269 Update form templates to include privacy page link (if found)
MAILPOET-4651
2022-11-16 16:51:12 +01:00
5a378b3c5f Add replacePrivacyLinkTags method for Form Template
MAILPOET-4651
2022-11-16 16:51:12 +01:00
49a2df3dbb Release 4.0.0 2022-11-16 09:43:17 +01:00
dee5ff38f5 Fix error when sending a preview email with MSS
With HTTPS and "$oneClickUnsubscribeUrl = false", we were sending "false" instead of an actual URL.

[MAILPOET-4813]
2022-11-15 15:05:03 +01:00
70aefb421b Clear error when rerunning migration
[MAILPOET-4811]
2022-11-14 20:12:35 +03:00
764e1a1bf0 Rename "Not active" state to "Draft" on automations listing page
[MAILPOET-4810]
2022-11-14 19:51:34 +03:00
b140011f92 Update minimal version check for WooCommerceCheckoutBlockCest
Since we support the Woo Blocks integration only for versions from 8.0.0
we need to update minimal version check code for acceptance test.
[MAILPOET-4668]
2022-11-14 17:20:43 +01:00
b48c9e437e Update plugins in tests for feature and trunk branches
[MAILPOET-4668]
2022-11-14 17:20:43 +01:00
f34efb4d6f Update acceptance test oldest job configuration
[MAILPOET-4668]
2022-11-14 17:20:43 +01:00
324c03e8b9 Print WordPress version when starting test environment
[MAILPOET-4668]
2022-11-14 17:20:43 +01:00
e718101425 Upgrade minimum required WordPress version to 5.8
[MAILPOET-4668]
2022-11-14 17:20:43 +01:00
080ce50fea Open automations Beacon links in a new tab instead of HelpScout Beacon
[MAILPOET-4809]
2022-11-14 18:53:20 +03:00
1b9eb223b0 Load templates late
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
ea2fa794ac Limit varchar length to 191 to avoid unique/primary key issues
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
c46c61a923 Simplify and optimize automation stats
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
1136431551 Use $wpdb->prepare() for automation stats
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
957be23212 Improve query formatting
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
91a88b3e91 Rename alias "w" to "a"
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
7c5d239267 Fix and unify cleanup in automation tests
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
c748b80447 Fix timestamp column problems with some MySQL versions and some SQL modes
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
725e0ecb00 Remove automation feature flag
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
eb71dd8a68 Remove automation testing buttons and hooks
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
ce1687cf97 Replace custom mutation hook with a @wordpress/api-fetch based one
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
2e328b6d7f Move temporary automation migrator to a new migration
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
8489e63d34 Delete automation testing system endpoints
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
f8c17730fc Update tracking campaign
[MAILPOET-4712]
2022-11-14 11:22:57 +01:00
93e43eee7a Update sales banner for Black Friday 2022
[MAILPOET-4712]
2022-11-14 11:22:57 +01:00
9063dc3079 Remove duplicities in naming
[MAILPOET-4793]
2022-11-14 12:14:35 +02:00
9d55d3f134 Use "automation" instead of "workflow"
[MAILPOET-4793]
2022-11-14 12:14:35 +02:00
d199c3768a Show Bounced and Unsubscribed badge for minimum of 100 newsletter sent
The reason is that at low volumes the percentages can be misleading. E.g. if you send 20 emails and 1 hard bounces - that’s a hard bounce rate of 5%.

The percentage is very high, but a single hard bounce doesn’t really mean anything, so to avoid confusion I’d hide the badge altogether for low volumes.

MAILPOET-4688
2022-11-14 10:47:04 +01:00
0e0c2447d9 Fix issue with badge stats
We were using MailPoet.Num.toLocaleFixed which returns a string locale of the number. This can cause issues with some locales e.g some locale returns 2,3 instead of 2.3

MAILPOET-4688
2022-11-14 10:47:04 +01:00
99dfb3d24b Add formatForStats method for Unsubscribed and Bounced Stats
MAILPOET-4688
2022-11-14 10:47:04 +01:00
c4366e009b Fix crashing page due to newsletter not found error
MAILPOET-4688
2022-11-14 10:47:04 +01:00
1d31202607 Add badge for Unsubscribe, bounced and opened stat to the Advanced email statistics page
MAILPOET-4688
2022-11-14 10:47:04 +01:00
78d25ffb69 Add Stats Badge for opened rate on email listing
MAILPOET-4688
2022-11-14 10:47:04 +01:00
b710682c66 Replace average with critical badge on email listing for opened and clicked stats
MAILPOET-4688
2022-11-14 10:47:04 +01:00
52c6b94315 Add support for critical tag in newsletter badge
MAILPOET-4688
2022-11-14 10:47:04 +01:00
fd6b49e598 Add type TagVariant for variant strings
MAILPOET-4688
2022-11-14 10:47:04 +01:00
df2982454e Add support for Critical Tag and critical tag color
MAILPOET-4688
2022-11-14 10:47:04 +01:00
8a19fd906f Update test to check for distinct one-click urls in bulk
[MAILPOET-4703]
2022-11-11 09:21:30 +01:00
99198e5c2d Fix MailPoet\WP\Functions newly added method name
[MAILPOET-4703]
2022-11-11 09:21:30 +01:00
9204f37560 Remove redundant injection
[MAILPOET-4703]
2022-11-11 09:21:30 +01:00
765aa6efab Augment tests to acknowledge oneclick unsubscribe url
[MAILPOET-4703]
2022-11-11 09:21:30 +01:00
50b613365f Make sure one-click unsubscribe url won't redirect internally
[MAILPOET-4703]
2022-11-11 09:21:30 +01:00
4fe8d10d6c Update tests for Subscription and pass the new argument
[MAILPOET-4703]
2022-11-11 09:21:30 +01:00
162dab790d Implement 1-click unsubscribe strategy for post requests
[MAILPOET-4703]
2022-11-11 09:21:30 +01:00
6e8c9731d8 Define new isSiteUsingHttps method for WP_Functions
[MAILPOET-4703]
2022-11-11 09:21:30 +01:00
235552f91d Define Request utility class with isPost method
[MAILPOET-4703]
2022-11-11 09:21:30 +01:00
4ee08c296b Fix unknown storage engine 'InnoDB' error
[MAILPOET-4802]
2022-11-10 12:59:24 +01:00
bda979ec4f Fix trash error when workflow status is draft
[MAILPOET-4792]
2022-11-09 19:58:44 +03:00
78f10f064e Fix clicking on no longer existing text
[MAILPOET-4796]
2022-11-09 15:58:36 +01:00
eca4a68fec Revert broken test fix
Reverts: https://github.com/mailpoet/mailpoet/pull/4511

[MAILPOET-4796]
2022-11-09 15:58:36 +01:00
9daa5d58c7 Adjust tests to new templates
[MAILPOET-4745]
2022-11-09 15:24:50 +03:00
6cc232fbad Make premium badge mailpoet orange
[MAILPOET-4745]
2022-11-09 15:24:50 +03:00
6a07bd44ff Improve 'Coming soon' styles
[MAILPOET-4745]
2022-11-09 15:24:50 +03:00
63cd326191 Update template descriptions
[MAILPOET-4745]
2022-11-09 15:24:50 +03:00
40b15b0eb1 Lower the grid size for the badge
[MAILPOET-4745]
2022-11-09 15:24:50 +03:00
3825e9cb11 Fix test
[MAILPOET-4745]
2022-11-09 15:24:50 +03:00
7db2942140 Show PremiumModal for premium templates
[MAILPOET-4745]
2022-11-09 15:24:50 +03:00
3a5d28f24a Export const premiumValidAndActive
[MAILPOET-4745]
2022-11-09 15:24:50 +03:00
d02c63844d Add badges to template items
[MAILPOET-4745]
2022-11-09 15:24:50 +03:00
c3045dba07 Add type to WorkflowTemplate definition
[MAILPOET-4745]
2022-11-09 15:24:50 +03:00
c239566e1e Add premium and coming-soon template stubs
[MAILPOET-4745]
2022-11-09 15:24:50 +03:00
dfdc8cfd09 Add WorkflowTemplate types
[MAILPOET-4745]
2022-11-09 15:24:50 +03:00
4977b7ffa2 Add free templates
[MAILPOET-4745]
2022-11-09 15:24:50 +03:00
8e69299a6a Adjust naming and use wp wrapper I/O of direct usage
[MAILPOET-4702]
2022-11-09 12:36:44 +01:00
903bcbb92e Update tests and adapt to the new unsubscribe key structure
[MAILPOET-4702]
2022-11-09 12:36:44 +01:00
8d6492ac8c Adjust constructor injections of instantiators of MailPoet
[MAILPOET-4702]
2022-11-09 12:36:44 +01:00
c39ae1fe1f Adjust the unsubscribe key to use the new structure
[MAILPOET-4702]
2022-11-09 12:36:44 +01:00
e3539b06a2 Define URL utility method to check if url is using https
[MAILPOET-4702]
2022-11-09 12:36:44 +01:00
d34a265ac2 Prevent leaving unsaved automation
[MAILPOET-4776]
2022-11-09 13:42:56 +03:00
9a72e361b1 Fix plugin activtion for the smtp plugin
[MAILPOET-4785]
2022-11-09 12:59:29 +03:00
a520e4bd93 Run full activation of user account on multisite
[MAILPOET-4785]
2022-11-09 12:59:29 +03:00
9ab6ebbe0d Use always SMTP to send wp_mail
[MAILPOET-4785]
2022-11-09 12:59:29 +03:00
6a3cfd05e7 Update CircleCI to wait for Woo jobs to complete before starting build_release_zip
In [MAILPOET-4572] we added new CircleCI jobs to run WooCommerce tests in
different scenarios. But we forgot to add those jobs to the list of jobs
that need to finish before starting the build_release_zip job.

This can be problematic as we don’t want the build_release_zip to start
before all the test jobs have finished and, even worst, we don’t want it
to run if one of the test jobs failed.

This commit adds the following jobs to the list of jobs that are
required to finish before running build_release_zip:

- integration_test_woo_cot_no_sync
- integration_test_woo_cot_off
- integration_test_woo_cot_sync
- acceptance_tests_woo_cot_sync
- acceptance_tests_woo_cot_off
- acceptance_tests_woo_cot_no_sync

[MAILPOET-4791]
2022-11-09 09:07:21 +01:00
f825e535e3 Save next step in trigger handler
[MAILPOET-4787]
2022-11-08 22:55:57 +02:00
a2c5420d7f Save updated at timestamp in workflow runs
[MAILPOET-4787]
2022-11-08 22:55:57 +02:00
c6d3573652 Save next step ID to workflow runs
[MAILPOET-4787]
2022-11-08 22:55:57 +02:00
e41bcd0d02 Manage ActivationPanel in store and close when sidebar opens
[MAILPOET-4769]
2022-11-08 23:31:36 +03:00
f805907954 Release 3.103.1 2022-11-08 17:35:04 +01:00
d970efc0da Reduce size of a database field to avoid error in some MySQL versions
This commit reduces the size of the `name` field from varchar(255) to
varchar(191) to avoid the following fatal error in some MySQL versions:

```
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
```

See the ticket descriptions and the links in it for more information.

[MAILPOET-4790]
2022-11-08 12:27:01 -03:00
c0ce5944dc Use short table aliases
[MAILPOET-4778]
2022-11-08 16:17:34 +02:00
467f354eb1 Do not skip workflow trigger queries when trigger keys are empty
[MAILPOET-4778]
2022-11-08 16:17:34 +02:00
3f016b45f9 Don't escape table names when not needed
[MAILPOET-4778]
2022-11-08 16:17:34 +02:00
679f74e498 Unify query error checking
[MAILPOET-4778]
2022-11-08 16:17:34 +02:00
08b314e0b4 Unify table variable naming
[MAILPOET-4778]
2022-11-08 16:17:34 +02:00
cc5959805b Use "workflow_triggers" table instead of an inline JSON
[MAILPOET-4778]
2022-11-08 16:17:34 +02:00
407f3d1609 Hide duplicate workflow button
[MAILPOET-4786]
2022-11-08 16:48:35 +03:00
503df3584c Track errors
[MAILPOET-4756]
2022-11-08 16:41:47 +03:00
fa9510f0c1 Add getStepById method
[MAILPOET-4756]
2022-11-08 16:41:47 +03:00
cc92df4e7f Track Automations > Listing viewed event
[MAILPOET-4756]
2022-11-08 16:41:47 +03:00
d76c5d32f2 Track Workflow deactivated
[MAILPOET-4756]
2022-11-08 16:41:47 +03:00
c6198cba4c Track Workflow activated
[MAILPOET-4756]
2022-11-08 16:41:47 +03:00
e29dd4286e Track template selected
[MAILPOET-4756]
2022-11-08 16:41:47 +03:00
98c1c33341 Release 3.103.0 2022-11-08 10:33:23 -03:00
1831 changed files with 20652 additions and 10198 deletions

View File

@ -179,10 +179,10 @@ jobs:
- run:
name: Download additional WP Plugins for tests
command: |
./do download:woo-commerce-zip 6.8.2
./do download:woo-commerce-subscriptions-zip 4.5.1
./do download:woo-commerce-memberships-zip 1.23.0
./do download:woo-commerce-blocks-zip 8.4.0
./do download:woo-commerce-zip 7.1.0
./do download:woo-commerce-subscriptions-zip 4.6.0
./do download:woo-commerce-memberships-zip 1.23.1
./do download:woo-commerce-blocks-zip 8.8.2
- run:
name: Dump tests ENV variables for acceptance tests
command: |
@ -311,7 +311,8 @@ jobs:
parallelism: 20
working_directory: /home/circleci/mailpoet/mailpoet
machine:
image: ubuntu-2204:2022.07.1
image: ubuntu-2204:2022.10.2
docker_layer_caching: false
parameters:
multisite:
type: integer
@ -322,7 +323,7 @@ jobs:
mysql_command:
type: string
default: ''
mysql_image_version:
mysql_image:
type: string
default: ''
codeception_image_version:
@ -351,7 +352,7 @@ jobs:
default: 0
environment:
MYSQL_COMMAND: << parameters.mysql_command >>
MYSQL_IMAGE_VERSION: << parameters.mysql_image_version >>
MYSQL_IMAGE: << parameters.mysql_image >>
CODECEPTION_IMAGE_VERSION: << parameters.codeception_image_version >>
WORDPRESS_IMAGE_VERSION: << parameters.wordpress_image_version >>
steps:
@ -411,6 +412,12 @@ jobs:
circleci tests glob "tests/acceptance/**/*Cest.php" | circleci tests split --split-by=timings > tests/acceptance/_groups/circleci_split_group
fi
cat tests/acceptance/_groups/circleci_split_group
- run:
name: Create docker containers for test
# We experienced some failures when creating containers so we do it explicitly with one retry
command: |
cd tests/docker
docker-compose create || docker-compose create
- run:
name: Run acceptance tests
command: |
@ -476,9 +483,12 @@ jobs:
integration_tests:
working_directory: /home/circleci/mailpoet/mailpoet
machine:
image: ubuntu-2204:2022.07.1
image: ubuntu-2204:2022.10.2
docker_layer_caching: false
environment:
CODECEPTION_IMAGE_VERSION: << parameters.codeception_image_version >>
MYSQL_COMMAND: << parameters.mysql_command >>
MYSQL_IMAGE: << parameters.mysql_image >>
parameters:
codeception_image_version:
type: string
@ -501,7 +511,10 @@ jobs:
multisite:
type: integer
default: 0
woo_core_version:
mysql_command:
type: string
default: ''
mysql_image:
type: string
default: ''
steps:
@ -511,14 +524,12 @@ jobs:
name: 'Pull test docker images'
# Pull docker images with 3 retries
command: i='0';while ! docker-compose -f tests/docker/docker-compose.yml pull && ((i < 3)); do sleep 3 && i=$[$i+1]; done
- when:
condition: << parameters.woo_core_version >>
steps:
- run:
name: Download WooCommerce Core
command: |
cd tests/docker
docker-compose run --rm -w /project --entrypoint "./do download:woo-commerce-zip << parameters.woo_core_version >>" --no-deps codeception_integration
- run:
name: Create docker containers for test
# We experienced some failures when creating containers so we do it explicitly with one retry
command: |
cd tests/docker
docker-compose create || docker-compose create
- run:
name: 'PHP Integration tests'
command: |
@ -629,7 +640,7 @@ workflows:
- build
- acceptance_tests:
<<: *slack-fail-post-step
name: acceptance_tests
name: acceptance_tests_base_and_woo_cot_off
requires:
- unit_tests
- static_analysis_php8
@ -641,7 +652,6 @@ workflows:
group: woo
enable_cot: 1
enable_cot_sync: 1
woo_core_version: 7.1.0-rc.2 # Temporarily force COT beta version
requires:
- unit_tests
- static_analysis_php8
@ -653,17 +663,6 @@ workflows:
group: woo
enable_cot: 1
enable_cot_sync: 0
woo_core_version: 7.1.0-rc.2 # Temporarily force COT beta version
requires:
- unit_tests
- static_analysis_php8
- qa_js
- qa_php
- acceptance_tests:
<<: *slack-fail-post-step
name: acceptance_tests_woo_cot_off
group: woo
woo_core_version: 7.1.0-rc.2 # Temporarily force COT beta version
requires:
- unit_tests
- static_analysis_php8
@ -673,21 +672,11 @@ workflows:
<<: *slack-fail-post-step
requires:
- build
- integration_tests:
<<: *slack-fail-post-step
group: woo
name: integration_test_woocommerce
requires:
- unit_tests
- static_analysis_php8
- qa_js
- qa_php
- integration_tests:
<<: *slack-fail-post-step
group: woo
enable_cot: 1
enable_cot_sync: 1
woo_core_version: 7.1.0-rc.2 # Temporarily force COT beta version
name: integration_test_woo_cot_sync
requires:
- unit_tests
@ -699,7 +688,6 @@ workflows:
group: woo
enable_cot: 1
enable_cot_sync: 0
woo_core_version: 7.1.0-rc.2 # Temporarily force COT beta version
name: integration_test_woo_cot_no_sync
requires:
- unit_tests
@ -709,7 +697,6 @@ workflows:
- integration_tests:
<<: *slack-fail-post-step
group: woo
woo_core_version: 7.1.0-rc.2 # Temporarily force COT beta version
name: integration_test_woo_cot_off
requires:
- unit_tests
@ -745,10 +732,14 @@ workflows:
<<: *slack-fail-post-step
requires:
- build
- acceptance_tests
- acceptance_tests_base_and_woo_cot_off
- js_tests
- integration_test_woocommerce
- integration_test_base
- integration_test_woo_cot_no_sync
- integration_test_woo_cot_off
- integration_test_woo_cot_sync
- acceptance_tests_woo_cot_sync
- acceptance_tests_woo_cot_no_sync
nightly:
triggers:
@ -773,14 +764,14 @@ workflows:
- acceptance_tests:
<<: *slack-fail-post-step
name: acceptance_oldest
woo_core_version: 6.2.2
woo_core_version: 6.8.0
woo_subscriptions_version: 4.3.0
woo_memberships_version: 1.21.0
woo_blocks_version: 5.3.2
mysql_command: --max_allowed_packet=100M
mysql_image_version: 5.7.36
codeception_image_version: 7.4-cli_20210126.1
wordpress_image_version: wp-5.6_php7.2_20220406.1
woo_blocks_version: 6.8.0
mysql_command: --max_allowed_packet=100M --default-storage-engine=MYISAM
mysql_image: mysql:5.5
codeception_image_version: 7.4-cli_20220605.0
wordpress_image_version: wp-5.8_php7.3_20221104.1
requires:
- build
- unit_tests:
@ -803,6 +794,8 @@ workflows:
<<: *slack-fail-post-step
name: integration_oldest
codeception_image_version: 7.2-cli_20220605.0
mysql_command: --max_allowed_packet=100M --default-storage-engine=MYISAM
mysql_image: mysql:5.5
requires:
- build
- build_premium:

View File

@ -126,23 +126,24 @@ You can access this help in your command line running `./do` without parameters.
[Read the article.](https://mailpoet.atlassian.net/wiki/spaces/MAILPOET/pages/629374977/Adding+new+templates+to+the+plugin)
## 🚥 Testing with PHP 7.4 or PHP 8.0
## 🚥 Testing with different PHP versions
To switch the environment to PHP 7.4/8.0:
To switch the environment to a different PHP version:
1. Configure the `wordpress` service in `docker-compose.override.yml` to build from the php74 Dockerfile:
1. Check https://github.com/mailpoet/mailpoet/tree/trunk/dev for a list of available PHP versions. Each directory starting with `php` corresponds to a available version.
2. Configure the `wordpress` service in `docker-compose.override.yml` to build from the desired PHP version Dockerfile (replace {PHP_VERSION} with the name of the directory that corresponds to the version that you want to use):
```yaml
wordpress:
build:
context: .
dockerfile: dev/php74/Dockerfile # OR dev/php80/Dockerfile
dockerfile: dev/{PHP_VERSION}/Dockerfile
```
2. Run `docker-compose build wordpress`.
3. Start the stack with `./do start`.
3. Run `docker-compose build wordpress`.
4. Start the stack with `./do start`.
To switch back to PHP 8.1 remove what was added in 1) and, run `docker-compose build wordpress` for application container and `docker-compose build test_wordpress` for tests container,
To switch back to the default PHP version remove what was added in 2) and, run `docker-compose build wordpress` for application container and `docker-compose build test_wordpress` for tests container,
and start the stack using `./do start`.
## ✅ TODO

46
dev/php82/Dockerfile Normal file
View File

@ -0,0 +1,46 @@
FROM php:8.2.0RC6-apache
ARG UID=1000
ARG GID=1000
# additinal extensions
RUN apt-get update \
&& apt-get install -y git zlib1g-dev libzip-dev zip wget gnupg msmtp libpng-dev gettext subversion \
&& \
# Install NodeJS, enable Corepack
curl -sL https://deb.nodesource.com/setup_17.x | bash - && \
apt-get install -y nodejs build-essential && \
corepack enable && \
\
# Install WP-CLI
curl -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
chmod +x /usr/local/bin/wp && \
\
# Clean up
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY dev/php.ini /usr/local/etc/php/conf.d/php_user.ini
# msmtp config
RUN printf "account default\nhost smtp\nport 1025" > /etc/msmtprc
# xdebug build an config
ENV XDEBUGINI_PATH=/usr/local/etc/php/conf.d/xdebug.ini
RUN git clone -b "3.2.0RC2" --depth 1 https://github.com/xdebug/xdebug.git /usr/src/php/ext/xdebug \
&& docker-php-ext-configure xdebug --enable-xdebug-dev \
&& docker-php-ext-install xdebug \
&& mkdir /tmp/debug
COPY dev/xdebug.ini /tmp/xdebug.ini
RUN cat /tmp/xdebug.ini >> $XDEBUGINI_PATH
# php extensions
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install mysqli
# allow .htaccess files (between <Directory /var/www/> and </Directory>, which is WordPress installation)
RUN sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
# ensure existing content in /var/www/html respects UID and GID, give Node permissions for Corepack
RUN chown -R ${UID}:${GID} /var/www/html && \
mkdir -p /.node && chown -R ${UID}:${GID} /.node

View File

@ -15,6 +15,7 @@ services:
volumes:
- my-datavolume:/var/lib/mysql
- ./dev/database/create_test_db.sh:/docker-entrypoint-initdb.d/10-create_test_db.sh
command: --sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ANSI,ONLY_FULL_GROUP_BY
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress

View File

@ -1,4 +1,4 @@
<?php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
// phpcs:disable PSR1.Classes.ClassDeclaration
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
@ -297,6 +297,29 @@ class RoboFile extends \Robo\Tasks {
return $this->runTestsInContainer($opts);
}
public function testPerformance($path = null, $opts = ['url' => null, 'head' => false, 'scenario' => null]) {
// run WordPress setup
$this->taskExec('COMPOSE_HTTP_TIMEOUT=200 docker-compose run --rm -it setup')
->dir(__DIR__ . '/tests/performance')
->run();
// run performance tests
$dir = __DIR__;
return $this->taskExec("php $dir/tools/xk6browser.php")
->arg('run')
->option('env', 'URL=' . $opts['url'])
->option('env', 'HEADLESS=' . ($opts['head'] ? 'false' : 'true'))
->option('env', 'SCENARIO=' . $opts['scenario'])
->arg($path ?? "$dir/tests/performance/scenarios.js")
->dir($dir)->run();
}
public function testPerformanceClean() {
$this->taskExec('COMPOSE_HTTP_TIMEOUT=200 docker-compose down --remove-orphans -v')
->dir(__DIR__ . '/tests/performance')
->run();
}
public function testAcceptanceMultisite($opts = ['file' => null, 'skip-deps' => false, 'group' => null, 'timeout' => null, 'enable-cot' => false, 'enable-cot-sync' => false]) {
return $this->runTestsInContainer(array_merge($opts, ['multisite' => true]));
}
@ -425,6 +448,9 @@ class RoboFile extends \Robo\Tasks {
$collection->addCode(function() {
return $this->qaCodeSniffer([]);
});
$collection->addCode(function() {
return $this->qaMinimalPluginStandard([]);
});
return $collection->run();
}
@ -501,7 +527,56 @@ class RoboFile extends \Robo\Tasks {
'./tasks/code_sniffer/vendor/bin/phpcs',
'--extensions=php',
$severityFlag,
'--standard=tasks/code_sniffer/MailPoet',
'--standard=tasks/code_sniffer/MailPoet/free-ruleset.xml',
'-s',
]);
$ignorePaths = [
'.mp_svn',
'assets',
'doc',
'generated',
'lib/Config/PopulatorData/Templates',
'lib-3rd-party',
'node_modules',
'plugin_repository',
'prefixer/build',
'prefixer/vendor',
'tasks/code_sniffer/vendor',
'tasks/phpstan/vendor',
'tasks/makepot',
'tools/vendor',
'temp',
'tests/_data',
'tests/_output',
'tests/_support/_generated',
'vendor',
'vendor-prefixed',
'views',
];
// the "--ignore" arg takes a list of regexes, we need to anchor and escape them
$ignorePatterns = array_map(function (string $path): string {
return '^' . preg_quote(__DIR__ . DIRECTORY_SEPARATOR . $path);
}, $ignorePaths);
$stringFilesToCheck = !empty($filesToCheck) ? implode(' ', $filesToCheck) : '.';
return $this->taskExec($task)
->arg('--ignore=' . implode(',', $ignorePatterns))
->rawArg($stringFilesToCheck)
->run();
}
public function qaMinimalPluginStandard(array $filesToCheck, $opts = ['severity' => 'all']) {
$severityFlag = $opts['severity'] === 'all' ? '-w' : '-n';
$task = implode(' ', [
'php -d memory_limit=-1',
'./tasks/code_sniffer/vendor/bin/phpcs',
'--extensions=php',
$severityFlag,
'--standard=tasks/code_sniffer/vendor/wporg/plugin-directory/MinimalPluginStandard',
'-s',
]);
@ -799,6 +874,9 @@ class RoboFile extends \Robo\Tasks {
->addCode(function () use ($version) {
$this->releaseCreatePullRequest($version);
})
->addCode(function () use ($version) {
$this->releaseRerunCircleWorkflow(\MailPoetTasks\Release\CircleCiController::PROJECT_PREMIUM);
})
->addCode(function () use ($version) {
$this->translationsPrepareLanguagePacks($version);
})
@ -1116,6 +1194,18 @@ class RoboFile extends \Robo\Tasks {
$this->say("Release '$version[name]' info was published on Slack.");
}
public function releaseRerunCircleWorkflow(string $project = null) {
$circleciController = $this->createCircleCiController();
$result = $circleciController->rerunLatestWorkflow($project);
// Sometimes can be useful to know which Circle project workflow was restarted
$project = $project ? " for the project '{$project}'" : '';
if (!$result) {
$this->yell("Circle Workflow{$project} was not restarted", 40, 'red');
} else {
$this->say("Circle Workflow{$project} was started from the beginning");
}
}
public function downloadWooCommerceBlocksZip($tag = null) {
$this->createWpOrgDownloader('woo-gutenberg-products-block')
->downloadPluginZip('woo-gutenberg-products-block.zip', __DIR__ . '/tests/plugins/', $tag);

BIN
mailpoet/assets/audio/0.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/1.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/2.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/3.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/4.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/5.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/6.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/7.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/8.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/9.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/a.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/b.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/c.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/d.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/e.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/f.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/g.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/h.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/i.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/j.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/k.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/l.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/m.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/n.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/o.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/p.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/q.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/r.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/s.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/t.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/u.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/v.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/w.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/x.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/y.mp3 Normal file

Binary file not shown.

BIN
mailpoet/assets/audio/z.mp3 Normal file

Binary file not shown.

View File

@ -1,4 +1,4 @@
.mailpoet-automation-workflow-add-trigger {
.mailpoet-automation-add-trigger {
align-items: center;
border: 1px dashed #c3c4c7;
border-radius: 4px;

View File

@ -1,14 +1,14 @@
.mailpoet-automation-editor-workflow {
.mailpoet-automation-editor-automation {
background: #fbfbfb;
flex-grow: 1;
}
.mailpoet-automation-editor-workflow-wrapper {
.mailpoet-automation-editor-automation-wrapper {
display: grid;
padding: 50px 20px;
}
.mailpoet-automation-editor-workflow-end {
.mailpoet-automation-editor-automation-end {
background: #8c8f94;
border-radius: 999999px;
fill: white;

View File

@ -1,4 +1,4 @@
.mailpoet-automation-editor-empty-workflow {
.mailpoet-automation-editor-empty-automation {
align-items: center;
display: grid;
height: 100%;

View File

@ -34,9 +34,10 @@
.mailpoet-automation-field__error {
position: relative;
input,
input:not([type='radio'])
select,
textarea {
textarea,
input[type='text'].components-form-token-field__input {
background: right top/26px no-repeat url('../../img/icons/alert.svg');
padding-right: 26px;
}

View File

@ -5,6 +5,10 @@
.components-panel__body-title.mailpoet-automation-panel-plain-body-title {
display: grid;
grid-template-columns: 1fr auto;
&:hover {
background: none;
}
}
.mailpoet-automation-panel-plain-body-title-text {

View File

@ -23,3 +23,11 @@
transform: scale(-1, -1);
transform-origin: center 12.5px;
}
.mailpoet-option-button-opener.is-busy {
animation: components-button__busy-animation 2500ms infinite linear;
background-color: var(--wp-admin-theme-color);
background-image: linear-gradient(-45deg, var(--wp-admin-theme-color) 33%, var(--wp-admin-theme-color-darker-20) 33%, var(--wp-admin-theme-color-darker-20) 70%, var(--wp-admin-theme-color) 70%);
background-size: 100px 100%;
border-color: var(--wp-admin-theme-color);
}

View File

@ -51,4 +51,8 @@
.mailpoet_form_field_block {
display: block;
}
.mailpoet_form_field_input_nowrap {
white-space: nowrap;
}
}

View File

@ -0,0 +1,41 @@
.mailpoet_coupon_block {
.mailpoet_editor_coupon {
text-align: center;
}
.mailpoet_editor_coupon_overlay {
background: rgba(255, 255, 255, .5);
color: #000;
cursor: pointer;
display: none;
font-size: 18px;
height: 100%;
position: absolute;
text-align: center;
top: 0;
width: 100%;
}
:hover {
.mailpoet_editor_coupon {
opacity: .5;
}
.mailpoet_editor_coupon_overlay {
display: block;
}
}
}
.coupon_amount_wrapper {
position: relative;
}
.amount_percentage_sign {
font-size: 18px;
font-weight: bold;
left: 150px; // .mailpoet_input_medium width
line-height: 30px;
margin-left: 10px;
position: absolute;
}

View File

@ -111,10 +111,29 @@ h2 {
.edit-post-visual-editor {
background-color: $color-white;
padding: 10px;
padding: 10px 10px 100px;
}
// Unify padding o wp-block-columns with background with front end rendering
.wp-block-columns.has-background {
padding: 10px;
}
// Close button animation
.edit-post-header-toolbar.edit-post-header-toolbar__left > .edit-post-header-toolbar__inserter-toggle {
svg {
transition: transform cubic-bezier(.165, .84, .44, 1) .2s;
}
&.is-pressed svg {
transform: rotate(45deg);
}
}
// Hide block selector header with close button on desktops
@include respond-to(not-small-screen) {
.edit-post-editor__inserter-panel-header {
display: none;
}
}

View File

@ -1,28 +0,0 @@
// Override CSS for HelpScout beacon on form editor page
.admin_page_mailpoet-form-editor {
.BeaconFabButtonFrame,
.BeaconContainer {
left: 175px;
}
&.folded {
.BeaconFabButtonFrame,
.BeaconContainer {
left: 50px;
}
}
@include respond-to(medium-screen) {
.BeaconFabButtonFrame,
.BeaconContainer {
left: 50px;
}
}
@include respond-to(small-screen) {
.BeaconFabButtonFrame,
.BeaconContainer {
left: 15px;
}
}
}

View File

@ -123,4 +123,5 @@
// This style hides the horizontal scrollbar in Firefox browser
.interface-interface-skeleton__sidebar {
overflow-x: hidden;
padding-bottom: 100px;
}

View File

@ -0,0 +1,26 @@
.mailpoet-homepage-section__container {
background-color: $color-white;
box-shadow: rgb(0 0 0 / 10%) 0 0 0 1px;
margin: $grid-gap-xl 0 $grid-gap-medium;
}
.mailpoet-homepage-section__heading {
align-items: center;
border-bottom: 1px solid $color-homepage-borders;
display: grid;
grid-template-columns: auto $grid-gap-medium;
height: 60px;
padding: 0 $grid-gap-medium;
position: relative;
h2 {
font-size: 20px;
font-weight: normal;
line-height: 28px;
margin: 0;
}
@include respond-to(small-screen) {
padding: $grid-gap-half $grid-gap-medium;
}
}

View File

@ -0,0 +1,5 @@
.mailpoet-homepage__container {
margin: 0 auto;
margin-top: $grid-gap-xl;
max-width: 680px;
}

View File

@ -0,0 +1,68 @@
.mailpoet-homepage-product-discovery {
ul {
margin: 0;
}
}
.mailpoet-product-discovery__task {
align-items: center;
border-bottom: 1px solid $color-homepage-borders;
box-sizing: border-box;
cursor: pointer;
display: grid;
font-weight: 600;
grid-template-columns: (124px + $grid-gap-medium) auto $grid-gap-xl;
margin: 0;
padding: $grid-gap-medium;
position: relative;
width: 100%;
@include respond-to(small-screen) {
grid-template-columns: auto $grid-gap-xl;
img {
display: none;
}
}
&:last-child {
border-bottom: none;
}
&:hover {
box-shadow: inset 5px 0 0 0 var(--wp-admin-theme-color);
}
}
.mailpoet-product-discovery__task--completed {
cursor: inherit;
&:hover {
box-shadow: none;
}
}
.mailpoet-product-discovery__task-content {
h3 {
color: var(--wp-admin-theme-color);
font-size: 14px;
line-height: 20px;
margin: 0;
}
p {
color: $color-text-light;
font-weight: normal;
margin: 3px 0 0;
}
}
.mailpoet-product-discovery__task-after {
.mailpoet-task-list__task-icon {
background-color: var(--wp-admin-theme-color);
svg {
fill: $color-white;
}
}
}

View File

@ -0,0 +1,126 @@
$task-icon-size: 32px;
.mailpoet-task-list__task {
background-color: $color-white;
border-bottom: 1px solid $color-homepage-borders;
box-sizing: border-box;
cursor: pointer;
display: grid;
font-weight: 600;
grid-template-columns: $grid-gap-xl auto $grid-gap-xl;
margin: 0;
padding: $grid-gap $grid-gap-medium;
position: relative;
width: 100%;
&:hover {
background-color: $color-grey-0;
}
}
.mailpoet-task-list__task-content {
align-content: center;
color: var(--wp-admin-theme-color);
display: flex;
flex-direction: column;
font-size: 14px;
justify-content: center;
line-height: 20px;
p {
color: $color-text-light;
font-weight: normal;
margin: 3px 0 0;
}
a {
color: var(--wp-admin-theme-color);
&:hover {
color: var(--wp-admin-theme-color-darker-20);
}
}
}
.mailpoet-task-list__task-before {
color: var(--wp-admin-theme-color);
display: flex;
flex-direction: column;
justify-content: center;
}
.mailpoet-task-list__task-icon {
border: 1px solid var(--wp-admin-theme-color);
border-radius: 50%;
box-sizing: border-box;
height: $task-icon-size;
line-height: $task-icon-size;
text-align: center;
width: $task-icon-size;
svg {
fill: var(--wp-admin-theme-color);
margin: 3px;
}
}
.mailpoet-task-list__task--completed {
cursor: inherit;
&:hover {
background-color: $color-white;
}
.mailpoet-task-list__task-icon {
background-color: var(--wp-admin-theme-color);
svg {
fill: $color-white;
}
}
}
.mailpoet-task-list__task--active {
box-shadow: inset 5px 0 0 0 var(--wp-admin-theme-color);
&:after {
background-color: var(--wp-admin-theme-color);
content: '';
height: 100%;
left: 0;
opacity: .1;
pointer-events: none;
position: absolute;
top: 0;
width: 100%;
}
}
.mailpoet-task-list__heading p,
.mailpoet-task-list__all-set {
color: $color-text-light;
font-size: $heading-font-size-h4;
line-height: 1.5;
margin-top: $grid-gap-large;
text-align: center;
}
.mailpoet-task-list__heading {
margin-bottom: $grid-gap-large;
position: relative;
h1 {
margin: 0;
}
p {
margin-top: $grid-gap-half;
text-align: left;
}
.components-dropdown {
position: absolute;
right: 0;
top: 6px;
}
}

View File

@ -122,3 +122,21 @@ body .components-modal__screen-overlay {
justify-content: flex-end;
margin-top: $grid-gap-half;
}
.mailpoet-locked-badge {
align-items: center;
background: #fcf9e8;
border: .5px solid #f5e6ab;
border-radius: 4px;
color: #bd8600;
display: flex;
font-size: 11px;
font-weight: 500;
gap: 4px;
height: 20px;
letter-spacing: .2px;
line-height: 16px;
padding: 2px 8px 2px 4px;
text-transform: uppercase;
width: 82px;
}

View File

@ -0,0 +1,196 @@
#mailpoet_landingpage_container {
$content-padding: 32px 65px;
$mobile-content-padding: 25px;
.mailpoet-content-center {
text-align: center;
}
.mailpoet-content-padding {
padding: $content-padding;
@include respond-to(small-screen) {
padding: $mobile-content-padding
}
}
.landing-header {
padding: $content-padding;
@include respond-to(small-screen) {
padding: $mobile-content-padding
}
}
.landing-footer {
background-color: $color-landingpage-background-light;
padding: $content-padding;
.landing-footer-content {
box-shadow: 0 -1px 0 0 $color-tertiary-light;
padding: 25px 0;
}
}
.landing-faq {
background-color: $color-landingpage-background-light;
padding: $content-padding;
.mailpoet-faq-accordion {
margin: 25px 0;
}
.landing-faq-mobile {
display: none;
}
@include respond-to(small-screen) {
padding: $mobile-content-padding;
.landing-faq-header {
display: none;
}
.landing-faq-mobile {
display: block;
}
}
}
.landing-content {
.hero-section {
$hero-image-offset: 6rem;
background-color: $color-landingpage-background-light;
margin-top: $hero-image-offset;
padding: $content-padding;
.hero-image {
margin-top: -($hero-image-offset + 2rem);
}
@include respond-to(small-screen) {
padding: $mobile-content-padding
}
}
.landingpage-images {
@include respond-to(medium-screen) {
width: 100%;
}
}
.landingpage-general-features {
p:last-child {
margin: 10px auto;
width: 60%;
}
.landingpage-feature-icon {
display: block;
margin: 0 auto;
padding: 20px;
text-align: center;
}
@include respond-to(medium-screen) {
p:last-child {
width: 100%;
}
}
}
.landingpage-wooCommerce-features {
margin-top: 30px;
padding: 2rem 10rem;
.landingpage-wooCommerce-feature-item {
padding: 30px;
@media screen and (min-width: 960px) and (max-width: 1460px) {
.landingpage-images {
width: 100%;
}
}
div:last-child {
margin: auto;
}
}
@include respond-to(small-screen) {
padding: $mobile-content-padding;
.landingpage-wooCommerce-feature-item {
padding: 25px 0;
div:last-child {
text-align: center;
}
}
}
}
}
}
.mailpoet-faq-accordion {
details {
overflow: hidden;
&:not(:first-child) {
border-top: 1px solid $color-editor-border-structure;
}
summary {
cursor: pointer;
padding: 20px 5px;
position: relative;
&::-webkit-details-marker { // remove default marker
content: '';
display: none;
}
&::marker { // remove default marker
content: '';
display: none;
}
&:after {
content: '';
font-size: 30px;
position: absolute;
right: 20px;
top: 0;
transform: rotate(90deg);
transform-origin: center;
transition: .2s transform ease;
}
@include respond-to(small-screen) {
&:after {
right: -1px;
}
}
}
.content {
max-height: 0;
overflow: hidden;
padding: 10px 5px;
transition: max-height .3s ease;
}
// when accordion is opened
&[open] {
summary:after {
transform: rotate(-90deg);
transition: .5s transform ease;
}
.content {
max-height: 400px;
transition: max-height .5s ease-in;
}
}
}
}

View File

@ -4,6 +4,6 @@
}
// Fix for 3rd party plugins icons in menu that might display broken because we block loading 3rd party CSS on mailepoet pages
#adminmenu .wp-menu-image img {
#adminmenu :not(.toplevel_page_site-card) .wp-menu-image img {
max-width: 20px;
}

View File

@ -119,6 +119,10 @@
color: $color-stats-average;
}
.mailpoet-statistics-value-number-critical {
color: $color-stats-critical;
}
.mailpoet-statistics-value-number-excellent {
color: $color-stats-excellent;
}

View File

@ -22,6 +22,12 @@
}
}
#mailpoet-wizard-container {
.mailpoet-top-bar {
left: 0;
}
}
.mailpoet-wizard-logo {
margin-bottom: 100px;
text-align: center;
@ -35,6 +41,7 @@
align-items: center;
display: flex;
justify-content: center;
margin-top: 8px;
@include respond-to(medium-screen) {
flex-direction: column;
@ -42,7 +49,7 @@
}
.mailpoet-wizard-step-illustration {
margin-right: $grid-gap;
margin-right: $grid-gap-xl;
max-width: $grid-column;
text-align: center;
width: 100%;
@ -63,12 +70,16 @@
}
.mailpoet-wizard-step-content {
max-width: $grid-column-small + $grid-gap + $grid-column;
max-width: 480px;
width: 100%;
@include respond-to(medium-screen) {
max-width: $grid-column;
}
.mailpoet-button {
height: 36px;
}
}
.mailpoet-wizard-label {
@ -111,12 +122,16 @@
.mailpoet-wizard-woocommerce-option {
align-items: center;
box-shadow: 0 -1px 0 0 $color-tertiary-light;
box-shadow: 0 1px 0 0 $color-tertiary-light;
display: flex;
flex-direction: row-reverse;
justify-content: space-between;
padding-bottom: 25px;
padding-top: 1px;
&:last-child {
box-shadow: 0 0;
}
}
.mailpoet-wizard-note {

View File

@ -0,0 +1,12 @@
.mailpoet_captcha_form {
.mailpoet_icon_button {
background: transparent;
border: 0;
cursor: pointer;
img {
height: 20px;
width: 20px;
}
}
}

View File

@ -112,3 +112,11 @@
max-width: 100%;
width: 100%;
}
.authorize-sender-email-and-domain-modal {
z-index: 30; // overlay other modals
}
.authorize-sender-email-and-domain-modal-overlay {
z-index: $modal-screen-overlay-z-index + 4; // overlay other modals
}

View File

@ -41,6 +41,15 @@
}
}
.mailpoet-tag-critical {
border-color: $color-stats-critical;
color: $color-stats-critical;
&.mailpoet-tag-inverted {
background: $color-stats-critical;
}
}
.mailpoet-tag-good {
border-color: $color-stats-good;
color: $color-stats-good;

View File

@ -29,7 +29,6 @@ $beamer-dot-size: 8px;
}
.mailpoet-top-bar-logo {
cursor: pointer;
position: relative;
top: 2px;
z-index: 1;
@ -39,6 +38,10 @@ $beamer-dot-size: 8px;
max-width: 100%;
}
}
a.mailpoet-top-bar-logo {
cursor: pointer;
}
}
.mailpoet-top-bar-logo-desktop {

View File

@ -11,17 +11,17 @@
@import './components-automation-editor/add-step-button';
@import './components-automation-editor/add-trigger';
@import './components-automation-editor/automation';
@import './components-automation-editor/block-icon';
@import './components-automation-editor/chip';
@import './components-automation-editor/dropdown';
@import './components-automation-editor/empty-workflow';
@import './components-automation-editor/empty-automation';
@import './components-automation-editor/errors';
@import './components-automation-editor/panel';
@import './components-automation-editor/separator';
@import './components-automation-editor/status';
@import './components-automation-editor/step';
@import './components-automation-editor/step-card';
@import './components-automation-editor/workflow';
@import './components-automation-editor/notices';
@import './components-automation-editor/deactivate-modal';

View File

@ -17,17 +17,30 @@ ul.mailpoet-automation-templates {
.mailpoet-automation-template-list-item {
button.components-button {
align-content: baseline;
align-items: flex-start;
background: #fff;
border: 1px solid #dcdcde;
border-radius: 4px;
cursor: pointer;
display: flex;
flex-direction: column;
display: grid;
grid-template-rows: 40px auto auto;
height: 100%;
padding: 24px 24px 26px;
text-align: left;
width: 100%;
&:disabled,
&[aria-disabled='true'] {
color: #787c82;
cursor: not-allowed;
opacity: 1;
h2 {
color: #787c82;
}
}
&:hover {
background: #fff;
border: 1px solid #dcdcde;
@ -49,7 +62,6 @@ ul.mailpoet-automation-templates {
h2 {
background: transparent;
border: none;
color: #2271b1;
font-size: 14px;
font-weight: 600;
line-height: 21px;
@ -78,4 +90,27 @@ ul.mailpoet-automation-templates {
fill: #dcdcde;
}
}
.badge {
text-align: right;
transform: translateX(24px);
span {
padding: 3px 8px;
}
}
}
.mailpoet-automation-template-list-item-coming-soon {
.badge span {
background: #ffe9cc;
color: #1d2327;
}
}
.mailpoet-automation-template-list-item-premium {
.badge span {
background: #ff5301;
color: #fff;
}
}

View File

@ -53,6 +53,7 @@
@import 'components-editor/content-blocks/unknown_block_fallback';
@import 'components-editor/content-blocks/woocommerce-heading';
@import 'components-editor/content-blocks/woocommerce-content';
@import 'components-editor/content-blocks/coupon';
// Utilities
// Helpers and overrides.

View File

@ -34,7 +34,6 @@
@import './components-form-editor/custom-field';
@import './components-form-editor/form-title';
@import './components-form-editor/header';
@import './components-form-editor/helpscout';
@import './components-form-editor/form-placement';
@import './components-form-editor/preview';
@import './components-form-editor/block-editor';

View File

@ -0,0 +1,23 @@
@import '../../../node_modules/@woocommerce/components/build-style/style'; // Needed to load WP admin themes color variables
// Settings
// Global variables, config switches. Not producing any CSS.
@import 'settings/breakpoints';
@import 'settings/colors';
@import 'settings/grid';
@import 'settings/typography';
// Tools
// Default mixins and functions. Still not producing any CSS.
@import 'mixins/breakpoints';
// Components
// Actual UI components.
@import 'components-homepage/_layout';
@import 'components-homepage/_task-list';
@import 'components-homepage/_content-section';
@import 'components-homepage/_product-discovery';

View File

@ -85,3 +85,4 @@
@import 'components-plugin/set-from-address-modal';
@import 'components-plugin/stats';
@import 'components-plugin/import-export';
@import 'components-plugin/landingpage';

View File

@ -19,3 +19,4 @@
@import 'components-public/public';
@import 'components-public/animation';
@import 'components-public/form_colors';
@import 'components-public/captcha';

View File

@ -1,3 +1,3 @@
// WordPress breakpoints
$mailpoet-breakpoint-small: 782px;
$mailpoet-breakpoint-small: 781px;
$mailpoet-breakpoint-medium: 960px;

View File

@ -69,6 +69,7 @@ $color-badge-video-guide: #46b450;
$color-stats-average: #f559c3;
$color-stats-good: #ff9f00;
$color-stats-excellent: #7ed321;
$color-stats-critical: #f00;
$color-stats-unknown: $color-primary-inactive;
// Automation editor
@ -78,3 +79,9 @@ $color-chip-success-bg: #b8e6bf;
$color-chip-success-text: #005c12;
$color-chip-danger-bg: #facfd2;
$color-chip-danger-text: #8a2424;
// Landing page
$color-landingpage-background-light: #fbfbfb;
// Homepage
$color-homepage-borders: #e0e0e0;

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><rect x="0" fill="none" width="20" height="20"/><g><path d="M2 7h4l5-4v14l-5-4H2V7zm12.69-2.46C14.82 4.59 18 5.92 18 10s-3.18 5.41-3.31 5.46c-.06.03-.13.04-.19.04-.2 0-.39-.12-.46-.31-.11-.26.02-.55.27-.65.11-.05 2.69-1.15 2.69-4.54 0-3.41-2.66-4.53-2.69-4.54-.25-.1-.38-.39-.27-.65.1-.25.39-.38.65-.27zM16 10c0 2.57-2.23 3.43-2.32 3.47-.06.02-.12.03-.18.03-.2 0-.39-.12-.47-.32-.1-.26.04-.55.29-.65.07-.02 1.68-.67 1.68-2.53s-1.61-2.51-1.68-2.53c-.25-.1-.38-.39-.29-.65.1-.25.39-.39.65-.29.09.04 2.32.9 2.32 3.47z"/></g></svg>

After

Width:  |  Height:  |  Size: 587 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><rect x="0" fill="none" width="20" height="20"/><g><path d="M10.25 1.02c5.1 0 8.75 4.04 8.75 9s-3.65 9-8.75 9c-3.2 0-6.02-1.59-7.68-3.99l2.59-1.52c1.1 1.5 2.86 2.51 4.84 2.51 3.3 0 6-2.79 6-6s-2.7-6-6-6c-1.97 0-3.72 1-4.82 2.49L7 8.02l-6 2v-7L2.89 4.6c1.69-2.17 4.36-3.58 7.36-3.58z"/></g></svg>

After

Width:  |  Height:  |  Size: 355 B

View File

@ -18,7 +18,7 @@ import _ from 'underscore';
*/
var eventsCache = [];
function track(name, data = []) {
function track(name, data = [], options = {}, callback = null) {
let trackedData = data;
if (typeof window.mixpanel.track !== 'function') {
@ -33,7 +33,7 @@ function track(name, data = []) {
trackedData['MailPoet Premium version'] = window.mailpoet_premium_version;
}
window.mixpanel.track(name, trackedData);
window.mixpanel.track(name, trackedData, options, callback);
}
function exportMixpanel() {
@ -45,24 +45,37 @@ function exportMixpanel() {
) {
window.MailPoet.trackEvent = track;
} else {
window.MailPoet.trackEvent = function emptyFunction() {};
window.MailPoet.trackEvent = function emptyFunction(
name,
data,
options,
callback,
) {
if (typeof callback === 'function') {
callback();
}
};
}
}
function trackCachedEvents() {
eventsCache.forEach(function trackIfEnabled(event) {
if (window.mailpoet_analytics_enabled || event.forced) {
track(event.name, event.data);
track(event.name, event.data, event.options);
}
});
}
function cacheEvent(forced, name, data) {
function cacheEvent(forced, name, data, options, callback) {
eventsCache.push({
name: name,
data: data,
options: options,
forced: forced,
});
if (typeof callback === 'function') {
callback();
}
}
function initializeMixpanelWhenLoaded() {

View File

@ -1,81 +0,0 @@
import { useCallback, useEffect, useState } from 'react';
import { api } from '../config';
const API_URL = `${api.root}/mailpoet/v1/automation`;
export const request = (
path: string,
init?: RequestInit,
): ReturnType<typeof fetch> => fetch(`${API_URL}/${path}`, init);
type Error<T> = {
response?: Response;
data?: T;
};
type State<T> = {
data?: T;
loading: boolean;
error?: Error<T>;
};
type Result<T> = [(init?: RequestInit) => Promise<void>, State<T>];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type Data = Record<string, any>;
export const useMutation = <T extends Data>(
path: string,
config?: RequestInit,
): Result<T> => {
const [state, setState] = useState<State<T>>({
data: undefined,
loading: false,
error: undefined,
});
const mutation = useCallback(
async (init?: RequestInit) => {
setState((prevState) => ({ ...prevState, loading: true }));
const response = await request(path, {
...config,
...init,
headers: {
'content-type': 'application/json',
...(init?.headers ?? {}),
'x-wp-nonce': api.nonce,
},
});
try {
const data = await response.json();
const error = response.ok ? null : { ...response, data };
setState((prevState) => ({ ...prevState, data, error }));
} catch (_) {
const error = { response };
setState((prevState) => ({ ...prevState, error }));
} finally {
setState((prevState) => ({ ...prevState, loading: false }));
}
},
[config, path],
);
return [mutation, state];
};
export const useQuery = <T extends Data>(
path: string,
init?: RequestInit,
): State<T> => {
const [mutation, result] = useMutation<T>(path, init);
useEffect(
() => {
void mutation();
},
[] /* eslint-disable-line react-hooks/exhaustive-deps -- request only on initial load */,
);
return result;
};

View File

@ -1,9 +1,7 @@
import apiFetch from '@wordpress/api-fetch';
import { api } from '../config';
export * from './hooks';
const apiUrl = `${api.root}/mailpoet/v1/automation/`;
const apiUrl = `${api.root}/mailpoet/v1/`;
export type ApiError = {
code?: string;

View File

@ -1,24 +1,33 @@
import { useEffect } from 'react';
import { useEffect, useState } from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import { TopBarWithBeamer } from 'common/top_bar/top_bar';
import { Popover, SlotFillProvider } from '@wordpress/components';
import { useSelect } from '@wordpress/data';
import { initializeApi, useMutation } from './api';
import { initializeApi } from './api';
import { registerTranslations } from './i18n';
import { createStore, storeName } from './listing/store';
import { AutomationListing, AutomationListingHeader } from './listing';
import { registerApiErrorHandler } from './listing/api-error-handler';
import { Notices } from './listing/components/notices';
import { WorkflowListingNotices } from './listing/workflow-listing-notices';
import { BuildYourOwnSection, HeroSection, TemplatesSection } from './sections';
import {
CreateEmptyWorkflowButton,
CreateWorkflowFromTemplateButton,
} from './testing';
import { MailPoet } from '../mailpoet';
const trackOpenEvent = () => {
MailPoet.trackEvent('Automations > Listing viewed');
};
function Content(): JSX.Element {
const count = useSelect((select) => select(storeName).getWorkflowCount());
const [isBooting, setIsBooting] = useState(true);
const count = useSelect((select) => select(storeName).getAutomationCount());
useEffect(() => {
if (!isBooting || count === 0) {
return;
}
trackOpenEvent();
setIsBooting(false);
}, [isBooting, count]);
const content =
count > 0 ? (
<>
@ -49,7 +58,7 @@ function Content(): JSX.Element {
);
}
function Workflows(): JSX.Element {
function Automations(): JSX.Element {
return (
<>
<TopBarWithBeamer />
@ -59,79 +68,12 @@ function Workflows(): JSX.Element {
);
}
function RecreateSchemaButton(): JSX.Element {
const [createSchema, { loading, error }] = useMutation('system/database', {
method: 'POST',
});
return (
<div>
<WorkflowListingNotices />
<button
className="button button-link-delete"
type="button"
onClick={() => createSchema()}
disabled={loading}
>
Recreate DB schema (data will be lost)
</button>
{error && (
<div>{error?.data?.message ?? 'An unknown error occurred'}</div>
)}
</div>
);
}
function DeleteSchemaButton(): JSX.Element {
const [deleteSchema, { loading, error }] = useMutation('system/database', {
method: 'DELETE',
});
return (
<div>
<button
className="button button-link-delete"
type="button"
onClick={async () => {
await deleteSchema();
window.location.href =
'/wp-admin/admin.php?page=mailpoet-experimental';
}}
disabled={loading}
>
Delete DB schema & deactivate feature
</button>
{error && (
<div>{error?.data?.message ?? 'An unknown error occurred'}</div>
)}
</div>
);
}
function App(): JSX.Element {
return (
<SlotFillProvider>
<BrowserRouter>
<div>
<Workflows />
<div style={{ marginTop: 30, display: 'grid', gridGap: 8 }}>
<CreateEmptyWorkflowButton />
<CreateWorkflowFromTemplateButton slug="simple-welcome-email">
Create testing workflow from template (welcome email)
</CreateWorkflowFromTemplateButton>
<CreateWorkflowFromTemplateButton slug="welcome-email-sequence">
Create testing workflow from template (welcome sequence, only
premium)
</CreateWorkflowFromTemplateButton>
<CreateWorkflowFromTemplateButton slug="advanced-welcome-email-sequence">
Create testing workflow from template (advanced welcome sequence,
only premium)
</CreateWorkflowFromTemplateButton>
<RecreateSchemaButton />
<DeleteSchemaButton />
</div>
<Popover.Slot />
</div>
<Automations />
<Popover.Slot />
</BrowserRouter>
</SlotFillProvider>
);

View File

@ -1,3 +1,4 @@
import { Dispatch, SetStateAction, useState } from 'react';
import { Button, DropdownMenu } from '@wordpress/components';
import { chevronDown } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';
@ -8,7 +9,7 @@ type OptionButtonPropType = {
variant: Button.ButtonVariant;
controls: StepMoreControlsType;
title: string;
onClick: () => void;
onClick: (setIsBusy: Dispatch<SetStateAction<boolean>>) => void;
};
export function OptionButton({
controls,
@ -16,13 +17,22 @@ export function OptionButton({
onClick,
variant,
}: OptionButtonPropType): JSX.Element {
const [isBusy, setIsBusy] = useState(false);
const slots = Object.values(controls).filter((item) => item.slot);
const dropDownMenuClassNames = isBusy
? `mailpoet-option-button-opener is-busy`
: `mailpoet-option-button-opener`;
return (
<div className="mailpoet-option-button">
<Button
isBusy={isBusy}
disabled={isBusy}
variant={variant}
className="mailpoet-option-button-main"
onClick={onClick}
onClick={() => {
setIsBusy(true);
onClick(setIsBusy);
}}
>
{title}
</Button>
@ -32,10 +42,20 @@ export function OptionButton({
))}
{Object.values(controls).length > 0 && (
<DropdownMenu
className="mailpoet-option-button-opener"
className={dropDownMenuClassNames}
label={__('More', 'mailpoet')}
icon={chevronDown}
controls={Object.values(controls).map((item) => item.control)}
controls={Object.values(controls).map((item) => {
const control = {
...item.control,
onClick: () => {
setIsBusy(true);
item.control.onClick(setIsBusy);
},
};
return control;
})}
popoverProps={{ position: 'bottom left' }}
/>
)}

View File

@ -1,4 +1,5 @@
import { Fragment } from '@wordpress/element';
import { locale } from '../../config';
type Item = {
key: string;
@ -15,7 +16,7 @@ export function Statistics({
items,
labelPosition = 'before',
}: Props): JSX.Element {
const intl = new Intl.NumberFormat();
const intl = new Intl.NumberFormat(locale.toString());
return (
<div className="mailpoet-automation-stats">
{items.map((item, i) => (

View File

@ -4,9 +4,29 @@ declare global {
root: string;
nonce: string;
};
mailpoet_workflow_count: number;
mailpoet_locale_full: string;
mailpoet_automation_count: number;
}
}
export const api = window.mailpoet_automation_api;
export const workflowCount = window.mailpoet_workflow_count;
export const automationCount = window.mailpoet_automation_count;
// export locale to use with Intl APIs
export const locale: Intl.Locale = (() => {
const tag = (
window.mailpoet_locale_full ??
document.documentElement.lang ??
'en'
).replace('_', '-');
try {
return new Intl.Locale(tag);
} catch (_) {
try {
return new Intl.Locale(tag.split('-')[0]);
} catch (__) {
return new Intl.Locale('en');
}
}
})();

View File

@ -19,7 +19,7 @@ export const registerApiErrorHandler = (): void =>
const status = errorObject.data?.status;
const code = errorObject.code;
if (code === 'mailpoet_automation_workflow_not_valid') {
if (code === 'mailpoet_automation_not_valid') {
dispatch(storeName).setErrors({ steps: errorObject.data.errors });
return undefined;
}

View File

@ -9,9 +9,9 @@ import { storeName } from '../../store';
export function TrashButton(): JSX.Element {
const [showConfirmDialog, setShowConfirmDialog] = useState(false);
const { workflow } = useSelect(
const { automation } = useSelect(
(select) => ({
workflow: select(storeName).getWorkflowData(),
automation: select(storeName).getAutomationData(),
}),
[],
);
@ -33,7 +33,7 @@ export function TrashButton(): JSX.Element {
>
{sprintf(
__('You are about to delete the automation "%s".', 'mailpoet'),
workflow.name,
automation.name,
)}
<br />
{__(' This will stop it for all subscribers immediately.', 'mailpoet')}

View File

@ -1,7 +1,7 @@
import { useContext } from 'react';
import { __unstableCompositeItem as CompositeItem } from '@wordpress/components';
import { Icon, plus } from '@wordpress/icons';
import { WorkflowCompositeContext } from './context';
import { AutomationCompositeContext } from './context';
type Props = {
onClick?: (element: HTMLButtonElement) => void;
@ -9,7 +9,7 @@ type Props = {
};
export function AddStepButton({ onClick, previousStepId }: Props): JSX.Element {
const compositeState = useContext(WorkflowCompositeContext);
const compositeState = useContext(AutomationCompositeContext);
return (
<CompositeItem
state={compositeState}

View File

@ -3,7 +3,7 @@ import { __unstableCompositeItem as CompositeItem } from '@wordpress/components'
import { Icon, plus } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';
import { useDispatch } from '@wordpress/data';
import { WorkflowCompositeContext } from './context';
import { AutomationCompositeContext } from './context';
import { Step } from './types';
import { storeName } from '../../store';
@ -12,14 +12,14 @@ type Props = {
};
export function AddTrigger({ step }: Props): JSX.Element {
const compositeState = useContext(WorkflowCompositeContext);
const compositeState = useContext(AutomationCompositeContext);
const { setInserterPopover } = useDispatch(storeName);
return (
<CompositeItem
state={compositeState}
role="treeitem"
className="mailpoet-automation-workflow-add-trigger"
className="mailpoet-automation-add-trigger"
data-previous-step-id={step.id}
focusable
onClick={(event) => {

View File

@ -1,5 +1,5 @@
import { __unstableUseCompositeState as useCompositeState } from '@wordpress/components';
import { createContext } from '@wordpress/element';
export const WorkflowCompositeContext =
export const AutomationCompositeContext =
createContext<ReturnType<typeof useCompositeState>>(undefined);

View File

@ -0,0 +1,9 @@
import { __ } from '@wordpress/i18n';
export function EmptyAutomation(): JSX.Element {
return (
<div className="mailpoet-automation-editor-empty-automation">
{__('No automation data.', 'mailpoet')}
</div>
);
}

View File

@ -7,8 +7,8 @@ import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import { Icon, check } from '@wordpress/icons';
import { Hooks } from 'wp-js-hooks';
import { WorkflowCompositeContext } from './context';
import { EmptyWorkflow } from './empty-workflow';
import { AutomationCompositeContext } from './context';
import { EmptyAutomation } from './empty-automation';
import { Separator } from './separator';
import { Step } from './step';
import { Step as StepData } from './types';
@ -21,10 +21,10 @@ import {
RenderStepType,
} from '../../../types/filters';
export function Workflow(): JSX.Element {
const { workflowData, selectedStep } = useSelect(
export function Automation(): JSX.Element {
const { automationData, selectedStep } = useSelect(
(select) => ({
workflowData: select(storeName).getWorkflowData(),
automationData: select(storeName).getAutomationData(),
selectedStep: select(storeName).getSelectedStep(),
}),
[],
@ -36,9 +36,9 @@ export function Workflow(): JSX.Element {
shift: true,
});
const stepMap = workflowData?.steps ?? undefined;
const stepMap = automationData?.steps ?? undefined;
// serialize steps (for now, we support only one trigger and linear workflows)
// serialize steps (for now, we support only one trigger and linear automations)
const steps = useMemo(() => {
const stepArray = [stepMap.root];
@ -56,7 +56,7 @@ export function Workflow(): JSX.Element {
const renderStep = useMemo(
(): RenderStepType =>
Hooks.applyFilters(
'mailpoet.automation.workflow.render_step',
'mailpoet.automation.render_step',
(stepData: StepData) =>
stepData.type === 'root' ? (
<AddTrigger step={stepData} />
@ -73,7 +73,7 @@ export function Workflow(): JSX.Element {
const renderSeparator = useMemo(
(): RenderStepSeparatorType =>
Hooks.applyFilters(
'mailpoet.automation.workflow.render_step_separator',
'mailpoet.automation.render_step_separator',
(previousStepData: StepData) => (
<Separator previousStepId={previousStepData.id} />
),
@ -81,20 +81,20 @@ export function Workflow(): JSX.Element {
[],
);
if (!workflowData) {
return <EmptyWorkflow />;
if (!automationData) {
return <EmptyAutomation />;
}
return (
<WorkflowCompositeContext.Provider value={compositeState}>
<AutomationCompositeContext.Provider value={compositeState}>
<Composite
state={compositeState}
role="tree"
aria-label={__('Automation', 'mailpoet')}
aria-orientation="vertical"
className="mailpoet-automation-editor-workflow"
className="mailpoet-automation-editor-automation"
>
<div className="mailpoet-automation-editor-workflow-wrapper">
<div className="mailpoet-automation-editor-automation-wrapper">
<Statistics />
{stepMap.root.next_steps.length === 0 ? (
<>
@ -119,13 +119,13 @@ export function Workflow(): JSX.Element {
</Fragment>
))}
<Icon
className="mailpoet-automation-editor-workflow-end"
className="mailpoet-automation-editor-automation-end"
icon={check}
/>
<div />
</div>
<InserterPopover />
</Composite>
</WorkflowCompositeContext.Provider>
</AutomationCompositeContext.Provider>
);
}

View File

@ -4,9 +4,9 @@ import { storeName } from '../../store';
import { Statistics as BaseStatistics } from '../../../components/statistics';
export function Statistics(): JSX.Element {
const { workflow } = useSelect(
const { automation } = useSelect(
(select) => ({
workflow: select(storeName).getWorkflowData(),
automation: select(storeName).getAutomationData(),
}),
[],
);
@ -19,19 +19,19 @@ export function Statistics(): JSX.Element {
key: 'entered',
// translators: Total number of subscribers who entered an automation
label: _x('Total Entered', 'automation stats', 'mailpoet'),
value: workflow.stats.totals.entered,
value: automation.stats.totals.entered,
},
{
key: 'processing',
// translators: Total number of subscribers who are being processed in an automation
label: _x('Total Processing', 'automation stats', 'mailpoet'),
value: workflow.stats.totals.in_progress,
value: automation.stats.totals.in_progress,
},
{
key: 'exited',
// translators: Total number of subscribers who exited an automation, no matter the result
label: _x('Total Exited', 'automation stats', 'mailpoet'),
value: workflow.stats.totals.exited,
value: automation.stats.totals.exited,
},
]}
/>

View File

@ -1,12 +1,10 @@
import { useState, Fragment } from 'react';
import { DropdownMenu } from '@wordpress/components';
import { useSelect } from '@wordpress/data';
import { moreVertical, trash } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';
import { Hooks } from 'wp-js-hooks';
import { PremiumModal } from 'common/premium_modal';
import { Step as StepData } from './types';
import { storeName } from '../../store';
import { StepMoreControlsType } from '../../../types/filters';
type Props = {
@ -14,16 +12,10 @@ type Props = {
};
export function StepMoreMenu({ step }: Props): JSX.Element {
const { stepType } = useSelect(
(select) => ({
stepType: select(storeName).getStepType(step.key),
}),
[step],
);
const [showModal, setShowModal] = useState(false);
const moreControls: StepMoreControlsType = Hooks.applyFilters(
'mailpoet.automation.workflow.step.more-controls',
'mailpoet.automation.step.more-controls',
{
delete: {
key: 'delete',
@ -53,7 +45,6 @@ export function StepMoreMenu({ step }: Props): JSX.Element {
},
},
step,
stepType,
);
const slots = Object.values(moreControls).filter(

View File

@ -4,7 +4,7 @@ import { __unstableCompositeItem as CompositeItem } from '@wordpress/components'
import { useDispatch, useRegistry, useSelect } from '@wordpress/data';
import { blockMeta } from '@wordpress/icons';
import { __, _x } from '@wordpress/i18n';
import { WorkflowCompositeContext } from './context';
import { AutomationCompositeContext } from './context';
import { StepMoreMenu } from './step-more-menu';
import { Step as StepData } from './types';
import { Chip } from '../chip';
@ -48,7 +48,7 @@ export function Step({ step, isSelected }: Props): JSX.Element {
[step],
);
const { openSidebar, selectStep } = useDispatch(storeName);
const compositeState = useContext(WorkflowCompositeContext);
const compositeState = useContext(AutomationCompositeContext);
const { batch } = useRegistry();
const compositeItemId = `step-${step.id}`;

View File

@ -1,4 +1,4 @@
import { WorkflowStatus } from '../../../listing/workflow';
import { AutomationStatus } from '../../../listing/automation';
export type NextStep = {
id: string;
@ -12,10 +12,10 @@ export type Step = {
next_steps: NextStep[];
};
export type Workflow = {
export type Automation = {
id: number;
name: string;
status: WorkflowStatus;
status: AutomationStatus;
created_at: string;
updated_at: string;
activated_at: string;

View File

@ -10,7 +10,7 @@ import { useRef } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { chevronDown } from '@wordpress/icons';
import { storeName } from '../../store';
import { WorkflowStatus } from '../../../listing/workflow';
import { AutomationStatus } from '../../../listing/automation';
// See: https://github.com/WordPress/gutenberg/blob/eff0cab2b3181c004dbd15398e570ecec28a3726/packages/edit-site/src/components/header/document-actions/index.js
@ -21,11 +21,11 @@ const Dropdown: ComponentType<
}
> = WpDropdown;
export function DocumentActions({ children }): JSX.Element {
const { workflowName, workflowStatus, showIconLabels } = useSelect(
function DocumentActions({ children }): JSX.Element {
const { automationName, automationStatus, showIconLabels } = useSelect(
(select) => ({
workflowName: select(storeName).getWorkflowData().name,
workflowStatus: select(storeName).getWorkflowData().status,
automationName: select(storeName).getAutomationData().name,
automationStatus: select(storeName).getAutomationData().status,
showIconLabels: select(storeName).isFeatureActive('showIconLabels'),
}),
[],
@ -36,9 +36,9 @@ export function DocumentActions({ children }): JSX.Element {
const titleRef = useRef();
let chipClass = 'mailpoet-automation-editor-chip-gray';
if (workflowStatus === WorkflowStatus.ACTIVE) {
if (automationStatus === AutomationStatus.ACTIVE) {
chipClass = 'mailpoet-automation-editor-chip-success';
} else if (workflowStatus === WorkflowStatus.DEACTIVATING) {
} else if (automationStatus === AutomationStatus.DEACTIVATING) {
chipClass = 'mailpoet-automation-editor-chip-danger';
}
@ -66,18 +66,18 @@ export function DocumentActions({ children }): JSX.Element {
<VisuallyHidden as="span">
{__('Editing automation:', 'mailpoet')}
</VisuallyHidden>
{workflowName}
{automationName}
</Text>
<Text
size="body"
className={`edit-site-document-actions__secondary-item ${chipClass}`}
>
{workflowStatus === WorkflowStatus.ACTIVE &&
{automationStatus === AutomationStatus.ACTIVE &&
__('Active', 'mailpoet')}
{workflowStatus === WorkflowStatus.DEACTIVATING &&
{automationStatus === AutomationStatus.DEACTIVATING &&
__('Deactivating', 'mailpoet')}
{workflowStatus === WorkflowStatus.DRAFT &&
{automationStatus === AutomationStatus.DRAFT &&
__('Draft', 'mailpoet')}
</Text>
</a>
@ -101,3 +101,6 @@ export function DocumentActions({ children }): JSX.Element {
</div>
);
}
DocumentActions.displayName = 'DocumentActions';
export { DocumentActions };

View File

@ -9,6 +9,7 @@ import {
import { useDispatch, useSelect } from '@wordpress/data';
import { createContext } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { ErrorBoundary } from 'common';
import { Chip } from '../chip';
import { ColoredIcon } from '../icons';
import {
@ -35,17 +36,17 @@ type StepErrorProps = {
function StepError({ stepId }: StepErrorProps): JSX.Element {
const compositeState = useContext(ErrorsCompositeContext);
const { steps, workflowData } = useSelect(
const { steps, automationData } = useSelect(
(select) => ({
steps: select(storeName).getSteps(),
workflowData: select(storeName).getWorkflowData(),
automationData: select(storeName).getAutomationData(),
}),
[],
);
const { openSidebar, selectStep } = useDispatch(storeName);
const stepData = workflowData.steps[stepId];
const stepData = automationData.steps[stepId];
const step = steps.find(({ key }) => key === stepData.key);
return (
@ -70,6 +71,8 @@ function StepError({ stepId }: StepErrorProps): JSX.Element {
);
}
StepError.displayName = 'StepError';
export function Errors(): JSX.Element | null {
const [showPopover, setShowPopover] = useState(false);
@ -78,10 +81,10 @@ export function Errors(): JSX.Element | null {
shift: true,
});
const { errors, workflowData } = useSelect(
const { errors, automationData } = useSelect(
(select) => ({
errors: select(storeName).getErrors(),
workflowData: select(storeName).getWorkflowData(),
automationData: select(storeName).getAutomationData(),
}),
[],
);
@ -93,18 +96,18 @@ export function Errors(): JSX.Element | null {
}
const visited = new Map<string, StepErrorType | undefined>();
const ids = workflowData.steps.root.next_steps.map(({ id }) => id);
const ids = automationData.steps.root.next_steps.map(({ id }) => id);
while (ids.length > 0) {
const id = ids.shift();
if (!visited.has(id)) {
visited.set(id, errors.steps[id]);
workflowData.steps[id]?.next_steps?.forEach((step) =>
automationData.steps[id]?.next_steps?.forEach((step) =>
ids.push(step.id),
);
}
}
return [...visited.values()].filter((error) => !!error);
}, [errors, workflowData]);
}, [errors, automationData]);
// automatically open the popover when errors appear
const hasErrors = stepErrors.length > 0;
@ -160,9 +163,11 @@ export function Errors(): JSX.Element | null {
__('The following steps are not fully set:', 'mailpoet')
}
</div>
{stepErrors.map((error) => (
<StepError key={error.step_id} stepId={error.step_id} />
))}
<ErrorBoundary>
{stepErrors.map((error) => (
<StepError key={error.step_id} stepId={error.step_id} />
))}
</ErrorBoundary>
</Composite>
</ErrorsCompositeContext.Provider>
</Popover>

View File

@ -8,12 +8,13 @@ import {
import { dispatch, useDispatch, useSelect } from '@wordpress/data';
import { PinnedItems } from '@wordpress/interface';
import { __ } from '@wordpress/i18n';
import { ErrorBoundary } from 'common';
import { DocumentActions } from './document_actions';
import { Errors } from './errors';
import { InserterToggle } from './inserter_toggle';
import { MoreMenu } from './more_menu';
import { storeName } from '../../store';
import { WorkflowStatus } from '../../../listing/workflow';
import { AutomationStatus } from '../../../listing/automation';
import {
DeactivateImmediatelyModal,
DeactivateModal,
@ -23,22 +24,23 @@ import {
// https://github.com/WordPress/gutenberg/blob/9601a33e30ba41bac98579c8d822af63dd961488/packages/edit-post/src/components/header/index.js
// https://github.com/WordPress/gutenberg/blob/0ee78b1bbe9c6f3e6df99f3b967132fa12bef77d/packages/edit-site/src/components/header/index.js
function ActivateButton({ onClick, label }): JSX.Element {
function ActivateButton({ label }): JSX.Element {
const { errors, isDeactivating } = useSelect(
(select) => ({
errors: select(storeName).getErrors(),
isDeactivating:
select(storeName).getWorkflowData().status ===
WorkflowStatus.DEACTIVATING,
select(storeName).getAutomationData().status ===
AutomationStatus.DEACTIVATING,
}),
[],
);
const { openActivationPanel } = useDispatch(storeName);
const button = (
<Button
variant="primary"
className="editor-post-publish-button"
onClick={onClick}
onClick={openActivationPanel}
disabled={isDeactivating || !!errors}
>
{label}
@ -53,7 +55,7 @@ function ActivateButton({ onClick, label }): JSX.Element {
// The following error seems to be a mismatch. It claims the 'delay' prop does not exist, but it does.
delay={0}
text={__(
'Editing an active workflow is temporarily unavailable. We are working on introducing this functionality.',
'Editing an active automation is temporarily unavailable. We are working on introducing this functionality.',
'mailpoet',
)}
>
@ -68,14 +70,14 @@ function ActivateButton({ onClick, label }): JSX.Element {
function UpdateButton(): JSX.Element {
const { save } = useDispatch(storeName);
const { workflow } = useSelect(
const { automation } = useSelect(
(select) => ({
workflow: select(storeName).getWorkflowData(),
automation: select(storeName).getAutomationData(),
}),
[],
);
if (workflow.stats.totals.in_progress === 0) {
if (automation.stats.totals.in_progress === 0) {
return (
<Button
variant="primary"
@ -93,7 +95,7 @@ function UpdateButton(): JSX.Element {
// The following error seems to be a mismatch. It claims the 'delay' prop does not exist, but it does.
delay={0}
text={__(
'Editing an active workflow is temporarily unavailable. We are working on introducing this functionality.',
'Editing an active automation is temporarily unavailable. We are working on introducing this functionality.',
'mailpoet',
)}
>
@ -125,7 +127,7 @@ function DeactivateButton(): JSX.Element {
const { hasUsersInProgress } = useSelect(
(select) => ({
hasUsersInProgress:
select(storeName).getWorkflowData().stats.totals.in_progress > 0,
select(storeName).getAutomationData().stats.totals.in_progress > 0,
}),
[],
);
@ -165,7 +167,7 @@ function DeactivateNowButton(): JSX.Element {
const { hasUsersInProgress } = useSelect(
(select) => ({
hasUsersInProgress:
select(storeName).getWorkflowData().stats.totals.in_progress > 0,
select(storeName).getAutomationData().stats.totals.in_progress > 0,
}),
[],
);
@ -201,18 +203,14 @@ function DeactivateNowButton(): JSX.Element {
type Props = {
showInserterToggle: boolean;
toggleActivatePanel: () => void;
};
export function Header({
showInserterToggle,
toggleActivatePanel,
}: Props): JSX.Element {
const { setWorkflowName } = useDispatch(storeName);
const { workflowName, workflowStatus } = useSelect(
export function Header({ showInserterToggle }: Props): JSX.Element {
const { setAutomationName } = useDispatch(storeName);
const { automationName, automationStatus } = useSelect(
(select) => ({
workflowName: select(storeName).getWorkflowData().name,
workflowStatus: select(storeName).getWorkflowData().status,
automationName: select(storeName).getAutomationData().name,
automationStatus: select(storeName).getAutomationData().status,
}),
[],
);
@ -230,50 +228,48 @@ export function Header({
</div>
<div className="edit-site-header_center">
<DocumentActions>
{() => (
<div className="mailpoet-automation-editor-dropdown-name-edit">
<div className="mailpoet-automation-editor-dropdown-name-edit-title">
{__('Automation name', 'mailpoet')}
<ErrorBoundary>
<DocumentActions>
{() => (
<div className="mailpoet-automation-editor-dropdown-name-edit">
<div className="mailpoet-automation-editor-dropdown-name-edit-title">
{__('Automation name', 'mailpoet')}
</div>
<TextControl
value={automationName}
onChange={(newName) => setAutomationName(newName)}
help={__(
`Give the automation a name that indicates its purpose. E.g. "Abandoned cart recovery"`,
'mailpoet',
)}
/>
</div>
<TextControl
value={workflowName}
onChange={(newName) => setWorkflowName(newName)}
help={__(
`Give the automation a name that indicates its purpose. E.g. "Abandoned cart recovery"`,
'mailpoet',
)}
/>
</div>
)}
</DocumentActions>
)}
</DocumentActions>
</ErrorBoundary>
</div>
<div className="edit-site-header_end">
<div className="edit-site-header__actions">
<Errors />
{workflowStatus === WorkflowStatus.DRAFT && (
<ErrorBoundary>
<Errors />
</ErrorBoundary>
{automationStatus === AutomationStatus.DRAFT && (
<>
<SaveDraftButton />
<ActivateButton
onClick={toggleActivatePanel}
label={__('Activate', 'mailpoet')}
/>
<ActivateButton label={__('Activate', 'mailpoet')} />
</>
)}
{workflowStatus === WorkflowStatus.ACTIVE && (
{automationStatus === AutomationStatus.ACTIVE && (
<>
<DeactivateButton />
<UpdateButton />
</>
)}
{workflowStatus === WorkflowStatus.DEACTIVATING && (
{automationStatus === AutomationStatus.DEACTIVATING && (
<>
<DeactivateNowButton />
<ActivateButton
onClick={toggleActivatePanel}
label={__('Update & Activate', 'mailpoet')}
/>
<ActivateButton label={__('Update & Activate', 'mailpoet')} />
</>
)}
<PinnedItems.Slot scope={storeName} />

View File

@ -0,0 +1,2 @@
export * from './panel';
export * from './form-token-field';

Some files were not shown because too many files have changed in this diff Show More