Commit Graph

15254 Commits

Author SHA1 Message Date
Rodrigo Primo
c1bd52b964 Add code to display the invisible ReCaptcha in the frontend
This commit adds the required code to display the invisible ReCaptcha in
the frontend when a form is rendered and this type of captcha is
selected in the admin.

[MAILPOET-4145]
2022-05-19 09:22:30 +02:00
Rodrigo Primo
84e22b82bd Move functions to the top in preparation for subsequent change
This commit simply moves four functions to the top of the public.jsx
file to satisfy the no-use-before-define ESLint rule. This is necessary
for some changes that will be implemented in a subsequent commit to
add support for the invisible ReCaptacha. I'm doing them in a separate
commit to make the review process easier.

[MAILPOET-4145]
2022-05-19 09:22:30 +02:00
Rodrigo Primo
fe8d47de0a Add option to the admin to use ReCaptcha v2 Invisible
This commit adds a new option to let users select ReCaptcha v2 Invisible
when using a captcha in the forms. Before we supported only ReCaptcha
v2 Checkbox.

It introduces a new option to the Advanced settings screen where users
can enter the keys for this type of ReCaptcha. Support for rendering
this type of captch in the frontend will be added in a future commit.

[MAILPOET-4145]
2022-05-19 09:22:30 +02:00
Sam Najian
77d46d9a1b Remove memory limit when building translations 2022-05-18 15:27:29 +02:00
Sam Najian
e4886cf812 Update Doctrine before running tests
[MAILPOET-4251]
2022-05-17 14:17:26 +02:00
Sam Najian
17de7fd186 Adjust do script the root to run tests correctly
[MAILPOET-4251]
2022-05-17 14:17:26 +02:00
Sam Najian
3af20cc3ce Disable captcha when running acceptance tests
[MAILPOET-4251]
2022-05-17 14:17:26 +02:00
Sam Najian
69a82a0213 Fix issue with collation conflict failing the tests
If the default collation of database would vary from the one
from created tables it would cause the temp table created to
have a different collation than the main tables

[MAILPOET-4251]
2022-05-17 14:17:26 +02:00
Sam Najian
b69b50f5d6 Enable Xdebug for integration tests
[MAILPOET-4251]
2022-05-17 14:17:26 +02:00
Sam Najian
51fe5c58d4 Switch integrationtests to run use machine on CircleCi
[MAILPOET-4251]
2022-05-17 14:17:26 +02:00
Sam Najian
7f113ab5b3 Correctly check for MU install for running MU specific test
[MAILPOET-4251]
2022-05-17 14:17:26 +02:00
Sam Najian
4040f216ee Enable sending email for local integration tests
[MAILPOET-4251]
2022-05-17 14:17:26 +02:00
Sam Najian
db4ef57b2e Fix failing test in AutomatedLatestContentTest
[MAILPOET-4251]
2022-05-17 14:17:26 +02:00
Sam Najian
393154e080 Adjust used Docker container to run integration tests
[MAILPOET-4251]
2022-05-17 14:17:26 +02:00
Sam Najian
631640c4ea Make form iframe resizing cross-origin compatible
[MAILPOET-3655]
2022-05-17 14:16:45 +02:00
Sam Najian
7bfbbf7852 Release 3.89.1 2022-05-17 13:48:29 +02:00
David Remer
cac83393ab Revert "Remove integration tests for deprecated models"
This reverts commit 49e3d958d9.
2022-05-17 12:27:46 +02:00
David Remer
64c184de9e Revert "Deprecate models NewsletterOption and NewsletterOptionField"
This reverts commit 5fc426e18a.
2022-05-17 12:27:46 +02:00
David Remer
74e59e5f96 Revert "Deprecate some unused Models\Newsletter methods"
This reverts commit 1c70f2ccff.
2022-05-17 12:27:46 +02:00
David Remer
fce14358bf Revert "Replace NewsletterOption and NewsletterOptionField models"
This reverts commit 9b087f719f.
2022-05-17 12:27:46 +02:00
David Remer
46ebe847be Revert "Replace all Paris models with Doctrine code in SchedulerTest"
This reverts commit 54e2d173c1.
2022-05-17 12:27:46 +02:00
David Remer
a2053158a4 Revert "Add new data factory to create NewsletterOption entities in the tests"
This reverts commit caab02cd88.
2022-05-17 12:27:46 +02:00
David Remer
08d025eea5 Revert "Add method to the Newsletter datafactory to set the type to automatic"
This reverts commit 0ebc92d7da.
2022-05-17 12:27:46 +02:00
David Remer
69c2df9e49 Revert "Use Doctrine entities and truncate only what is used in SubscriberTest"
This reverts commit bcd33de9ed.
2022-05-17 12:27:46 +02:00
Rodrigo Primo
2a5a68a110 Remove integration tests for deprecated models
This commit removes the integration tests for the models
NewsletterOptionField and NewsletterOption as they have been deprecated.

[MAILPOET-4150]
2022-05-16 13:18:21 +02:00
Rodrigo Primo
725b7b0bf5 Deprecate models NewsletterOption and NewsletterOptionField
Those models are being deprecated as they are not used anymore in our
codebase.

[MAILPOET-4150]
2022-05-16 13:18:21 +02:00
Rodrigo Primo
73aa081876 Deprecate some unused Models\Newsletter methods
This commit deprecates the following Models\Newsletter methods:

- \MailPoet\Models\Newsletter::filterType()
- \MailPoet\Models\Newsletter::getWelcomeNotificationsForSegments()
- \MailPoet\Models\Newsletter::duplicate()

I'm doing this as part of a ticket to replace the models
NewsletterOption and NewsletterOptionField with Doctrine code. The
methods deprecated here use those models. But since they are not used
anymore in our codebase, I figured it would be easier to deprecate them
instead of replacing the models.

