Commit Graph

15969 Commits

Author SHA1 Message Date
Jan Jakes
10c397d3e5 Add automation editor React setup
[MAILPOET-4287]
2022-05-19 10:09:05 +02:00
Jan Jakes
ed4fea6afa Add send welcome email action to the testing workflow
[MAILPOET-4287]
2022-05-19 10:09:05 +02:00
Jan Jakes
30d3a9250c Install @wordpress/a11y explicitly, add @types/wordpress__a11y
[MAILPOET-4287]
2022-05-19 10:09:05 +02:00
Jan Jakes
d63a8bfd83 Install @wordpress/preferences explicitly
[MAILPOET-4287]
2022-05-19 10:09:05 +02:00
Jan Jakes
4fc1af1f56 Install @wordpress/interface explicitly
[MAILPOET-4287]
2022-05-19 10:09:05 +02:00
Jan Jakes
2c18b851e4 Add automation editor page
[MAILPOET-4287]
2022-05-19 10:09:05 +02:00
Jan Jakes
2584864228 Display a list of workflows on automation page
[MAILPOET-4287]
2022-05-19 10:09:05 +02:00
Jan Jakes
3660d12dd0 Return workflow list data in workflows endpoint
[MAILPOET-4287]
2022-05-19 10:09:05 +02:00
Jan Jakes
47c5111996 Add method to fetch list of workflows to workflow storage
[MAILPOET-4287]
2022-05-19 10:09:05 +02:00
Jan Jakes
1b46765f47 Fix workflow date loading
[MAILPOET-4287]
2022-05-19 10:09:05 +02:00
Rodrigo Primo
a6724a41c0 Fix: invisible ReCaptcha works when there are multiple forms in the page
There was a bug in the code that handles the invisible ReCaptcha that
was preventing the forms from working when this setting is activated and
the user submits a form that is not the first form on the page.

The code that calls the ReCaptcha API when the invisible ReCaptcha is
used was not passing the ID of the ReCaptcha instance. This meant that
for all the forms, ReCaptcha would call the callback associated with the
first form. That is why the other forms were not working.

The fix was simply making sure we pass the ReCaptcha ID when we call
grecaptcha.execute().

[MAILPOET-4145]
2022-05-19 09:22:30 +02:00
Rodrigo Primo
f75ed915fb Reset the ReCaptcha when there is an error
This commit makes sure we reset the ReCaptcha when there is an error so
that the form continues to work and that the user can fix the error and
submit the form again. This was affecting only the invisible ReCaptcha.

For more information on the problem that is fixed by this commit, see
https://github.com/mailpoet/mailpoet/pull/4084#pullrequestreview-959001922

[MAILPOET-4145]
2022-05-19 09:22:30 +02:00
Rodrigo Primo
02adf6adc9 Only display ReCaptcha sign up link if ReCaptcha is selected
This commit changes the logic to display the link to sign up for
ReCaptcha API keys in the advanced settings page. Before the link was always
visible, now it will be visible only if one of the two supported
ReCaptcha checks are selected.

[MAILPOET-4145]
2022-05-19 09:22:30 +02:00
Rodrigo Primo
ba47f0b854 Rename variables to make the ReCaptcha code easier to understand
This commit renames two variables to make it easier to understand the
code responsible for adding a ReCapcha to a subscription form:

formData.recaptcha -> formData.recaptchaWidgetId
formData.data.recaptcha -> formData.data.recaptchaResponseToken

Before this change it was harder to understand the difference between
formData.recaptcha and formData.data.recaptcha since they used the same
name.

[MAILPOET-4145]
2022-05-19 09:22:30 +02:00
Rodrigo Primo
909e59ca1f Fix jQuery selectors for the invisible ReCaptcha
The original code that added suport for the invisible ReCaptcha assumed
an HTML structure for all the subscription forms that was invalid.
Different forms can have slightly different HTML structures. This meant
that the original code worked for some forms, but not for others.

This commit changes the jQuery selectors needed for the invisible
ReCaptcha to work to be more lenient (to search for a given element
in more than one level in the DOM tree) and to function on different
HTML structures.

[MAILPOET-4145]
2022-05-19 09:22:30 +02:00
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