Commit Graph

15684 Commits

Author SHA1 Message Date
Rostislav Wolny
5c93d20468 Remove new lines from translations passed to JS
A translator accidentally used a new line character in the translated
string and that broke JS code we generate in Twig helper function.
We don't want to support new lines in translated strings so as a fix
we just remove those characters to prevent the error in case it happens again.

[MAILPOET-4153]
2022-02-28 09:37:07 +01:00
Brezo Cordero
91b135a9ca Fix acceptance oldest tests
[MAILPOET-4161]
2022-02-26 10:16:46 +01:00
Rostislav Wolny
a40d7a3dce Fix Typescript warnings in cookie_settings.tsx
[MAILPOET-4159]
2022-02-23 12:41:53 -06:00
Brezo Cordero
a4693cb5bc Add form cookie after Captcha.
[MAILPOET-3059]
2022-02-23 15:22:24 +01:00
Brezo Cordero
bfa9a98df6 Do not display form if logged in and registered to any segment.
[MAILPOET-3059]
2022-02-23 15:22:24 +01:00
Brezo Cordero
8c70069064 Add selection in form editor for cookie expiration time.
[MAILPOET-3059]
2022-02-23 15:22:24 +01:00
Brezo Cordero
9562aec657 Set form cookie expiration time to half a year when subscribing.
[MAILPOET-3059]
2022-02-23 15:22:24 +01:00
Brezo Cordero
9e881882f4 Per form cookie and expiration date
Remove per form cookie when saving the form.

[MAILPOET-3059]
2022-02-23 15:22:24 +01:00
Brezo Cordero
250988163c Per form cookie and expiration date
Add expiration date and change popup_form_dismissed to per form cookie on public.js.

[MAILPOET-3059]
2022-02-23 15:22:24 +01:00
David Remer
9410659a62 Fix eslint errors [MAILPOET-4114] 2022-02-23 10:44:39 +01:00
David Remer
eef34670e9 Update eslint to version 8 and related package updates [MAILPOET-4114] 2022-02-23 10:44:39 +01:00
Sam Najian
9107c933fe Release 3.82.0 2022-02-22 13:26:06 +01:00
David Remer
eda969dd72 Fix action_argument_value of shortcode will be string if empty
[MAILPOET-4151]
2022-02-21 10:26:22 +01:00
Jan Jakes
ec0f490397 Restrict automation API only for admins
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
4c61236d9a Add readme for automation
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
7153f6f0b5 Register action scheduler in automation
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
c0125aeed1 Install woocommerce/action-scheduler
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
58dd80e647 Make strings translatable
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
8405659d07 Disable "no-void" rule for TS as it can conflict with "no-floating-promises"
When one needs to ignore promise result (for instance in a useEffect React hook), the
"@typescript-eslint/no-floating-promises" will enforce it's ignored using "void doSomething()"
but the "no-void" rule disables that. It's probably better to keep "no-floating-promises" so
that we mark ignored promise results explicitly with "void".