[MAILPOET-4150]
2022-05-16 13:18:21 +02:00
Rodrigo Primo
d89067854c Replace NewsletterOption and NewsletterOptionField models
This commit repleaces the old NewsletterOption and NewsletterOptionField
models with Doctrine code in several test classes.

[MAILPOET-4150]
2022-05-16 13:18:21 +02:00
Rodrigo Primo
f48bb5758c Replace all Paris models with Doctrine code in SchedulerTest
[MAILPOET-4150]
2022-05-16 13:18:21 +02:00
Rodrigo Primo
9b525a14b4 Add new data factory to create NewsletterOption entities in the tests
[MAILPOET-4150]
2022-05-16 13:18:21 +02:00
Rodrigo Primo
5ccd43e336 Add method to the Newsletter datafactory to set the type to automatic
[MAILPOET-4150]
2022-05-16 13:18:21 +02:00
Rodrigo Primo
dc65d0f70c Use Doctrine entities and truncate only what is used in SubscriberTest
This commit replaces old Paris code with Doctrine entities in
SubscriberTest::_after() and it also truncate only the entities that are
actually used inside the test class. Before this change, the class was
unnecessarily truncating entities that were not used. I'm doing this
commit as part of task to remove all usages of the old NewsletterOption
model and that is why I'm not touching the remaining models in other
methods of this class.

[MAILPOET-4150]
2022-05-16 13:18:21 +02:00
Jan Lysý
ba99d331f1 Remove duplicated code
[MAILPOET-4209]
2022-05-16 13:15:59 +02:00
Jan Lysý
81bfbd5bf4 Add autocomplete attribute for text inputs in forms
[MAILPOET-4284]
2022-05-16 13:15:59 +02:00
Rodrigo Primo
cf2a0eb5cc Get the list of tables to truncate when running tests dynamically
While removing some deprecated models in the commit
a525b96f16, I noticed that we maintain a
list of tables that needs to be truncated before running the integration
tests. To make it easier when removing future models and to make sure
the list of tables is always updated, in this commit, I'm removing the
manual list and changing the code to dynamically get the tables and
truncate them.

The code that I removed from _bootstrap.php, meant that PHPStan error
was not present anymore, so it was possible to update its baseline files
to remove the ignores for that error.

[MAILPOET-4325]
2022-05-16 11:33:00 +02:00
Rodrigo Primo
01f0585400 Remove three Paris models that have been deprecated over six months ago
This commit removes the models Form, NewsletterLink and
StatisticsUnsubscribes as they were deprecated over six months ago and
are not used anymore in our codebase.

[MAILPOET-4325]
2022-05-16 11:33:00 +02:00
David Remer
8c7097df85 Add / when generating the Iframe URL
[MAILPOET-4337]
2022-05-16 11:31:39 +02:00
John Oleksowicz
780dd7f609 Use data factory for test newsletter
MAILPOET-4236
2022-05-16 11:17:29 +02:00
John Oleksowicz
0159418251 Remove unnecessarily specific test
This case is handled in the newsletter validator's integration tests

MAILPOET-4236
2022-05-16 11:17:29 +02:00
John Oleksowicz
115fe9c511 Make test more generic
We already have a specific test for the newsletter validator to check
for the missing unsubscribe link case. All we really care about for the
sending queue is that it rejects newsletters that are considered invalid
 for any reason.

MAILPOET-4236
2022-05-16 11:17:29 +02:00
John Oleksowicz
702d00c6e4 Refactor to use service override helper
MAILPOET-4236
2022-05-16 11:17:29 +02:00
John Oleksowicz
c98f3bba29 Refactor mock service creation to use new helper
MAILPOET-4236
2022-05-16 11:17:29 +02:00
John Oleksowicz
ab609c8867 Remove subscriber check from newsletter validator
Checking the subscriber limit has nothing to do with the newsletter
itself, so it makes more sense to continue to perform that check as
needed elsewhere in the codebase.

MAILPOET-4236
2022-05-16 11:17:29 +02:00
John Oleksowicz
73c023449b Use simpler method for overriding DI properties
MAILPOET-4236
2022-05-16 11:17:29 +02:00
John Oleksowicz
42b95d5b72 Ensure strings will still be picked up for translation
MAILPOET-4236
2022-05-16 11:17:29 +02:00
John Oleksowicz
8983d5e3f7 Move subscriber limit check into validator
[MAILPOET-4236]
2022-05-16 11:17:29 +02:00
John Oleksowicz
9bfe2b2ca1 Newsletter validation updates
- Rename validator to newsletterValidator for clarity
- Add validation for ALC content
- Refactor tests to use data factory for consistency and to avoid
validation issues
- Add separate tests for NewsletterValidator service
- Add test helper for retrieving service with private properties
overridden by name

[MAILPOET-4236]
2022-05-16 11:17:29 +02:00
John Oleksowicz
a5103f9596 Move reengagement validations into validator
[MAILPOET-4236]
2022-05-16 11:17:29 +02:00
John Oleksowicz
27a86d2ca6 Check validity on activating newsletters
This prevents users from activating automatic emails from listing pages
that are not valid.

This also adds more checks for the content of a newsletter, requiring
that a newsletter have at least one content block in order to be valid.
This change makes the server side validation check match what we're
checking in the editor in mailpoet/assets/js/src/newsletter_editor
/components/save.js and mailpoet/assets/js/src/newsletters/send.jsx

[MAILPOET-4236]
2022-05-16 11:17:29 +02:00
John Oleksowicz
fdaf22d46b Extract newsletter validation to a service
[MAILPOET-4236]
2022-05-16 11:17:29 +02:00