Commit graph

25 commits

Author SHA1 Message Date
Antoine Clausse
ede03daafd Rename test to local-ccy-format-v2 to restart with clean data (#18115)
GitOrigin-RevId: 610495f41d69f8cac1a427ef7b8d64886bc5cdba
2024-04-26 08:04:26 +00:00
Antoine Clausse
b2ef7a935f [web] Use localized number formatting for currencies (#17622)
* Add a unit test on `SubscriptionFormatters.formatPrice`

* Add JSDoc to `formatPrice`

Also: Name the functions before exporting:
This fixes my IDE (WebStorm) navigation

* Make `'USD'` the default param instead of reassigning

* Create `formatCurrency` function

* Use `formatCurrency` in SubscriptionFormatters

* Use an `isNoCentsCurrency` logic for `CLP` `JPY` `KRW` `VND`

And remove custom `CLP` logic and locale

* Add `locale` param to `formatPrice`

* Generate `groups.json` and `localizedPlanPricing.json`

```
bin/exec web node ./scripts/recurly/recurly_prices.js --download -o prices.json
bin/exec web node ./scripts/plan-prices/plans.js -f ../../prices.json -o dir
```

* Update scripts/plan-prices/plans.js to generate numbers instead of localized amounts

* Generate `groups.json` and `localizedPlanPricing.json`

```
bin/exec web node ./scripts/recurly/recurly_prices.js --download -o prices.json
bin/exec web node ./scripts/plan-prices/plans.js -f ../../prices.json -o dir
```

* Remove generation of `plans.json`

As /services/web/frontend/js/main/plans.js was removed in https://github.com/overleaf/internal/pull/12593

* Sort currencies in alphabetical order in scripts/plan-prices/plans.js

* Generate `groups.json` and `localizedPlanPricing.json`

```
bin/exec web node ./scripts/recurly/recurly_prices.js --download -o prices.json
bin/exec web node ./scripts/plan-prices/plans.js -f ../../prices.json -o dir
```

* Use `formatCurrency` in price-summary.tsx

* Use `formatCurrency` in Subscription Pug files

* Fix unit tests SubscriptionHelperTests.js

* Remove unused `currencySymbol`

* Change to `formatCurrency` in other React components

* Add `CurrencyCode` JSDoc types

* Duplicate `formatCurrency` into services/web/app/src/util

* Wrap tests in a top-level describe block

* Use `narrowSymbol`

* Fix tests with `narrowSymbol` expects

* Revert deletion of old `formatPrice` in SubscriptionFormatters.js

* Rename `formatCurrency` -> `formatCurrencyLocalized`

* Revert deletion of `CurrencySymbol`

* Add split-test in SubscriptionController.js

* Add split-test in SubscriptionViewModelBuilder.js

* Add split-test in plans

* Add split-test in subscription-dashboard-context.tsx

* Add split-test in 4 more components

* Update tests

* Show currency and payment methods in interstitial page

* Fix `–` being printed. Use `–` instead

* Fix test with NOK

* Storybook: Fix missing `SplitTestProvider`

* Storybook: Revert "Remove unused `currencySymbol`"

This reverts commit e55387d4753f97bbf8e39e0fdc3ad17312122aaa.

* Replace `getSplitTestVariant` by `useSplitTestContext`

* Use parameterize currencyFormat in `generateInitialLocalizedGroupPrice`

* Fixup import paths of `formatCurrencyLocalized`

* Replace `% 1 === 0` by `Number.isInteger`

* Add comment explaining that any combinations of languages/currencies could happen

* Fixup after rebase: import `useSplitTestContext`

* Revert "Remove SplitTestProvider from subscription root"

This reverts commit be9f378fda715b86589ab0759737581c72321d87.

* Revert "Remove split test provider from some tests"

This reverts commit 985522932b550cfd38fa6a4f4c3d2ebaee6ff7df.

GitOrigin-RevId: 59a83cbbe0f7cc7e45f189c654e23fcf9bfa37af
2024-04-19 08:03:54 +00:00
M Fahru
9b8d0ac122 Merge pull request #17664 from overleaf/dp-plans-page-anchor-tags
Allow for direct linking to monthly plans

GitOrigin-RevId: 842d88eac84eaf94ec486b213ec4a0b13cf70ad6
2024-03-29 09:04:34 +00:00
M Fahru
5a8a0fb268 Tear down annual-trials split test:
- Use the `default` variant as the winner
- Remove all `annual-trials`-related code

GitOrigin-RevId: 3956f256157f3e86c99e41eec54ef6fd0da39bc3
2024-03-01 09:03:24 +00:00
Rebeka Dekany
140b312eca Merge pull request #14799 from overleaf/rd-report-tablist-plan
Accessibility - help the user to navigate through the tabs on the plans page

GitOrigin-RevId: 93822277edd3a44eaf8e1219a4902e28d31e198a
2024-01-26 09:03:36 +00:00
Rebeka
34aec8f8be update the view based on the variants
GitOrigin-RevId: 8aa833bb8d7faeabc25e2497821d5b74c16d3c2a
2023-08-10 08:04:51 +00:00
Jakob Ackermann
d212be408f Merge pull request #13337 from overleaf/jpa-translate-plans-page
[web] translate all the things on the plans page (to German)

GitOrigin-RevId: cbd812a4eca41573986c2d9e4f5e37b3d5a49e4f
2023-07-19 08:03:57 +00:00
M Fahru
8120d52de1 Fix "For students" link in footer isn't working properly (#13296)
* Fix "For student" link in footer isn't working because of hash being placed before querystring

* add scroll to top behaviour if "For students" link is accessed on the plans page

* Add an extra delay to make sure computation is finished before performing scroll to top behaviour

GitOrigin-RevId: 46b906271223267bc47ffcd781c25dc03f23a8e7
2023-07-17 10:27:02 +00:00
June Kelly
f5740e6b17 Merge pull request #12593 from overleaf/jk-remove-plans-split-test
[web] Remove 'plans-page-layout-v3' split test

GitOrigin-RevId: 91e0d3d8bc40632df630131b2e872fa824015da5
2023-04-26 08:04:21 +00:00
M Fahru
781c1c97c7 Implement new three-way split test for the plans page (#11493)
* Update split test config and infrastructure for plans-page-layout-v3

* Implement view for `old-plans-page-annual` variant of the new split test:
    - Make `annual` the default view for all elements on the old plans page
    - Change the tooltip background to green for monthly/student view

* Implement a new design for the new plans page:
    - switch annual and monthly locations (annual on the left now)
    - change the tooltip background to green color for all choice
    - make the monthly-annual switch has green background if annual is chosen

* Fix mobile view plans page header style

GitOrigin-RevId: b2b3c6ac6adbe26bf6def7e072493f503793cfcb
2023-01-30 09:02:45 +00:00
Davinder Singh
e7e1fcef3b Merge pull request #10796 from overleaf/ds-plans-page-btn-tag
Replaced the a tag with button tag for plans page plans options

GitOrigin-RevId: 4717067ce0fc9209a65c0d323602d834a90951fc
2022-12-19 09:04:10 +00:00
M Fahru
8c792dd63e Make annual value is the default when opening new plans page with hashchange event
GitOrigin-RevId: b2525c314f06a990492112a7280e921987205169
2022-09-28 08:08:02 +00:00
M Fahru
4dbabe3a8d Only show university info box on new plans page student tab (#8823)
GitOrigin-RevId: 057baae295443d9a924b4b0754cdb12ebe330976
2022-07-13 08:05:54 +00:00
M Fahru
3b4968e263 Change number of users in group plan to have a dynamic value in the new plans page (#8592)
GitOrigin-RevId: 008c0a1120e5b99945f18f0b4eee60bfcb08a331
2022-07-13 08:05:33 +00:00
M Fahru
e97c56b105 Fix group plan localized pricing and force 2 decimal number for non-integer currency value (#8576)
GitOrigin-RevId: d6dedf7af04c79cef6b9cd39f5496610ffc52938
2022-07-13 08:05:20 +00:00
M Fahru
f3118771fe Add new limited discount information on personal plan in the new plans page (#8715)
GitOrigin-RevId: 7f4e91179ba767ff8b88df7787eaf9d4fe6a5f05
2022-07-13 08:05:06 +00:00
Thomas Mees
b3d5a2c7f0 Port ability to set plans page tab view with URL hash
GitOrigin-RevId: 367829b46a1e984f19a131999938c554a960eccf
2022-07-13 08:04:56 +00:00
M Fahru
ac1f72263c Fix switch tooltip not showing the proper text on new plans page (#8608)
GitOrigin-RevId: efb49c7a6045b6a5b26a0b0d84a24d151f76f192
2022-06-29 08:05:07 +00:00
M Fahru
361f6f245a Refactor new plans page (#8493)
* [web] hide the monthly/annual switch for small screens via css

Co-Authored-By: Jakob Ackermann <jakob.ackermann@overleaf.com>

* [web] merge logic for hiding elements shown in a subset of view

Co-Authored-By: M Fahru <m.fahru@overleaf.com>

* [web] hide the monthly/annual switch for small screens via css

Co-Authored-By: M Fahru <m.fahru@overleaf.com>

* [web] merge logic for hiding elements shown in a subset of view

Co-Authored-By: M Fahru <m.fahru@overleaf.com>

* fix inverted logic on monthly annual checking

* delete some duplicated logic and refactor

* merge switch functions

* move global variable into the main module

* simplify the enable and disable switch

* remove unused parseFloat

* simplify group plan pricing calculation

* simplify discount group plan logic

* simplify sticky header logic

* merge view and period switching

* fix underlining of switch text

* simplify class list toggling

* merging two function of the group plan

Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
GitOrigin-RevId: 5e51690514bbf1dee2639011748c6a8470e1c19a
2022-06-23 08:02:56 +00:00
M Fahru
03e875ffa3 Remove duplicated event listener on new plans page group plan modal (#8085)
GitOrigin-RevId: 7445c3b93bc54285f5ade6ce8b32b13be9281dc5
2022-05-25 08:10:15 +00:00
M Fahru
487ff4f505 Improvement on form data sync between group plan modal and new plan page (#8003)
GitOrigin-RevId: 66a0a423fe48a8a8a7ddd292ba218cd5038dfdb1
2022-05-20 08:03:44 +00:00
M Fahru
1b2cefa63e Add new analytics events in the new plans page and update analytics event in the current plans page (#7639)
GitOrigin-RevId: 71a4e7b0b041bbe7ea6df11cad28857978c77e4e
2022-05-20 08:03:21 +00:00
M Fahru
dceb6910c9 New plans page: Show initial price value upon first render for group price data (#7974)
* New plans page: Show initial price value upon first render

* fix wrong test on SubscriptionController and add new tests on SubscriptionHelper

GitOrigin-RevId: a339a97cff2df0728ba35885af8953c8a0e0b7c8
2022-05-20 08:03:16 +00:00
M Fahru
4d25132a5f new plans page: refactor custom tooltip to bootstrap tooltip (#7972)
GitOrigin-RevId: d3552867a9e9176288803cadffacb5f3dab24895
2022-05-18 08:04:06 +00:00
M Fahru
8157616f85 [web] New Plans Page for A/B Test (#7330)
GitOrigin-RevId: 4e4629583c6e86bd2bc6165d123224734c133df7
2022-05-13 08:03:30 +00:00