Commit Graph

19799 Commits

Author SHA1 Message Date
John Oleksowicz
933fb27265 Create cron worker for reporting mixpanel data
MAILPOET-5161
2023-10-23 17:40:54 +02:00
John Oleksowicz
c809461322 Remove phpstan exception that no longer triggers
MAILPOET-5161
2023-10-23 17:40:54 +02:00
John Oleksowicz
3e45bca0f9 Make methods public
MAILPOET-5161
2023-10-23 17:40:54 +02:00
John Oleksowicz
010c15013f Extract analytics data generation method
MAILPOET-5161
2023-10-23 17:40:54 +02:00
John Oleksowicz
75b17ba0ba Don't clean newsletter_option_fields table
Option field records are created at plugin activation and some of our
code assumes at least one record will exist.

MAILPOET-5161
2023-10-23 17:40:54 +02:00
John Oleksowicz
95b7163593 Add mixpanel PHP library
I'm adding this unprefixed because the library contains code that
dynamically instantiates objects assuming that certain classes will
exist in the global namespace. If we definitely need to include this
library prefixed we would need to add some custom code to update those
references, and also double check that there are no other places we
might run into similar issues.

MAILPOET-5161
2023-10-23 17:40:54 +02:00
John Oleksowicz
e3a8db7de9 Ensure we're checking file extension
This prevents an error when adding packages whose names end in php

MAILPOET-5161
2023-10-23 17:40:54 +02:00
Jan Jakes
2956012e5b Remove conditions step errors on condition change
[MAILPOET-5587]
2023-10-23 17:09:16 +02:00
Jan Jakes
d9cc8ff80d Render branch badges in analytics
[MAILPOET-5587]
2023-10-23 17:09:16 +02:00
Jan Jakes
69e0ad86be Render branch curve leaves in analytics
[MAILPOET-5587]
2023-10-23 17:09:16 +02:00
Jan Jakes
de5723e416 Turn off drag and scroll handling for analytics rendering
[MAILPOET-5587]
2023-10-23 17:09:16 +02:00
Jan Jakes
62f2d1e773 Add registry subjects to automation analytics
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
3235bd704f Improve naming of filter strings
[MAILPOET-5587]
2023-10-23 17:09:16 +02:00
Jan Jakes
565222cb16 Improve translatability of filters/conditions chip label
[MAILPOET-5587]
2023-10-23 17:09:16 +02:00
Jan Jakes
87d90a44fd Fix error when step type is unknown
[MAILPOET-5587]
2023-10-23 17:09:16 +02:00
Jan Jakes
10d28da84c Implement drag-to-scroll for automation flow
[MAILPOET-5667]
2023-10-23 17:09:16 +02:00
Jan Jakes
412fc16fda Extract automation scroll centering to a custom hook
[MAILPOET-5587]
2023-10-23 17:09:16 +02:00
Jan Jakes
df9e582924 Implement new automation scrolling with simultaneous X and Y scroll support
This fixes horizontal scroll bar appearing only after scrolling till the end vertically.
Allows for simultaneous X and Y axis scrolling on trackpads and touch devices.

[MAILPOET-5587]
2023-10-23 17:09:16 +02:00
Jan Jakes
9e036244c4 Fix if/else step keywords
[MAILPOET-5587]
2023-10-23 17:09:16 +02:00
Jan Jakes
8471ea4caf Remove unnecessary translation function
[MAILPOET-5587]
2023-10-23 17:09:16 +02:00
Jan Jakes
c33da588af Validate that fields in filters are provided by subjects available in the automation
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
0203f6e3a3 Use "drawerRight" icon for editor sidebar (as in recent Gutenberg)
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
617b3fa796 Add badges for if-else branches
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
afb1737280 Fix filters chip not closing on click outside and ESC
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
131ac554af Add if-else step UI
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
002bb2f92a Center automation flow horizontally on first load
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
524298ff41 Implement rendering for multiple automation branches
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
d0726e348e Implement if/else action
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
f55c4f7755 Make next step ID nullable (ability to save multiple edges without next steps)
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
32e5d4f8ac Add check that next step was scheduled when multiple next steps are possible
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
72ce5fb569 Add a possibility to schedule next step by index
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
8720d8881f Remove NoSplitRule to allow for multiple next steps
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
004dc57f75 Fix edge case for NoUnreachableStepsRuleTest
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
Jan Jakes
901427c3d1 Fix edge case for NoJoinRule, simplify logic
[MAILPOET-5586]
2023-10-23 17:09:16 +02:00
John Oleksowicz
4c3ad15444 Move number of orders to correct section
Number of orders is a filter with a type WooCommerce. There is no
userRole filter with the same name.

MAILPOET-5503
2023-10-23 13:01:57 +02:00
John Oleksowicz
71560a032d Add tracking for new segments
MAILPOET-5503
2023-10-23 13:01:57 +02:00
John Oleksowicz
09173d7941 Update tracking for re-engagement/post notifications
MAILPOET-5595
2023-10-23 12:38:01 +02:00
John Oleksowicz
e64daa4aec Update Newsletter sent tracking data
MAILPOET-5595
2023-10-23 12:38:01 +02:00
John Oleksowicz
f81498da5c Track filter segment usage
MAILPOET-5595
2023-10-23 12:38:01 +02:00
alex-mpoet
f28ddabebc Update @babel/traverse
[MAILPOET-5671]
2023-10-20 09:48:51 -03:00
Rodrigo Primo
40f46220aa Fix imports that are causing errors in the premium build
For some unknown reason using the absolute paths in the files changed in
this commit is causing the error below in the premium build. To fix it,
this commit changes the code to use relative paths. I did not
investigate why this error was happening in the first place.

