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]
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]
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]
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
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]
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]
As for now, we will not load mailpoet admin scripts for MailPoet
and other default variables that are used in MailPoet Layout.
This is to prevent unwanted dependencies on the MailPoet plugin.
[MAILPOET-5637]