Commit Graph

15684 Commits

Author SHA1 Message Date
6896758f13 Add a link to the MailPoet settings page in the page that lists plugins
[MAILPOET-4412]
2022-07-29 14:52:50 +02:00
c4cd053b34 Add inline class to MailPoet notices
The `inline` class is used to prevent moving notice by WP JavaScript (wp-admin/js/common.js) because it can break DOM, and events don't work anymore
[MAILPOET-4510]
2022-07-29 14:26:50 +02:00
8d4799b050 Fix models check conditions in sending queue
[MAILPOET-4511]
2022-07-29 10:33:05 +02:00
da4d72be50 Disable buttons on newsletter send page when newsletter is loading
The buttons were clickable even when newsletter data were not loaded.
This was causing acceptance test and potentially also production errors.
[MAILPOET-4511]
2022-07-29 10:33:05 +02:00
5042cdd15e Refactor fetching newsletter options in SendingQueue using doctrine
[MAILPOET-4511]
2022-07-29 10:33:05 +02:00
3b5d737143 Use WP ClI for setting wp-config.php constants
We experienced issues with replacing constants in wp-config.php using regular expressions.
E.g. it may stop working when new WP release changes default contents of the wp-config.php
Using WP CLI seems to be more reliable way of doing it.
[MAILPOET-4511]
2022-07-29 10:33:05 +02:00
1e1ef12d42 Remove no longer necessary WP CLI fix from acceptance tests
This seems to be already fixed in https://core.trac.wordpress.org/ticket/25239
[MAILPOET-4511]
2022-07-29 10:33:05 +02:00
09160a58ff Replace deprecated NewsletterOptionField::findArray with doctrine code
This commit is a quick fix for deprecation warnings which we get after we deprecated NewsletterOptions
and NewsletterOptionFields models.
We will soon stop using the old Newsletter model completely.
[MAILPOET-4511]
2022-07-29 10:33:05 +02:00
3d4155f6cc Fix setting wp-config.php for acceptance tests
The wp-config properties were not set correctly because there reg exp
that was used in sed was no longer matching the default value.
This was causing e.g. that errors and warnings were not caught by the acceptnace tests.
[MAILPOET-4511]
2022-07-29 10:33:05 +02:00
e53505354a Switch to SVG menu icon for Calypso compatibility
[MAILPOET-4472]
2022-07-27 09:43:42 +02:00
1396a979f5 Fix PHPMailer on WP 5.6 in acceptance tests
[MAILPOET-4481]

Use SMTP in PHPMailer on WP 5.6 because its Docker container
has a misconfigured mail() function (no sendmail or alternative)
2022-07-27 08:50:03 +02:00
6525f3a55c 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-07-27 08:48:44 +02:00
f27326b590 Deprecate models NewsletterOption and NewsletterOptionField
Those models are being deprecated as they are not used anymore in our
codebase.

[MAILPOET-4150]
2022-07-27 08:48:44 +02:00
5985a10c8f 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-07-27 08:48:44 +02:00
3684530056 Replace NewsletterOption and NewsletterOptionField models
This commit repleaces the old NewsletterOption and NewsletterOptionField
models with Doctrine code in several test classes.

[MAILPOET-4150]
2022-07-27 08:48:44 +02:00
81051e8295 Replace all Paris models with Doctrine code in SchedulerTest
[MAILPOET-4150]
2022-07-27 08:48:44 +02:00
22010874b7 Add method to the Newsletter datafactory to set the type to automatic
[MAILPOET-4150]
2022-07-27 08:48:44 +02:00
7d2fa9ff16 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-07-27 08:48:44 +02:00
ae13fcc771 Make sure $metas[] is always set for all subscribers in the foreach loop
See https://github.com/mailpoet/mailpoet/pull/4247#pullrequestreview-1050167548

