Commit graph

21 commits

Author SHA1 Message Date
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
Davinder Singh
2ba92141ee Merge pull request #17719 from overleaf/ds-latam-pricing-web-config
Latam Geo Pricing V2 - Updating Web configurations file for new prices

GitOrigin-RevId: 0cd7abc565e971dd68f0860f00ea2ed8c1e713f8
2024-04-09 08:04:10 +00:00
Thomas
8efac32c8a Add LATAM currencies/prices to plan and group settings/scripts (#13661)
* Add LATAM currencies to plan-prices generator script

* Add LATAM prices to web configs

* Add LATAM currencies to group plan price formatting

* Use toLocaleString to format currencies for LATAM regions

GitOrigin-RevId: ce672043bef16298c87efa007eac23b004be8205
2023-07-17 11:01:00 +00:00
Domagoj Kriskovic
2ab0779374 [cm6] rename to Code Editor | Visual Editor (#13513)
* [cm6] rename to Code Editor | Visual Editor

* showLegacySourceEditor change

* show info badge

* remove info badge

* display info badge

* use "Visual Editor" in example project

GitOrigin-RevId: 549e25aa4bcfe58522eadc70e35ca35f822317b1
2023-07-17 10:39:10 +00:00
Mathias Jakobsen
31190b967b [cm6] Add figure modal (#12751)
GitOrigin-RevId: 3043d1369ed85b38b1fec7479385b123a304c05b
2023-05-16 08:04:02 +00:00
Brian Gough
426128554d Merge pull request #12813 from overleaf/bg-add-inr-currency
add Indian Rupee (INR) prices to plan and group settings

GitOrigin-RevId: 6c058ed034d1566cfda17e73a8ba23d8bd7b7ab0
2023-04-27 08:07:45 +00:00
Mathias Jakobsen
a84b0e9b56 Merge pull request #11662 from overleaf/mj-update-blank-template
[web] Replace inputenc with graphicx in blank template

GitOrigin-RevId: ca134c24d93c23665cc538ee0c654f2a727774f9
2023-02-08 09:05:23 +00:00
Thomas
17be32f90d Merge pull request #10908 from overleaf/tm-adjust-prices-10886
Adjust all prices for 10% increase from previous baseline

GitOrigin-RevId: a895f862e404d91bc17914164fe19fac2f2d1dde
2022-12-16 09:02:53 +00:00
Eric Mc Sween
682406b797 Merge pull request #10380 from overleaf/ii-change-plans-prices
Change plans prices

GitOrigin-RevId: 9229e9be916c8377f6fdd259f934a9f0811f3d94
2022-11-15 09:06:04 +00:00
Miguel Serrano
7d77ddb9fc Merge pull request #9003 from overleaf/msm-sp-example-project
[web] Example Project for CE/SP

GitOrigin-RevId: 6d488ec9f1a37b39f9e345d63fe84557c9a706b6
2022-07-27 12:18:06 +00:00
Alf Eaton
0097e8344b Add missing space to example doc (#6704)
GitOrigin-RevId: 2fd23a653d2913395da10b8d2d55029e73a0fede
2022-02-16 11:37:16 +00:00
Tim Alby
bbac46156b convert price_in_unit to price_in_cents
GitOrigin-RevId: bae030e9c90f8286d6e6550744849984fe81f63d
2022-01-21 09:03:29 +00:00
Tim Alby
3e70546e18 rename price attributes to price_in_cents or price_in_unit
GitOrigin-RevId: 8045472c96862078583fcb522099ad78926281dc
2022-01-21 09:03:23 +00:00
Thomas
5e61fce3b4 Enable additional currencies when purchasing (or upgrading to) a group plan (#4884)
* Add script to fetch group data pricing from Recurly

* Update groups pricing data using script to fetch prices from Recurly

* Add additional currencies to saas settings

* Refactor group plans upgrade modal to use shared options from settings

GitOrigin-RevId: 6d13d5b152d01e0399f9d2b8f6f8bf99784589e8
2022-01-12 09:03:21 +00:00
June Kelly
af9a3d4fb7 Merge pull request #4818 from overleaf/ab-clean-example-project-split-test
Cleanup example project split test and set variant as new template

GitOrigin-RevId: 6d023233077b856f0f9a755eb1a0b60b66b4335f
2021-08-20 08:03:09 +00:00
Alexandre Bourdin
affaae14b7 Merge pull request #3917 from overleaf/ab-example-project-ab-test
Example Project Split Test

GitOrigin-RevId: a9d68811c878e32b92e0547311c9e477e4096135
2021-04-28 02:10:08 +00:00
James Allen
140f97eb20 Merge pull request #1107 from sharelatex/ja-purchase-groups
Purchase group/team accounts directly via app

GitOrigin-RevId: 1a502878753de77758fb431f45a6366f199f1cb0
2018-11-13 13:50:46 +00:00
James Allen
fc4ffc3905 Fix typo and file extension in example tex template 2018-02-06 10:27:10 +00:00
Henry Oswald
92928c35ab removed old email tempaltes 2014-03-06 11:53:24 +00:00
James Allen
fd911c278f Move copyright images into brand directory 2014-02-14 11:44:09 +00:00
James Allen
8715690ce9 Intial open source comment 2014-02-12 10:23:40 +00:00