Commit Graph

16613 Commits

Author SHA1 Message Date
368878c280 Simplify testItSeparatesWorkflowRunsCorrectly test
[MAILPOET-4673]
2022-10-12 10:24:58 +02:00
86c3d14af4 Fix typo
[MAILPOET-4673]
2022-10-12 10:24:58 +02:00
05a052ec08 Remove extra line break
[MAILPOET-4673]
2022-10-12 10:24:58 +02:00
ff9f5d304e Return statistics of Workflow
[MAILPOET-4673]
2022-10-12 10:24:58 +02:00
c73d242c5d Style statistics
[MAILPOET-4673]
2022-10-12 10:24:58 +02:00
4eb859154d Show statistics on listing page
[MAILPOET-4673]
2022-10-12 10:24:58 +02:00
3c2d8266e4 Add statistics to editor
[MAILPOET-4673]
2022-10-12 10:24:58 +02:00
c66c5d7bd0 Extend Workflow type definition
[MAILPOET-4673]
2022-10-12 10:24:58 +02:00
96ade7327e Provide statistics via endpoint and admin page
[MAILPOET-4673]
2022-10-12 10:24:58 +02:00
52dcba8493 Introduce WorkflowStatistics entity
[MAILPOET-4673]
2022-10-12 10:24:58 +02:00
f65d343950 Fix hasUnsavedChanges when user clicks "or Cancel" button
When the `or Cancel` button is clicked, the action `SET_SETTING` is not
triggered and thus `hasUnsavedChanges` was not updated resulting in
problems like the one described here:
https://github.com/mailpoet/mailpoet/pull/4315#issuecomment-1273013496.

This commit fixes this problem by updating `hasUnsavedChanges` also when
the action `SET_SETTINGS` (not the `s` at the end) is triggered.

[MAILPOET-4499]
2022-10-12 09:18:06 +02:00
dd51970a43 Simplify logic to decide if there were changes in settings page
[MAILPOET-4499]
2022-10-12 09:18:06 +02:00
1279eeb706 Don't show message if the value of the settings didn't change
This commit improves the code that decides whether or not to display a
confirmation message when the user tries to leave the settings pages
with unsaved changes. Before this commit, the confirmation message would
be displayed even if the user changed the settings a few times and then
back to the original value. Now, this won't happen anymore.

When the page is loaded, we save the original state of data in a
different property called `originalData` and use it to compare against
the current data when deciding whether or not the page has unsaved
changes.

I considered storing just a hash of the original data and using that for
the comparison, but I couldn't find an easy way to generate a hash of an
object in JS.

[MAILPOET-4499]
2022-10-12 09:18:06 +02:00
859251280e Update tests to account for modal displayed when saving settings
This commit updates a few acceptance tests to make sure they work with
the new modal that was added when the user tries to leave the settings
page before waiting for the save process to finish.

[MAILPOET-4499]
2022-10-12 09:18:06 +02:00
171c015afe Dispatch SAVE_DONE when users save a new sender address in modal
This is needed to make sure that hasUnsavedChanges is set back to false
after the modal sets it to true due to a call to SET_SETTING.

[MAILPOET-4499]
2022-10-12 09:18:06 +02:00
de0712d572 Yield SAVE_DONE when the user clicks on the Verify button
This is necessary to set state.save.hasUnsavedChanges to false when the
user clicks on the Verify button as this call triggers a call to
SET_SETTING that sets state.save.hasUnsavedChanges to true.

[MAILPOET-4499]
2022-10-12 09:18:06 +02:00
743d4fa252 Move state.hasUnsavedChanges to state.save.hasUnsavedChanges
Doing this to avoid poluting the root of the state.

[MAILPOET-4499]
2022-10-12 09:18:06 +02:00
91749da2db Use absolute paths instead of relative paths for imports
As per the convention that we use and that I was told about during code
review.

[MAILPOET-4499]
2022-10-12 09:18:06 +02:00
96db5dea76 Prevent the user leaving the settings page without saving
This commit display a confirmation modal when the user tries to leave
the settings page and there are unsaved changes or saving is current in
progress. It uses the same React component that is used for form editor.

[MAILPOET-4499]
2022-10-12 09:18:06 +02:00
a617384005 Move UnsavedChangesNotice component to the common directory
Doing this to be able to reuse this component outside of the form
editor. It will be used in the settings page as well.

[MAILPOET-4499]
2022-10-12 09:18:06 +02:00
ff8e23eeb5 Release 3.100.2 2022-10-11 09:04:04 -05:00
caf3160060 Remove 'email_id' property
[MAILPOET-4520]
2022-10-11 11:14:58 +02:00
60a52dfa5b Introduce EditNewsletter component
The previous logic could not reliably redirect to the template selection
and was showing the 'Edit newsletter' buttons to early in the process. The
logic which decides on what buttons to show have now been bundled in a
single EditNewsletter component

