Commit Graph

16368 Commits

Author SHA1 Message Date
Rodrigo Primo
22010874b7 Add method to the Newsletter datafactory to set the type to automatic
[MAILPOET-4150]
2022-07-27 08:48:44 +02:00
Rodrigo Primo
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
Rodrigo Primo
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
Rodrigo Primo
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
Rodrigo Primo
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
Rodrigo Primo
15de269da0 Replace Paris models with Doctrine entities in LinksTest
[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
Rodrigo Primo
2f6dc17228 Replace Paris models with Doctrine entities ShortcodesTest
[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
Rodrigo Primo
831fb46c48 Replace Newsletter model with NewsletterEntity in MetaInfoTest
[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
Rodrigo Primo
026aa684a5 Replace Paris models with Doctrine entities in WorkerTest
[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
Rodrigo Primo
5f0f28a5c2 Remove unused import
[MAILPOET-4379]
2022-07-27 08:48:15 +02:00
Rodrigo Primo
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
Rodrigo Primo
955731eeb5 Replace Paris models with Doctrine entities in FormTest
[MAILPOET-4380]
2022-07-26 16:16:47 +02:00
Rodrigo Primo
c141c9ea15 Replace Paris models with Doctrine entities in UnsubscribesTest
[MAILPOET-4380]
2022-07-26 16:16:47 +02:00
Jan Jakes
27e759b525 Share Node.js Corepack cache in a CI workspace
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
Jan Jakes
f88ec9bb82 Use rolling ranges for internal workspaces
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
Jan Jakes
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
Jan Jakes
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
Jan Jakes
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
Jan Jakes
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
Jan Jakes
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
Jan Jakes
67264710ed Make eslint-config a pnpm workspace
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
Jan Jakes
2e6248b63b Run scripts using pnpm
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
Jan Jakes
e2a494e98e Add info about dependencies and PNPM to readme
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
Jan Jakes
7c373a85ba Add root-level .nvmrc
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
Jan Jakes
052e175b76 Remove no longer used require
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
Jan Jakes
2357e7493d Explicitly install used packages
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
Jan Jakes
89010304da Remove unused Babel plugin configuration
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
Jan Jakes
dae3080f08 Remove all Babel plugins that are included in @babel/preset-env
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
Jan Jakes
c41ab7464c Make mailpoet a pnpm workspace
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
Jan Jakes
c83a3b7d8d Use pnpm in the monorepo root
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
Jan Jakes
ea996b30a7 Add Node.js version configs for Volta JS tool manager
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
Jan Jakes
5b154ce26e Update Node.js (so we can use Corepack)
[MAILPOET-4485]
2022-07-26 15:45:54 +02:00
Jan Jakes
30aad243aa Prevent multiline text in subject and preheader textareas
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
ef161311bf Implement save workflow frontend
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
7da2d2f7c8 Add basic workflow step saving to workflow update API
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
55fb3f6c82 Add email thumbail component (only frontend at the moment)
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
c44230b49f Extract button modifications to a component exending @wordpress/components
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
e2db0542ff Do not crash when an unknown step is selected
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
8aab1708c1 Keep selected step highlighted (as post editor does with blocks)
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
d998e48b62 Hide debug info folded in a panel body
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
c484514d88 Save step args into editor store
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
569df2be9c Use registered blocks in block inserter
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
03bc8cee03 Add basic email content sidebar section
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
b313c74901 Add email settings to step sidebar
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
bc502d8046 Add panel body title component with action button
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
47ccae2e6b Add mailpoet integration client setup with send email step
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
0fcef3c209 Add step editation rendering to step sidebar
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
4e9acb524d Add step card component and render it in step sidebar
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
4406d72980 Add functionality to register step types in automation editor
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00
Jan Jakes
664594d1bd Extract store functionality out of index file (avoids dep cycles)
[MAILPOET-4420]
2022-07-26 15:10:05 +02:00