The error started happening when
https://github.com/mailpoet/mailpoet/pull/5213/ was merged.

```
> tsc --noEmit

../mailpoet/assets/js/src/segments/dynamic/dynamic-segments-filters/automation-options.ts:2:29 - error TS2307: Cannot find module 'segments/dynamic/dynamic-segments-filters/sort-filters' or its corresponding type declarations.

2 import { sortFilters } from 'segments/dynamic/dynamic-segments-filters/sort-filters';
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../mailpoet/assets/js/src/segments/dynamic/dynamic-segments-filters/email-options.ts:2:29 - error TS2307: Cannot find module 'segments/dynamic/dynamic-segments-filters/sort-filters' or its corresponding type declarations.

2 import { sortFilters } from 'segments/dynamic/dynamic-segments-filters/sort-filters';
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../mailpoet/assets/js/src/segments/dynamic/dynamic-segments-filters/subscriber-options.ts:2:29 - error TS2307: Cannot find module 'segments/dynamic/dynamic-segments-filters/sort-filters' or its corresponding type declarations.

2 import { sortFilters } from 'segments/dynamic/dynamic-segments-filters/sort-filters';
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../mailpoet/assets/js/src/segments/dynamic/dynamic-segments-filters/woocommerce-options.ts:2:29 - error TS2307: Cannot find module 'segments/dynamic/dynamic-segments-filters/sort-filters.ts' or its corresponding type declarations.

2 import { sortFilters } from 'segments/dynamic/dynamic-segments-filters/sort-filters.ts';
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 4 errors in 4 files.
```

https://app.circleci.com/pipelines/github/mailpoet/mailpoet-premium/2862/workflows/b1fa2ad0-fc50-40df-b278-c6ca709e6ce0/jobs/20223

[MAILPOET-5666]
2023-10-19 21:48:17 +03:00
David Remer
42113cbaed Declare cart_checkout_blocks compatibility
[MAILPOET-5659]
2023-10-19 11:26:04 +02:00
Rodrigo Primo
da521aa289 Update composer dependencies to their latest version
The following packages were updated:

woocommerce/action-scheduler

`composer outdated -D` was used to find packages that need to be updated
and then `composer require` was used to actually update the packages.

[MAILPOET-4392]
2023-10-18 21:51:51 +03:00
Rodrigo Primo
0f38774380 Update composer dev dependencies to their latest version
The following packages were updated:

composer/composer
consolidation/robo
guzzlehttp/guzzle
vlucas/phpdotenv
codeception/verify

`composer outdated -D` was used to find packages that need to be updated
and then `composer require` was used to actually update the packages.

[MAILPOET-4392]
2023-10-18 21:51:51 +03:00
John Oleksowicz
7f82010893 Add comment explaining reasoning for which HTML is allowed in titles
MAILPOET-5632
2023-10-18 14:40:32 +02:00
John Oleksowicz
dae1cb19a8 Use toString instead of html
The content saved to the database already encodes content that needs
encoding, e.g. <script> tags. The problem with pQuery's `html` method is
 it decodes everything. By using toString instead, we should be getting
 the same contents that were saved to the database.

MAILPOET-5632
2023-10-18 14:40:32 +02:00
John Oleksowicz
efc80b0476 Filter out bad HTML in ALC post titles
MAILPOET-5632
2023-10-18 14:40:32 +02:00
Rodrigo Primo
26cf46c3e9 Replace opened segment test with a machine opened segment test
Sorting segments alphabetically in the previous commit uncovered a bug
in AcceptanceTester::selectOptionInReactSelect(). The original test was
calling this method as follows:

$i->selectOptionInReactSelect('opened', '[data-automation-id="select-segment-action"]');

As far as I could check, selectOptionInReactSelect() will match anything
that contains the string `opened`. It was working previously because the
opened segment was the first one to appear on the list of segments. Now
that they are sorted, `machine-opened` started appearing first and the
method call started matching the `machine-opened` segment instead of
`opened`.

I was not able to figure out a quick way to fix this bug and I didn't
want to invest more time in this ticket. So I opted to change the test
to test the machine opened segment. As far as I can see, the idea behind
this test is to check that creating a segment is working fine. So it
should be ok to change the test.

[MAILPOET-5229]
2023-10-18 10:23:02 +02:00
Rodrigo Primo
68e64f168b Fix: make sure filters are ordered alphabetically
This commit makes sure filters are ordered alphabetically per group in
the page to create/edit segments. It uses .sort() to ensure the ordering
happens after the label is translated if the site is using a language
other than English.

It also chnages the order of the filters in the .ts files where they are
defined to match the order in which they are displayed when the site is
in English to make it easier for developers to add new filters and to
find filters when coding.

[MAILPOET-5229]
2023-10-18 10:23:02 +02:00
Rodrigo Primo
0c6c6ca023 Add acceptance test to check welcome wizard when a MSS key is set
[MAILPOET-5547]
2023-10-18 09:39:25 +02:00