Commit Graph

16408 Commits

Author SHA1 Message Date
Rodrigo Primo
f21c47528e Use findBy() instead of getReference() to get segment entities
Initially, I had opted to use getReference() to avoid querying the
database to get the segment entities as all we need is the segment ID.
But I hadn't realized that this could cause problems if a segment that
is saved in the settings in the option woocommerce.segments is deleted.
Using findBy() here protects against this problem as, if the segment
doesn't exist anymore, it won't be returned.

[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Rodrigo Primo
6bf36d4211 Make sure the subscriber_segment table is truncated
This is necessary while
https://mailpoet.atlassian.net/browse/MAILPOET-4580. Without this
change, leaving entries in wp_mailpoet_subscriber_segment has the
potential to interfere with other tests as it happened in the test added
for the ticket MAILPOET-4365:

https://app.circleci.com/pipelines/github/mailpoet/mailpoet/11041/workflows/8cca6607-2e24-4529-a8ad-cf9a0c663180/jobs/191334/tests#failed-test-0

See MAILPOET-4580 for more details.

[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Rodrigo Primo
5610295e7a Replace SubscriberSegment model with Doctrine code in Subscription
[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Rodrigo Primo
a428e16a09 Replace remaining uses of the Segment model with Doctrine in Subscription
[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Rodrigo Primo
d73e217eb1 Replace Paris models with Doctrine entities in Subscription::subscribeOnCheckout()
Besides Subscription::subscribeOnCheckout(), this commit also replaces
Paris models with Doctrine entities in all the methods that are called
by Subscription::subscribeOnCheckout().

[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Rodrigo Primo
fa1f88c86a Use getServiceWithOverrides() to instantiated tested class
Doing this instead of calling the constructor of the class directly to
avoid having to update the test class whenever there is a change to the
constructor of the tested class.

[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Rodrigo Primo
de6a0b4790 Add method to get segments that a subscriber is subscribed to
[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Rodrigo Primo
24f55fdebc Use SubscriberEntity instead of the Subscriber model to get statuses
[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Rodrigo Primo
b225c22217 Replace Paris models with Doctrine entities in WooCommerceBlocksIntegration
[MAILPOET-4365]
2022-09-19 13:35:39 +02:00
Jan Lysý
6989bd9413 Make limit parameter optional
Unification function parameters with a similar method from the repository.
[MAILPOET-4367]
2022-09-19 11:07:16 +02:00
Jan Lysý
1a65e815b4 Add integration test for findScheduledSendingTasks
[MAILPOET-4367]
2022-09-19 11:07:16 +02:00
Jan Lysý
bc8be524fb Use ScheduledTaskEntity instead of Sending
[MAILPOET-4367]
2022-09-19 11:07:16 +02:00
Jan Lysý
cb4fabad4a Remove the Sending::getScheduledQueues() method
[MAILPOET-4367]
2022-09-19 11:07:16 +02:00
Jan Lysý
97801cfe25 Remove usage of Sending::getScheduledQueues
[MAILPOET-4367]
2022-09-19 11:07:16 +02:00
Jan Lysý
9e7a3c2767 Add method for finding scheduled tasks
[MAILPOET-4367]
2022-09-19 11:07:16 +02:00
Jan Lysý
abfab0b0ea Use currentTimme from WP
[MAILPOET-4367]
2022-09-19 11:07:16 +02:00
Jan Lysý
71635f9520 Add removing tags when subscriber is deleted
[MAILPOET-4558]
2022-09-15 11:26:10 +02:00
Jan Lysý
daa5575d87 Reduce maximum records count in batch to exact size
[MAILPOET-4558]
2022-09-15 11:26:10 +02:00
Jan Lysý
2364db4834 Use tags from MailPoet object instead of window
[MAILPOET-4558]
2022-09-15 11:26:10 +02:00
Jan Lysý
5733bdcb42 Extend acceptance test with importing tags
[MAILPOET-4558]
2022-09-15 11:26:10 +02:00
Jan Lysý
d76d4e95b8 Hide label for tokenField and add placeholder
[MAILPOET-4558]
2022-09-15 11:26:10 +02:00
Jan Lysý
ba81018a9d Add test for tagging imported subscribers
[MAILPOET-4558]
2022-09-15 11:26:10 +02:00
Jan Lysý
5c57dd2006 Add saving tags for imported subscribers
[MAILPOET-4558]
2022-09-15 11:26:10 +02:00
Jan Lysý
a523bb493f Add a token field with tags to the import form
[MAILPOET-4558]
2022-09-15 11:26:10 +02:00
Jan Lysý
a89d8afc34 Use property subscriberTags instead of string
[MAILPOET-4564]
2022-09-15 10:17:35 +02:00
Jan Lysý
6a88bf04f2 Extend tags component by subscriber tags filtering
[MAILPOET-4564]
2022-09-15 10:17:35 +02:00
Jan Lysý
9187e1118a Add dot at the end of the sentence
[MAILPOET-4506]
2022-09-15 09:35:50 +02:00
Jan Lysý
5e18de4921 Unify error messages in the sending step
[MAILPOET-4506]
2022-09-15 09:35:50 +02:00
Jan Lysý
856b20a4d1 Disable subscribers count validation for draft
[MAILPOET-4506]
2022-09-15 09:35:50 +02:00
Jan Lysý
7ebb1a0b13 Change validation that at least one segment with subscribers is enough
[MAILPOET-4506]
2022-09-15 09:35:50 +02:00
Jan Lysý
40d77bc88f Add parsley custom validator for segments
[MAILPOET-4506]
2022-09-15 09:35:50 +02:00
Jan Lysý
83413e4fe5 Unify error message for unauthorized email
[MAILPOET-4506]
2022-09-15 09:35:50 +02:00
Jan Lysý
bf5fbf0b58 Improve form styles for parsley errors
[MAILPOET-4506]
2022-09-15 09:35:50 +02:00
Jan Lysý
9e607f41ec Disable auto-close for error messages
[MAILPOET-4506]
2022-09-15 09:35:50 +02:00
David Remer
c9c48aae1e Do not import @wordpress/components
They are already imported in mailpoet-plugin.scss

[MAILPOET-4355]
2022-09-15 08:08:07 +02:00
David Remer
b237503883 Do not enqueue wp-components styles
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00
David Remer
5d5e7d76e5 Use mapper function to return workflow data
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00
David Remer
339cba3c42 Throw InvalidStateException when workflow is not found
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00
David Remer
a07052c834 Use automation prefix for classNames
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00
David Remer
0748e64ac0 Make 'From scratch' button secondary
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00
David Remer
227b0a9b81 Activate mailpoet-automation submenu
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00
David Remer
eb5b21410e Link automation templates
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00
David Remer
32f5e3873e Expose @wordpress/url and @wordpress/i18n
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00
David Remer
7803b7938f Add FromScratchListItem
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00
David Remer
a05da8adad Adjust layout of templates listing
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00
David Remer
31a5c20af8 Add TopBar with Beamer
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00
David Remer
6a9e8abb88 Add template listing functionality
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00
David Remer
9f24579155 Add template listing page
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00
David Remer
6da06c2e5e Add URL to the automation editor to access in JS
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00
David Remer
1591700e71 Return created workflow with ID when using create-from-template endpoint
[MAILPOET-4533]
2022-09-15 08:08:07 +02:00