Просмотр исходного кода

Merge pull request #19942 from overleaf/mf-group-dropdown-connect-button-cta

[web] Connect license dropdown to CTA href and pricing header on new plans page group tab

GitOrigin-RevId: b3bdd05cc3efccc17883205de51232e31ee71c58
M Fahru 2 лет назад
Родитель
Сommit
9cf4cd36cf

+ 10 - 1
services/web/app/src/Features/Subscription/SubscriptionController.js

@@ -167,7 +167,16 @@ async function plansPageLightDesign(req, res) {
   const currentView = 'annual'
   const currentView = 'annual'
   const plans = SubscriptionViewModelBuilder.buildPlansList()
   const plans = SubscriptionViewModelBuilder.buildPlansList()
   const groupPlanModalDefaults = _getGroupPlanModalDefaults(req, currency)
   const groupPlanModalDefaults = _getGroupPlanModalDefaults(req, currency)
-  const formatCurrency = SubscriptionHelper.formatCurrencyDefault
+
+  const localCcyAssignment = await SplitTestHandler.promises.getAssignment(
+    req,
+    res,
+    'local-ccy-format-v2'
+  )
+  const formatCurrency =
+    localCcyAssignment.variant === 'enabled'
+      ? formatCurrencyLocalized
+      : SubscriptionHelper.formatCurrencyDefault
 
 
   const { showLATAMBanner, showInrGeoBanner, showBrlGeoBanner } = _plansBanners(
   const { showLATAMBanner, showInrGeoBanner, showBrlGeoBanner } = _plansBanners(
     {
     {

+ 7 - 6
services/web/frontend/js/features/plans/utils/group-plan-pricing.js

@@ -7,12 +7,13 @@ import getMeta from '../../../utils/meta'
 // plan: 'collaborator' or 'professional'
 // plan: 'collaborator' or 'professional'
 // the rest of available arguments can be seen in the groupPlans value
 // the rest of available arguments can be seen in the groupPlans value
 /**
 /**
- * @param {'collaborator' | 'professional'} plan
- * @param {string} licenseSize
- * @param {CurrencyCode} currency
- * @param {'enterprise' | 'educational'} usage
- * @param {string?} locale
- * @param {(amount: number, currency: CurrencyCode, locale: string, includeSymbol: boolean) => string} formatCurrency
+ * @param {Object} opts
+ * @param {'collaborator' | 'professional'} opts.plan
+ * @param {string} opts.licenseSize
+ * @param {CurrencyCode} opts.currency
+ * @param {'enterprise' | 'educational'} opts.usage
+ * @param {string} [opts.locale]
+ * @param {(amount: number, currency: CurrencyCode, locale: string, includeSymbol: boolean) => string} opts.formatCurrency
  * @returns {{localizedPrice: string, localizedPerUserPrice: string}}
  * @returns {{localizedPrice: string, localizedPerUserPrice: string}}
  */
  */
 export function createLocalizedGroupPlanPrice({
 export function createLocalizedGroupPlanPrice({

+ 1 - 1
services/web/locales/en.json

@@ -2120,6 +2120,7 @@
   "total_per_month": "Total per month",
   "total_per_month": "Total per month",
   "total_per_year": "Total per year",
   "total_per_year": "Total per year",
   "total_per_year_for_x_users": "total per year for __licenseSize__ users",
   "total_per_year_for_x_users": "total per year for __licenseSize__ users",
+  "total_per_year_lowercase": "total per year",
   "total_with_subtotal_and_tax": "Total: <0>__total__</0> (__subtotal__ + __tax__ tax) per year",
   "total_with_subtotal_and_tax": "Total: <0>__total__</0> (__subtotal__ + __tax__ tax) per year",
   "total_words": "Total Words",
   "total_words": "Total Words",
   "tr": "Turkish",
   "tr": "Turkish",
@@ -2341,7 +2342,6 @@
   "x_price_for_y_months": "<0>__price__</0> for your first __discountMonths__ months",
   "x_price_for_y_months": "<0>__price__</0> for your first __discountMonths__ months",
   "x_price_per_user": "__price__ per user",
   "x_price_per_user": "__price__ per user",
   "x_price_per_year": "__price__ per year",
   "x_price_per_year": "__price__ per year",
-  "x_total_per_year": "__price__ total per year",
   "year": "year",
   "year": "year",
   "yearly": "Yearly",
   "yearly": "Yearly",
   "yes_im_in": "Yes, I’m in",
   "yes_im_in": "Yes, I’m in",