[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
48682358ee Add basic buttons to (re)create/delete automations DB schema
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
333634befc Add basic check component to test automation API calls
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
f3bfd59367 Add basic hooks to call automation API
This is very simple implementation of query-like and mutation-like REST API
calling hooks using the native fetch() function. We'll probably replace it
with a more robust existing library later on, ideally one that implements the
stale-while-revalidate mechanism, such as SWR by Vercel.

[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
de3227c6d6 Add endpoint to (re)create and delete automation DB schema
These are just "system" testing endpoints that we'll use in prototyping
phases. We should remove them eventually.

[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
abbf0d5aeb Auto-create DB schema on automation page load
We don't have any hooks for feature activation (yet) so this seems to
be the most handy place to create the database schema at the moment.

[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
d3e4d2c9d8 Construct method-not-allowed exception using exception factory
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
7c503a3517 Add basic migrator to create/delete automation tables for prototyping
This is a simple service used only for prototyping that will allow us
to simply change and recreate database schemas. Eventually, we'll need
to replace it with database migration logic.

[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
086c4cf731 Add bacic automation React app setup with hello world
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
9e8e3a37bb Add basic workflow endpoint with hello world message
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
51d6b541e5 Add check that JSON request body exists when required
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
8c7516eaba Expose 5xx errors in PHP error log
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
b40f344a51 Add API exception handling and error response
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
b2a9053fa8 Add static factory class for easier exception creation
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
79350b4282 Add basic set of exceptions compatible with WP REST API
This means the exception need to have string error code, HTTP status code, and a message,
as the WP REST API errors look as foolows:

{"code":"rest_invalid_json","message":"Invalid JSON body passed.","data":{"status":400,"json_error_code":4,"json_error_message":"Syntax error"}}

[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
99a8ee3a46 Add basic API route handling wrapper for WP REST API
Each endpoint will be a class that can implement get/post/put/delete methods.
The routes are registered to WP REST API automatically based on the existence
of implemented methods. The endpoint classes are handled standard services and
therefore can leverage full powers of the DI container.

[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
ebfddb73bd Add endpoint-class factory based on PSR-11 container interface
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
18d722cd51 Add basic request, response, and endpoint definitions for API
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
da951e77af Enforce type hints in automation directory
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
73554ec101 Enforce strict types in automation directory
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
ddb04feef4 Add empty automation initializer
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
9dc2809462 Add automation page
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Jan Jakes
12edbf1687 Add automation feature flag
[MAILPOET-4135]
2022-02-21 09:56:26 +01:00
Sam Najian
47ad1ec18e Adjust eslint-ts for premium plugin to match the free one
We have turned some checks off for free plugin which need
to be added to the eslint config for the premium plugin
since we are going to use the free plugin's files as type
source for the premium plugin

[MAILPOET-3140]
2022-02-21 09:53:50 +01:00
Sam Najian
30c6d3d688 Fix issue with TS finding multiple definitions for React
This fixes the issue we sometimes experience where tsc
finds multiple definitions for React types since several of
dependencies have React or related packages as dependency

[MAILPOET-3140]
2022-02-21 09:53:50 +01:00
Sam Najian
2ddd454ddf Disable typechecking for production build
[MAILPOET-3140]
2022-02-21 09:53:50 +01:00
Sam Najian
2df36c3ff6 Re-shrink public.js size
- Convert mailpoet_public.js to ts
- Update webpack to use the ts file when replacing
  mailpoet.ts with mailpoet_public.ts for public build

[MAILPOET-3140]
2022-02-21 09:53:50 +01:00
Sam Najian
6b470981ae Add module entry files and expose mailpoet module
- Expose mailpoet and dependencies for premium plugin to use
- Update type definitions for window
- Fix typings
- Get rid of side-effects in mailpoet.js(ts)

[MAILPOET-3140]
2022-02-21 09:53:50 +01:00
Sam Najian
573cec0fda Add typechecker to webpack
[MAILPOET-3140]
2022-02-21 09:53:50 +01:00
dependabot[bot]
b41b3ceaa0 Bump twig/twig from 2.14.10 to 2.14.11 in /mailpoet/prefixer
Bumps [twig/twig](https://github.com/twigphp/Twig) from 2.14.10 to 2.14.11.
- [Release notes](https://github.com/twigphp/Twig/releases)
- [Changelog](https://github.com/twigphp/Twig/blob/v2.14.11/CHANGELOG)
- [Commits](https://github.com/twigphp/Twig/compare/v2.14.10...v2.14.11)

---
updated-dependencies:
- dependency-name: twig/twig
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-21 09:20:15 +01:00
Rostislav Wolny
a644c71e64 Add subscriber detection from Woo Session to subscriber action tracker
[MAILPOET-4101]
2022-02-16 16:06:05 +01:00
Rostislav Wolny
ceceb4e093 Release 3.81.0 2022-02-16 15:49:04 +01:00