[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
932512b720 Replace Paris models with Doctrine entities in MetaInfoTest
In the process it was necessary to change the signature of the method
\MailPoet\Mailer\MetaInfo::getNewsletterMetaInfo() to accept a
SubscriberEntity instead of a Subscriber model and also change
\MailPoet\Cron\Workers\SendingQueue\SendingQueue::processQueue() as it
calls getNewsletterMetaInfo().

Doing this was straightforward, but changing the test class for
SendingQueue was a bit more involved. In particular, the test
SendingQueueTest::testItEnforcesExecutionLimitsAfterQueueProcessing().

This test is a bit brittle and was creating Subscriber models without
saving them to the database with invalid statuses and sources. Switching
getNewsletterMetaInfo() to use entities, while
SendingQueue::processQueue() still uses models, meant that it was
necessary to save the subscribers to the database. Because of this, it
was not possible anymore to use invalid statuses and sources, and
thus, the test changed a bit.

[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
f6fbcee0d0 Remove integration test for when subscriber source is null
This test is being removed as the field source of the table
wp_mailpoet_subscribers does not accept a null value. When changing the
test class MetaInfoTest from Paris to Doctrine, there is no easy way to
set subscriber source to null and since it is not possible to store this
value in the database anyway, it seems to me this test is not necessary.

I'm opting to keep the code in MetaInfo that sets `subscriber_source` to
`unknown` if the subscriber source is null
(9f790efbf0/mailpoet/lib/Mailer/MetaInfo.php (L64))
just in case this is still possible in some old databases (which I don't
think is the case).

[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
15de269da0 Replace Paris models with Doctrine entities in LinksTest
[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
2f6dc17228 Replace Paris models with Doctrine entities ShortcodesTest
[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
831fb46c48 Replace Newsletter model with NewsletterEntity in MetaInfoTest
[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
026aa684a5 Replace Paris models with Doctrine entities in WorkerTest
[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
5f0f28a5c2 Remove unused import
[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
ef477bc156 Remove SendingQueue Paris model from ClicksTest
It was not necessary to replace this model, as the tests still passed
without the code that used SendingQueue.

[MAILPOET-4380]
2022-07-26 16:16:47 +02:00
955731eeb5 Replace Paris models with Doctrine entities in FormTest
[MAILPOET-4380]
2022-07-26 16:16:47 +02:00
c141c9ea15 Replace Paris models with Doctrine entities in UnsubscribesTest
[MAILPOET-4380]
2022-07-26 16:16:47 +02:00
27e759b525 Share Node.js Corepack cache in a CI workspace
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
f88ec9bb82 Use rolling ranges for internal workspaces
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
4f7b90bba3 Remove no longer used (and needed) overrides
Now pnpm keeps only a single version of all of these packages:

  webpack@5.73.0
  underscore@1.13.4
  react@17.0.2

To verify, use "pnpm list webpack", "pnpm list underscore", and "pnpm list react".

[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
6faa8e30e1 Use pnpm patch for spectrum-colorpicker deprecated jQuery methods
This patch replaces deprecated jQuery methods in the spectrum-colorpicker dependency.
It can be removed when a fix is included in a package update.
See: https://github.com/bgrins/spectrum/pull/564

[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
4c51001558 Use pnpm patch for parsleyjs deprecated jQuery methods
This patch replaces deprecated jQuery methods in parsleyjs. It can be removed this when
a fix is included in the package update.

Note: deferred.pipe() fix is not implemented yet, see https://github.com/guillaumepotier/Parsley.js/pull/1347

[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
7dfb55e103 Use pnpm patch for backbone.supermodel strict mode fixes
This patch fixes strict mode issues in backbone.supermodel build.

[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
06bd80eb85 Use pnpm patch for @woocommerce/components CSS fix
The style.css of @woocommerce/components contains invalid CSS strings like "(1fr)[2]"
that are not parseable by SASS. This patch fixes them to "1fr [2]" format.

[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
67264710ed Make eslint-config a pnpm workspace
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
2e6248b63b Run scripts using pnpm
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
e2a494e98e Add info about dependencies and PNPM to readme
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
7c373a85ba Add root-level .nvmrc
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
052e175b76 Remove no longer used require
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
2357e7493d Explicitly install used packages
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
89010304da Remove unused Babel plugin configuration
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
dae3080f08 Remove all Babel plugins that are included in @babel/preset-env
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
c41ab7464c Make mailpoet a pnpm workspace
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
c83a3b7d8d Use pnpm in the monorepo root
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
ea996b30a7 Add Node.js version configs for Volta JS tool manager
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
5b154ce26e Update Node.js (so we can use Corepack)
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
30aad243aa Prevent multiline text in subject and preheader textareas
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
ef161311bf Implement save workflow frontend
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00