From dc1bba781b41005d3026cc185f99d0f9b7df0267 Mon Sep 17 00:00:00 2001 From: Ronald Langeveld Date: Mon, 22 Jan 2024 15:14:08 +0000 Subject: [PATCH] Fixed Offers redemptions preselection (#19541) fixes https://linear.app/tryghost/issue/PROD-319/offer-is-not-preselected-in-filter-dropdown-after-navigating-to - fixes the URL builder for when Redeemed offers are selected to ensure the selected tier is preselected in the members filter --- .../src/components/settings/growth/offers/OffersIndex.tsx | 3 ++- ghost/admin/app/templates/offers.hbs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx b/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx index b581bef775..cfae709b39 100644 --- a/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx +++ b/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx @@ -20,7 +20,8 @@ export type OfferType = 'percent' | 'fixed' | 'trial'; export const createRedemptionFilterUrl = (id: string): string => { const baseHref = '/ghost/#/members'; - return `${baseHref}?filter=${encodeURIComponent('offer_redemptions:' + id)}`; + const filterValue = `offer_redemptions:[${id}]`; + return `${baseHref}?filter=${encodeURIComponent(filterValue)}`; }; export const getOfferCadence = (cadence: string): string => { diff --git a/ghost/admin/app/templates/offers.hbs b/ghost/admin/app/templates/offers.hbs index 26f06bae5a..8c3326f9f2 100644 --- a/ghost/admin/app/templates/offers.hbs +++ b/ghost/admin/app/templates/offers.hbs @@ -92,7 +92,7 @@ {{currency-symbol offer.finalCurrency}}{{gh-price-amount offer.originalPrice}} {{/if}} - + {{offer.redemptionCount}}