Commit Graph

628 Commits

Author SHA1 Message Date
Ronald Langeveld
62b71fb4c0
Fixed offers index pricing decimals (#19125)
no issue

- changes the price tags on the offer cards to two decimal places.
2023-11-24 14:06:19 +02:00
Ronald Langeveld
41ee387af2
Fixed Offers portal preview edge cases (#19124)
no issue

- cleaned up offers portal preview.
- fixes a few logic errors and potential edge cases and making it easier
to maintain.
2023-11-24 12:32:45 +02:00
Sag
819ddccc72
Fixed validation and edge cases for managed email UI (#19121)
refs GRO-73

- fixed validation for reply-to address
- fixed rendering of default values for reply-to and sender-from fields
- added a temporary generic message for the verification confirmation,
so that it's compatible with both reply-to and from address changes. The
message will be improved in a follow-up commit (pending an API change).
2023-11-23 22:30:28 +00:00
Simon Backx
a037ce3dde
Added calculated email address settings (#19115)
fixes GRO-73

We need to avoid duplicating the complex logic for determining the
default email address and the support email address. So these are now
exposed as calculated settings.
2023-11-23 13:07:15 +00:00
Jono M
a8083960d8
Added test examples to AdminX demo (#19116)
refs https://github.com/TryGhost/Product/issues/4182

Updated framework to include shared test config for easier app setup.
2023-11-23 12:59:48 +00:00
Sodbileg Gansukh
17804dd3ac Various design fixes for offers in Adminx 2023-11-23 17:15:03 +08:00
Princi Vershwal
876f13c075
Fixed no offer screen and tab view
Ref: https://github.com/TryGhost/Product/issues/4188
2023-11-23 07:01:53 +00:00
Sag
ff70ffec67
Updated newsletter settings UI for managed email (#19082)
refs GRO-59
refs GRO-56
refs GRO-52

- When email is managed without a custom domain, do not allow the Sender
Email address to be changed, but allow Reply-to address to be changed to
any address the publisher can verify
- When email is managed with a custom domain, allow both Sender and
Reply-to addresses to be changed without verification, but not their
domain names

---------

Co-authored-by: Djordje Vlaisavljevic <dzvlais@gmail.com>
2023-11-23 02:07:14 +00:00
Princi Vershwal
4f518153aa
Fixed offers for archive tiers 2023-11-22 18:42:24 +00:00
Jono M
f19f32b132
Moved AdminX test config to framework package (#19096)
refs https://github.com/TryGhost/Product/issues/4180
2023-11-22 13:39:32 +00:00
Ronald Langeveld
cc6e881342
Wired latest offer cards to Offers settings group in Admin. (#19095)
refs https://github.com/TryGhost/Product/issues/4176

- wired up Offer data points to the offer cards in the grouped setting.
2023-11-22 13:18:04 +00:00
renovate[bot]
8d0b9cd269 Update Types packages 2023-11-22 12:24:36 +01:00
Princi Vershwal
0a20df65b5
Added fix for no offer screen (#19092) 2023-11-22 10:35:40 +00:00
Sodbileg Gansukh
2cd248b5bf Added no offers view to the offers list screen in AdminX
refs https://github.com/TryGhost/Product/issues/4177
2023-11-22 18:00:45 +08:00
Sodbileg Gansukh
d76b739f1e Added latest offer cards to the Offers setting group
refs https://github.com/TryGhost/Product/issues/4176
2023-11-22 17:05:32 +08:00
Princi Vershwal
5587192644
Wiring up sorting to offers in AdminX
Ref: https://github.com/TryGhost/Product/issues/4162
2023-11-22 14:14:44 +05:30
Jono M
32dacd9ff7
Fixed provider ordering to prevent bugs loading modals on refresh (#19089)
refs https://github.com/TryGhost/Product/issues/4174
2023-11-22 07:51:10 +00:00
Ronald Langeveld
8038c5854e
🐛 Fixed About modal dev experiments info in Settings (#19087)
refs https://ghost.slack.com/archives/C0568LN2CGJ/p1700617587979039

- Fixes an issue where dev experiments data shows up in the settings
About modal while it's disabled. Now it will only shows that info when it's
enabled.
2023-11-22 06:28:31 +00:00
renovate[bot]
b275450bec Update Types packages 2023-11-21 15:06:56 +01:00
Ronald Langeveld
b5c3def92b
Fixed Offers not saving fixed amount discount (#19077)
no issue

- Offers with a fixed amount wasn't saving due to the type not updating
from percent to fixed.
2023-11-21 12:31:28 +00:00
Simon Backx
b6519e0f1f
Removed usage of unquoted ids in filter strings (#19070)
fixes GRO-34
fixes GRO-33

This is a revision of a previous commit, that broke the browser tests
because changes in the data generator (requiring bookshelf had side
effects).

This adds a new way to run all tests with enforced numeric ObjectIDs.
These numeric ids cause issues if they are used withing NQL filters. So
they surface tiny bugs in our codebase.

You can run tests using this option via:
NUMERIC_IDS=1 yarn test:e2e

Removed some defensive logic that could be explained by this discovered
issue.
2023-11-21 09:45:36 +01:00
Ronald Langeveld
dca11d0eeb
Added last redeemed UI (#19069)
refs https://github.com/TryGhost/Product/issues/4153

- wired up the last redeemed date to the Offers edit stats
- added the direct link to the pre-filtered list members by offered
used.
2023-11-21 10:31:06 +02:00
Sodbileg Gansukh
820a7c664f Fixed offer amount select width issue 2023-11-21 16:02:23 +08:00
renovate[bot]
07d8152da8 Update dependency @types/validator to v13.11.7 2023-11-21 07:31:00 +01:00
Sodbileg Gansukh
f3aadab613
Added a type for the sorting direction of SortMenu component (#19062)
refs https://github.com/TryGhost/Product/issues/4162
2023-11-21 03:52:12 +00:00
Sodbileg Gansukh
ccd1e355e1 Added static design of sorting to offers in AdminX
refs https://github.com/TryGhost/Product/issues/4162
2023-11-21 11:39:36 +08:00
Steve Larson
a398067159
Added TK reminders labs feature (#19057)
refs TryGhost/Product#4156
2023-11-20 23:30:16 +00:00
Simon Backx
d5492bd63c
Revert "Removed usage of unquoted ids in filter strings" (#19052)
Reverts TryGhost/Ghost#19031

Browser tests are failing with an unknown cause
2023-11-20 13:50:07 +00:00
Jono M
a93c665d20
Created a skeleton AdminX demo app (#19005)
refs https://github.com/TryGhost/Product/issues/4152

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset)
Generated by Copilot at a28462f</samp>

This pull request adds a new admin-x app called `admin-x-demo`, which
demonstrates how to use the shared packages `admin-x-framework` and
`admin-x-design-system` to create a simple app that renders a button and
a modal. It also improves the development workflow, the vite
integration, the dependency management, and the type checking for the
admin-x apps and packages. It modifies some files in the
`admin-x-framework` and `admin-x-design-system` packages to make the
modals prop optional, to introduce a new type for the props from the
Ember app, to fix the z-index of the modal backdrop, and to use
consistent file extensions and module syntax.
2023-11-20 13:30:15 +00:00
Simon Backx
320eaac4c4
Removed usage of unquoted ids in filter strings (#19031)
fixes GRO-34
fixes GRO-33

This also adds a new way to run all tests with enforced numeric ObjectIDs.
These numeric ids cause issues if they are used withing NQL filters. So they
surface tiny bugs in our codebase.

You can run tests using this option via:
NUMERIC_IDS=1 yarn test:e2e

Also removed some defensive logic that could be explained by unquoted ids.
2023-11-20 14:00:31 +01:00
Djordje Vlaisavljevic
72f273ae47 Fixed issues with wrong button color in dark mode
refs https://github.com/TryGhost/Product/issues/4166
2023-11-20 11:12:50 +00:00
Jono M
5e057dee11
Added tests to AdminX framework package (#19022)
refs https://github.com/TryGhost/Product/issues/4159

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset)
Generated by Copilot at 9e68f4d</samp>

This pull request refactors several components in the `admin-x-settings`
app to use common hooks from the `@tryghost/admin-x-framework` package,
which reduces code duplication and improves consistency. It also updates
the `package.json` file and adds unit tests for the `admin-x-framework`
package, which improves the formatting, testing, and dependency
management. Additionally, it makes some minor changes to the `hooks.ts`,
`FrameworkProvider.tsx`, and `.eslintrc.cjs` files in the
`admin-x-framework` package, which enhance the public API and the
linting configuration.
2023-11-20 11:00:51 +00:00
renovate[bot]
fa51b1b3dd Update dependency @vitejs/plugin-react to v4.2.0 2023-11-20 09:42:07 +01:00
Sag
69ee4a5ff5
Added option to unsubscribe in one-click from emails (#19032)
refs https://github.com/TryGhost/Product/issues/4051
- added a "List-Unsubscribe" header to emails, in compliance with the
RFC 8058 requirements
- Gmail, Apple Mail, Yahoo Mail, and other popular email clients offer
an option to unsubscribe in one-click, based on the "List-Unsubscribe"
header. Some require an HTTPS endpoint, some a mailto address; both
options are provided in the "List-Unsubscribe" header

Co-authored-by: Simon Backx <simon@ghost.org>
Co-authored-by: Djordje Vlaisavljevic <dzvlais@gmail.com>
2023-11-16 14:50:24 -03:00
Sodbileg Gansukh
63b2b439a7 Show the archived offers tab only when there's some 2023-11-16 19:37:22 +08:00
Sodbileg Gansukh
8377bd8410
Added Breadcrumbs toolbar option to PreviewModal in AdminX (#19016)
no issues

- currently there are urls and tabs as a toolbar option for the preview
modal
- as part of adding offers to AdminX, we needed a breadcrumbs option for
navigating between list and create/edit screens
- previewToolbarBreadcrumbs is used for passing an array with the type
BreadcrumbItem
- onBreadcrumbsBack is used for passing a function to be called when the
back button of the breadcrumbs is clicked
2023-11-16 19:26:25 +08:00
Ronald Langeveld
17f8844134
Wired up date-created to Offer Analytics (#19018)
no issue

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset)
Generated by Copilot at c7304ac</samp>

This pull request adds the `created_at` property to the `Offer` type and
displays it in the `EditOfferModal` component. This allows the admin to
see when an offer was created.
2023-11-16 18:05:24 +07:00
Simon Backx
e5f644c27f
🐛 Fixed contain/starts/endsWith filters with /, _ or % in them (#19015)
fixes GRO-25

Updated @tryghost/nql to 0.12.0 and other packages that depend on it

1. SQLite: when a filter string contains /.

When we use a NQL contain/starts/endsWith filter that contains a slash,
underlyingly the whole filter will get converted to a MongoDB query, in
which we just use a regexp to represent the filter. In here we will
escape the slash: \/ as expected in a regexp. Later when we convert this
MongoDB query back to knex/SQL, we use a SQL LIKE query. Currently we
don't remove the escaping here for a normal slash. MySQL seems to ignore
this (kinda incorrect). SQLite doesn't like it, and this breaks queries
on SQLite that use slashes. The solution here is simple: remove the
backslash escaping when converting the regexp to LIKE, just like we do
with other special regexp characters.

2. We don't escape % and _, which have a special meaning in LIKE queries

Usage of % and _ is now as expected and doesn't have the special SQL
meaning anymore.
2023-11-16 09:35:20 +00:00
Sodbileg Gansukh
6de3e85bd0 Fixed duplicate modals issue in offers AdminX
refs https://github.com/TryGhost/Product/issues/4138

- we should follow the same pattern as change modal flow for the Offers modals
- with the change theme flow, only one modal is shown at a time to make it feel like navigating inside one container modal
- this removes the container modal from OffersContainerModal and puts back the Modal component to each screens, so there will be no modal on top of another
2023-11-16 17:26:31 +08:00
Ronald Langeveld
9016d76d42
Unified Offers modals to a single modal (#19011)
refs https://github.com/TryGhost/Product/issues/4138


<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset)
Generated by Copilot at b2390e4</samp>

Refactored the offers modal logic and routing in the admin-x-settings
app. Moved the offers modal components from `modals.tsx` to
`SettingsRouter.tsx` and `OffersContainerModal.tsx`. Replaced
`NiceModal` with `useModal` hook and simplified props and imports.
Enabled sub-routes for creating, editing, and viewing offers.
2023-11-16 06:56:06 +00:00
Sodbileg Gansukh
c88f4f24d3 Added static design of stats to offers edit screen in AdminX
refs https://github.com/TryGhost/Product/issues/4153
2023-11-16 11:04:06 +08:00
Sodbileg Gansukh
3d945e539b
UI improvements for Offers in AdminX (#19008) 2023-11-16 10:09:09 +08:00
Jono M
99765206c1
Fixed small UI bugs from the AdminX design system migration (#18991)
no issue

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at a19dd1f</samp>

Refactored the email settings UI for default recipients by reusing and
adapting the Twitter settings UI. Removed an unnecessary prop from the
`ImageUpload` component.
2023-11-15 11:57:55 +00:00
Ronald Langeveld
44b4b169a9
Fixed duration options for yearly cadence (#18989)
no issue

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at b84f2a0</samp>

This change improves the offer creation modal by filtering the duration
options based on the tier's cadence. This avoids showing irrelevant or
invalid options to the user and simplifies the selection process.
2023-11-15 16:36:55 +07:00
Daniel Lockyer
ee804fc7af Hidden "info" Vite output unless in CI
refs https://github.com/TryGhost/DevOps/issues/104

- `info` is very verbose as it prints all files and their sizes
- we often don't care about this, so we can do away with `info` in favor
  of `warn`
2023-11-15 10:11:22 +01:00
Ronald Langeveld
ec5b766aaa
Wired up success modal to Admin X (#18987)
refs https://github.com/TryGhost/Product/issues/4148

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at e982c03</samp>

This pull request adds a new feature to create and share offers in the
admin-x-settings app. It fixes a bug in the `AddOfferModal` component,
and enhances the `OfferSuccess` component to show and copy the offer
link, and provide social sharing options. It also updates the
`SettingsRouter` component to handle the offer id parameter in the
success route.
2023-11-15 08:29:01 +00:00
Daniel Lockyer
53157f3c40 Disabled reporting compressed gzip size
refs https://vitejs.dev/config/build-options.html#build-reportcompressedsize

- this should make building a little bit quicker because it doesn't have
  to calculate the gzip size (I don't think we're likely to hit this
  because we don't have large projects, but it's still nice to clean up
  the output)
2023-11-15 09:11:12 +01:00
Ronald Langeveld
fb3eb3ac5c
Added Portal Preview to Edit Page - Offers X (#18985)
refs https://github.com/TryGhost/Product/issues/4150

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at bced508</samp>

This pull request improves the offer modal UI and functionality by using
consistent values for discount amount types, adding a portal preview
feature, and fixing some bugs and syntax errors in the code. The changes
affect the files `AddOfferModal.tsx`, `EditOfferModal.tsx`, and
`getOffersPortalPreviewUrl.ts`.
2023-11-15 14:52:32 +07:00
Sodbileg Gansukh
a083ce35b9 Added static design to success screen to offers in AdminX
refs https://github.com/TryGhost/Product/issues/4149
2023-11-15 14:58:19 +08:00
Sodbileg Gansukh
0a3db4cab6
Design details for the offers list layout in AdminX (#18983)
refs https://github.com/TryGhost/Product/issues/4137
2023-11-15 05:31:25 +00:00