[MAILPOET-4520]
2022-10-11 11:14:58 +02:00
b657a1eee0 Account for email_id being 0
[MAILPOET-4520]
2022-10-11 11:14:58 +02:00
4c30ffcaf1 Remove logic from TutorialIcon component
[MAILPOET-4520]
2022-10-11 11:14:58 +02:00
bd12d23a4f Delete newsletter entity
[MAILPOET-4520]
2022-10-11 11:14:58 +02:00
b7e80b60ab Disconnect empty emails before workflow loads
[MAILPOET-4520]
2022-10-11 11:14:58 +02:00
ad6f457861 Introduce hook before editor loads
[MAILPOET-4520]
2022-10-11 11:14:58 +02:00
5b35cf84aa Remove Cancel button in newsletter editor
[MAILPOET-4520]
2022-10-11 11:14:58 +02:00
e9ecea5605 Switch <div> to <span> to prevent error
div elements should not be children of paragraphs

[MAILPOET-4520]
2022-10-11 11:14:58 +02:00
0975365711 Redirect to template page when creating automation email
[MAILPOET-4520]
2022-10-11 11:14:58 +02:00
5adb34a6c0 Redirect logo on template page and newsletter editor
[MAILPOET-4520]
2022-10-11 11:14:58 +02:00
9134005d30 Add optional prop for onClick action
[MAILPOET-4520]
2022-10-11 11:14:58 +02:00
83bc9d8089 Hide tutorial when email is of type automation
[MAILPOET-4520]
2022-10-11 11:14:58 +02:00
7521dbd1ef Update Woo COT build in test to the latest version
The latest version is 7.0.0-hpos.dev.7

[MAILPOET-4691]
2022-10-11 07:23:37 +02:00
bb04935f29 Add repository to testee
[MAILPOET-4708]
2022-10-10 17:13:17 +02:00
522629eeff Update other instances where SendingTask and Entity get out of sync
[MAILPOET-4708]
2022-10-10 17:13:17 +02:00
2298b5b061 Be more restrictive when deleting a queue task
getNewsletterFromQueue() has too many conditions under which it returns null. Therefore we can not rely on that method when we wont to delete running tasks with no associated newsletter.
[MAILPOET-4708]
2022-10-10 17:13:17 +02:00
94da004454 Refresh newsletterEntity and taskEntity.
We need to refresh those, because the database values have
changed and Doctrine needs to clear its internal cache.

[MAILPOET-4708]
2022-10-10 17:13:17 +02:00
0a3431b7da Add simple mixpanel data for automations
[MAILPOET-4535]
2022-10-10 09:53:42 +02:00
50b18834d2 Adapt query to get registered customers to work with custom orders tables
[MAILPOET-4569]
2022-10-10 09:21:38 +02:00
e3cf1a047b Adapt query to get guest customers to work with custom orders tables
[MAILPOET-4569]
2022-10-10 09:21:38 +02:00
f2ab875bd9 Skip WooCommerce Subscriptions integration tests when Woo COT is enabled
WooCommerce Subscriptions doesn't support WooCommerce Custom Orders
Tables, so we should skip the WooCommerce Subscriptions related tests
when Woo COT is enabled.

[MAILPOET-4695]
2022-10-07 18:31:10 +02:00
b0aacdd4ef Release 3.100.1 2022-10-06 15:37:24 +03:00
c4c94c2db0 Change the way getName() is called to get rid of a PHPStan error
[MAILPOET-4695]
2022-10-06 12:16:47 +02:00
7cb6609faa Skip WooCommerce Subscriptions test when Woo COT is enabled
Currently, WooCommerce Subscriptions doesn't support WooCommerce Custom
Orders Table, so we want to skip all WooCommerce Subscriptions related
tests when Woo COT is enabled.

[MAILPOET-4695]
2022-10-06 12:16:47 +02:00
ef8bc9250a Change codeception extension to catch skipped tests
This commit changes the Codeception extension CheckSkippedTestsExtension
that we use to generate an error when tests are skipped in the `trunk` and
`release` branches. Now this extension accepts a list of tests that can
be skipped in those two branches. This will be necessary as part of the
project to support WooCommerce Custom Orders Tables as in some scenarios
we want to skip WooCommerce Subscriptions tests and in some we don't.
For now, WooCommerce Subscrptions doesn't support Woo COT, so we want to
run Woo Subscriptions tests when COT is disabled, but we want to skip
then when COT is enabled.

The main change is that now we are using the `TEST_SKIPPED` Codeception event
instead of the `SUITE_AFTER` event. This change was necessary as in the
latter event we don't have any information about the tests that were
skipped.

[MAILPOET-4695]
2022-10-06 12:16:47 +02:00
307989a0c6 Delete task when no newsletter was found
When no corresponding newsletter was found the task can be deleted. The behavior
before meant that such a task would remain forever in the database with the
status 'running'.

[MAILPOET-4699]
2022-10-06 12:06:13 +02:00
357dede83d Allow newsletter_id to be NULL in sending_queue table
[MAILPOET-4699]
2022-10-06 12:06:13 +02:00
1a8f0c384c Improve logging of errors in cron
Sometimes errors overlap each other so that the 'Last Seen error' we log
does not provide sufficient information on the cause of a problem.

E.g. one worker might cause an SQL issue, which closes the EntityManager and a
subsequent worker might overwrite this error with the information that the
EntityManager is closed.

With this commit, both those issues will be logged as an error.

[MAILPOET-4699]
2022-10-06 12:06:13 +02:00