Commit graph

7373 commits

Author SHA1 Message Date
Jessica Lawshe
d28e58a2fc Merge pull request #18686 from overleaf/jel-plans-page-currency
[web] Move `currency` check to `_getRecommendedCurrency`

GitOrigin-RevId: afadd492a2e1db9c91fac027eb3c9783194ff169
2024-06-06 08:04:52 +00:00
ilkin-overleaf
dd7970c11d Merge pull request #18644 from overleaf/ii-delete-with-body-teardown-old-routes
[web] Tear down deprecated routes

GitOrigin-RevId: b86e1d9283a30d36f77148eeb782a7f37987854a
2024-06-06 08:04:31 +00:00
Antoine Clausse
e452f1df5b [web] Promisify LdapController (#18500)
* Promisify LdapController

* Update tests LdapControllerTests.js

* Promisify `AuthenticationController.finishLogin`

* Simplify null checks in LdapController

* Fix: don't use spread operator in module.exports

* Make `AuthenticationController.promises.finishLogin` a promise that resolves

* Fixup: `finishLogin` does not call `next` then the promise finishes, it calls it only on errors

* Use `Modules.promises.hooks.fire`

* Revert `processPassportLogin` callback style

* Update error handling: Use `OError.tag` instead of `logger.err`

* Fix unit tests: Rely on callbacks rather than promises

* Fix: Actually call `passport.authenticate` (!!)

* Update test: fixup `passport.authenticate` mocks

This would have caught the bugs that the previous commit is solving

* Remove `.then(() => next())` in `processPassportLogin`

Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>

---------

Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>
GitOrigin-RevId: a7eab5f5289956aeb8f2418408958daef3511ab7
2024-06-06 08:04:23 +00:00
Alf Eaton
c24ace801b Remove Angular (#17534)
GitOrigin-RevId: 7a0d45e17d9905fa75569e2d19ca59caa4a41565
2024-06-06 08:04:09 +00:00
Jessica Lawshe
22be3928e3 Merge pull request #18614 from overleaf/mf-create-plans-redesign-split-test-config
[web] Create split test configuration for `website-redesign-plans` split test

GitOrigin-RevId: dea88256830897d1ab1f1de64eb21413c823e6ff
2024-06-04 08:04:59 +00:00
Tim Down
c0d920f305 Merge pull request #18660 from overleaf/td-rd-bs5-contact-us-modal
Bootstrap 5 contact us modal

GitOrigin-RevId: a4607fab50152109fbe83bc29246b7b4a82539a1
2024-06-04 08:04:46 +00:00
Andrew Rumble
d1a58e6b77 Merge pull request #18538 from overleaf/ar-add-download-all-link-in-web
[web] add download all link for output files

GitOrigin-RevId: 3d574d75d53e577cb0f8fd3caa4f757d9e1b7889
2024-06-03 08:04:07 +00:00
Tim Down
1b247347e7 Merge pull request #18590 from overleaf/td-ieee-editor-remove-blue
Disable IEEE stylesheet in IEEE editor based on feature flag

GitOrigin-RevId: 09b203e3220a868d5f0a0e413bdc4d3ff7a1792e
2024-05-31 08:04:41 +00:00
Jessica Lawshe
3a59883e7a Merge pull request #18297 from overleaf/jel-remove-angular-group-invite
[web] Remove Angular version of group invite

GitOrigin-RevId: bd31cd2ed3c105c9042ae9c42894cfe960459a46
2024-05-31 08:04:27 +00:00
Jakob Ackermann
5a1cff55bc Merge pull request #18543 from overleaf/jpa-server-pro-test-templates
[server-pro] tests: add tests for templates feature

GitOrigin-RevId: b36482af924e306207cbdedc1a8d1d548272ee77
2024-05-30 08:05:30 +00:00
David
55e54ce875 Merge pull request #18435 from overleaf/dp-ae-pdf-viewer-controls
Update PDF viewer controls

GitOrigin-RevId: 4e15b7cbd34e878d0175be635369b8d620188203
2024-05-30 08:05:06 +00:00
Tim Down
134232a1a6 Merge pull request #18577 from overleaf/td-bs5-nav-dropdown-item-missing-href
Add missing href on Bootstrap 5 nav dropdown items

GitOrigin-RevId: 211a6dbd559ad74a9e49edbace61a51c2cc2f2da
2024-05-30 08:04:48 +00:00
Antoine Clausse
36f0a3e01a [web] Promisify ProjectController (#18477)
* Create `promiseAuto` util to replace `async.auto`

* Promisify `BrandVariationsHandler.getBrandVariationById`

* Promisify `updateProjectSettings`

* Promisify `updateProjectAdminSettings`

* Promisify `newProject`

* Promisify `deleteProject`

* Promisify `loadEditor`

* Fix brandVariation loading in promise auto

* Promisify `_refreshFeatures`

* Promisify `_injectProjectUsers`

* Fix `no-inner-declarations`

* Promisify `cloneProject`

* Promisify `userProjectsJson`

* Promisify `projectEntitiesJson`

* Promisify `restoreProject`

* Promisify `renameProject`

* Additional warning fix

* Update unit tests

* Fixup `updateProjectSettings`: call jobs inside the Promise.all

* Use `expressify(...)` instead of manually call `next(err)`

https://github.com/overleaf/internal/pull/18477#discussion_r1613611987
https://github.com/overleaf/internal/pull/18477#discussion_r1613621146
https://github.com/overleaf/internal/pull/18477#discussion_r1613634000
...

* Replace Promise.all by sequencial awaits

https://github.com/overleaf/internal/pull/18477#discussion_r1613852746
https://github.com/overleaf/internal/pull/18477#discussion_r1613611987

* Remove manual throws of 500. Let the generic error handler catch them.

https://github.com/overleaf/internal/pull/18477#discussion_r1613623446
https://github.com/overleaf/internal/pull/18477#discussion_r1613628955

* Promisify `untrashProject`

https://github.com/overleaf/internal/pull/18477#discussion_r1613627783

* Promisify `expireDeletedProjectsAfterDuration`

* Promisify `archiveProject`

* Promisify `unarchiveProject`

* Promisify `trashProject`

* Promisify `expireDeletedProject`

* Use async `setTimeout` from `timers/promise`

https://github.com/overleaf/internal/pull/18477#discussion_r1613843085

* Remove unused `_injectProjectUsers`

https://github.com/overleaf/internal/pull/18477#discussion_r1613855766

* Add missing exec in queries (?)

Not sure if that makes a real difference but it's more consistent with the rest of the code

* Catch floating promises

https://github.com/overleaf/internal/pull/18477#discussion_r1613868876

* Replace custom `promiseAuto` by `p-props` from NPM

https://github.com/overleaf/internal/pull/18477#discussion_r1613393294

* Downgrade `p-props` to v4. Later versions require ESM

* Simplify code around `splitTestAssignments`

GitOrigin-RevId: 84d37f7aa9227b5b9acf9eeb5db1b78afc01b6ee
2024-05-30 08:04:36 +00:00
Domagoj Kriskovic
218a4538c1 [web] support for reverting binary files (#18033)
* [web] revert binary file

* use addEntityWithName if file was deleted

* todo comments

* only show Revert file in ui even if deleted

* use _revertBinaryFile function

* emit new ids when reverting

* format:fix

* await emitToRoom calls

* use EditorController.upsertFile

* remove _revertBinaryFile function

* binary file check

* mock importFile method in tests

* move findElementByPath stub

* debug ci error

* resolve with empty object as file

* fix tests

* remove await before expect()

* format:fix

* test when binary file exists and when it does not

* use "file-revert" for source

* [web] revert existing file without ranges support (#18107)

* [web] revert existing file without ranges support

* ignore document_updated_externally if file-revert

* fix test

GitOrigin-RevId: a5e0c83a7635bc7d934dec9debe916bdd4beb51e
2024-05-30 08:04:20 +00:00
Tim Down
3b2e60ece7 Merge pull request #18558 from overleaf/td-bs5-query-string-override
Add a mechanism to hide incomplete Bootstrap 5 pages by default

GitOrigin-RevId: 07cc998bf3a0bed9df2f43d1c04c62d167c9b893
2024-05-30 08:04:15 +00:00
Andrew Rumble
22e0e51796 Merge pull request #18464 from overleaf/ar-pass-analytics-id-to-google-analytics
Add analytics ID to google analytics when configuring

GitOrigin-RevId: e2372f68217583a90df427a853e62513f1535006
2024-05-30 08:04:07 +00:00
M Fahru
c722dcbc8d Merge pull request #18419 from overleaf/mf-plans-page-permanent-url
[web] Create permanent URL for all plans and switch state in the plans page

GitOrigin-RevId: 5fa0af0e33868f8fa4f6a74627bedb4c22705cb0
2024-05-29 08:05:11 +00:00
Mathias Jakobsen
d95910fc71 [web] Enable history ranges support behind feature flag (#18429)
GitOrigin-RevId: 2f3b2352d2c157248da350eaf7b1784a605ebf20
2024-05-29 08:04:33 +00:00
Mathias Jakobsen
f14fdc7b7c Merge pull request #17958 from overleaf/mj-web-revert-file
[web] Initial version of file reverting

GitOrigin-RevId: ef500b2c3ddf21b0acb6650c2526edd10ab2cc18
2024-05-29 08:04:16 +00:00
Tim Down
edaba14ed1 Merge pull request #18420 from overleaf/td-bs5-nav
Bootstrap 5: Navigation

GitOrigin-RevId: d22683d78c8b3bc3f41bbd276c36f47d480e24ff
2024-05-29 08:04:05 +00:00
ilkin-overleaf
abd57e03cf Merge pull request #17831 from overleaf/msm-filter-saml-error-log
[web] Filter saml error logs by path

GitOrigin-RevId: 4ca9e156657afc893f38fed7ec6b00cbb7a608ef
2024-05-28 08:04:10 +00:00
Eric Mc Sween
3a1560894a Merge pull request #18516 from overleaf/em-web-resolved-comment-ids
Reintroduce resolved comment ids in getDocument()

GitOrigin-RevId: 591589efc643c815c40df440d1297158901f7a79
2024-05-28 08:04:01 +00:00
Eric Mc Sween
ea8f8d0651 Merge pull request #18506 from overleaf/em-revert-web-resolved-comment-ids
Revert #18398 - return resolved commentIds with getDocument()

GitOrigin-RevId: c5d2dd91d02d88029eb2702d73ac37cb8dbca32c
2024-05-27 10:24:25 +00:00
Eric Mc Sween
92945f504d Merge pull request #18496 from overleaf/rd-pug-warning-attributes
[web] Fix: "You should not have pug tags with multiple attributes" warning

GitOrigin-RevId: 0adfdf6a130c60966eae3c845011975af7eecc44
2024-05-27 10:24:21 +00:00
Eric Mc Sween
83e1452991 Merge pull request #18398 from overleaf/em-web-resolved-comment-ids
Return resolved comment ids with getDocument()

GitOrigin-RevId: 30234f72d52b90b313821290b6c63aa6cc6cb243
2024-05-27 10:24:13 +00:00
Alexandre Bourdin
a0c8cf663a Merge pull request #18000 from overleaf/ab-dev-enable-toolbar-default
[web] Enable the dev-toolbar by default in the dev environment

GitOrigin-RevId: 170e59e9b82268e621fe99ffcc82b7d68467e1b3
2024-05-27 10:23:56 +00:00
Jimmy Domagala-Tang
81903bb79d Merge pull request #18175 from overleaf/jdt-new-bib-file-prompt
[Web] Add opportunistic prompts for third party references

GitOrigin-RevId: d794df16781d0db707423f23ab12f40a13604907
2024-05-27 10:23:41 +00:00
Brian Gough
344b4d0fa0 Merge pull request #18088 from overleaf/ab-session-secret-rotation
[web/realtime/history-v1] Support session secret rotation

GitOrigin-RevId: 3c2fa27b1b3e0a8e0c9d1af2e616ce873d54aedf
2024-05-27 10:23:33 +00:00
Antoine Clausse
554be73a36 In collect_paypal_past_due_invoice.js, iterate over each page instead of gathering data from all pages at first (#18414)
* Create `getPaginatedEndpointIterator` to iterate each page

* Create `waitMs` util, it will replace `slowCallback`

* Make `handleAPIError` async

* Make `isAccountUsingPaypal` async

* Make `attemptInvoiceCollection` async

* Make `attemptInvoicesCollection` async

* Use `await` instead of `new Promise`

* Remove unused callbackified `attemptInvoiceCollection`

* Run `attemptInvoiceCollection` for each page instead of gathering all pages in the beginning

* Add test on fetching multiple pages of invoice

GitOrigin-RevId: 2674b18c6ca5732b873fb2bc71b515909006f93d
2024-05-27 10:23:18 +00:00
Rebeka Dekany
a0334898db Merge pull request #18437 from overleaf/rd-bs5-project-dashboard
Enable Bootstrap 5 to load for the project dashboard page

GitOrigin-RevId: 4aa74bd4fde98192b2e5b322bb777a8c8beae237
2024-05-27 10:22:58 +00:00
David
029cd4abe7 Merge pull request #18456 from overleaf/dp-fix-main-lint
Fix lint by using recordEventForUserInBackground

GitOrigin-RevId: 3412c9a997ce0921b25408fc584060e528843b88
2024-05-27 10:22:44 +00:00
David
635aae7b1f Merge pull request #18320 from overleaf/dp-add-secondary-prompt-ui
Add secondary email form V2 (with Captcha this time)

GitOrigin-RevId: b06216a2c9cb5b3b09305a17992eca506a0047f5
2024-05-27 10:22:40 +00:00
Eric Mc Sween
a22319fe46 Merge pull request #18453 from overleaf/em-fix-floating-promise
Fix no-floating-promises lint rule

GitOrigin-RevId: 58f89e0078abf72be65552f9468cb225e5758e3e
2024-05-27 10:22:24 +00:00
Eric Mc Sween
876ee4d967 Merge pull request #18225 from overleaf/em-typescript-eslint
Add typescript-eslint rule: no-floating-promises

GitOrigin-RevId: 8c3decdff537c885f5bfeb5250b7805480bc6602
2024-05-27 10:22:20 +00:00
Antoine Clausse
3300811d3a [web] Simplify removeSessionsFromRedis signature (#18440)
* Simplify `removeSessionsFromRedis` signature

* Update usage of `removeSessionsFromRedis`

* Fix tests around `removeSessionsFromRedis`

* Add comments "remove all sessions except the current session"

GitOrigin-RevId: 03bf99c14faf2c8e403bc4bcc16463a70e031284
2024-05-27 10:21:30 +00:00
Antoine Clausse
78a0bc2b05 [web] Convert RecurlyWrapper functions to async (#18384)
* Rename `RecurlyWrapper` to `promises`, as it will only contain the promises soon

* Update `apiRequest`

* Update `_parseXml`

* Update `_parseXmlAndGetAttribute`

* Update `_parse*Xml`

* Update `updateAccountEmailAddress`

* Update `checkAccountExists`

* Update `createAccount`

* Update `createBillingInfo`

* Update `setAddressAndCompanyBillingInfo`

* Update `createSubscription`

* Update `_createPaypalSubscription`

* Update `_handle422Response`

* Update `_createCreditCardSubscription`

* Update `createSubscription`

* Update `getSubscriptions`

* Update `getSubscription`

* Update `getPaginatedEndpoint`

* Update `getAccount`

* Update `getAccountActiveCoupons`

* Update `getCoupon`

* Update `getBillingInfo`

* Update `getAccountPastDueInvoices`

* Update `attemptInvoiceCollection`

* Update `updateSubscription`

* Update `createFixedAmmountCoupon`

* Update `lookupCoupon`

* Update `redeemCoupon`

* Update `extendTrial`

* Update `listAccountActiveSubscriptions`

* To find which functions to add as callbackified, I used this Regex:
`RecurlyWrapper\.(?!promises)[^.\s]*`

And after adding callbackified functions, we're left with no results with the Regex:
`RecurlyWrapper\.(?!promises|apiUrl|_buildXml|_parseXml|attemptInvoiceCollection|createFixedAmmountCoupon|getAccountActiveCoupons|getBillingInfo|getPaginatedEndpoint|getSubscription|updateAccountEmailAddress)[^.\s]*`

* Update unit tests

* Test `getSubscription` both as "promise" and as "callback"

I'm not sure if we want to generalize this.

* Fix: add missing `await`s (!!)

* Change `apiRequest` to reject errors instead of resolving it in an object

* Fixup for CollectPayPalPastDueInvoice test

* Fix: callbackify `getSubscriptions` (!!)

* Replace `.then(...)` chain by multiple `await`

* Fixup `attemptInvoicesCollection`: prevent reading length of undefined

* Use `return await` when returning promises

Per https://github.com/overleaf/internal/pull/18384#pullrequestreview-2065738771

GitOrigin-RevId: ceda755b24fd29f97a27e60ac5db9bc7e369f932
2024-05-27 10:21:26 +00:00
ilkin-overleaf
7ca9a5b61b Merge pull request #18415 from overleaf/ii-delete-with-body
[web] Replace delete with post requests when having body

GitOrigin-RevId: b580cfa3bd53c21f46de72f3a36b647fda143b04
2024-05-21 08:04:44 +00:00
Rebeka Dekany
1aa5ee7b21 Merge pull request #18404 from overleaf/rd-bs5-dropdown-fix
[web] Fix footer layout on the smallest viewport Bootstrap 5

GitOrigin-RevId: 741540ff5e25fe36021d0a2ef2d433dc63ee3650
2024-05-20 08:04:27 +00:00
Eric Mc Sween
dfd1652c35 Merge pull request #18375 from overleaf/em-promisify-chat-api-handler
Promisify ChatApiHandler

GitOrigin-RevId: 83cedb14b5e2b187fb2cb02fcbf888ada5a599b1
2024-05-20 08:04:22 +00:00
Antoine Clausse
25d8e053be [web] Update revokeAllUserSessions and rename it to removeSessionsFromRedis (#18360)
* Fix `revokeAllUserSessions` call in `_cleanupUser`

The user object should be passed, not the _id

* Change `revokeAllUserSessions` signature, take `req` and `stayLoggedIn` arguments

* Update uses of `revokeAllUserSessions`

* Fix promisified `revokeAllUserSessions` args

* Update tests

* Destroy or Regenerate the session in the end of `revokeAllUserSessions`

Per https://github.com/overleaf/internal/issues/17036#issuecomment-1938398570

* Revert "Destroy or Regenerate the session in the end of `revokeAllUserSessions`"

This reverts commit fe30734dbe45b27d2931d2e43a711d591bb85787.

* Rename `revokeAllUserSessions` to `removeSessionsFromRedis`

* Fixup tests

* Fix: add optional chaining in `req.sessionID` (!!)

GitOrigin-RevId: d41676bf00f463230af495e09c65fb9ee521f49f
2024-05-20 08:04:12 +00:00
Christopher Hoskin
3342d672c2 Merge pull request #18397 from overleaf/em-revert-download-all-link
Revert "Merge pull request #18190 from overleaf/ar-add-download-all-l…

GitOrigin-RevId: 681eb2734636d76558e682dc85083bfcaa6b7d2d
2024-05-17 08:05:10 +00:00
Rebeka Dekany
f652c49713 Merge pull request #18386 from overleaf/rd-footer-pug
[web] Migrate the language dropdown in footer to Bootstrap 5

GitOrigin-RevId: 07a37f59914c543ae8d33312aa313451145cd220
2024-05-17 08:05:02 +00:00
Tim Down
97add91248 Merge pull request #18377 from overleaf/td-metrics-page-fix
Move Bootstrap and jQuery imports into metricsApp

GitOrigin-RevId: 3ec1690ca60928e983211792f6c6b63548dfe62c
2024-05-16 08:05:35 +00:00
Jakob Ackermann
dfe587f297 Merge pull request #18294 from overleaf/jpa-td-invite-details
[web] avoid content reflection via query parameter on register page

GitOrigin-RevId: 43e7ba6069e0d9f3f12e5e9e680b5960b0673782
2024-05-16 08:05:09 +00:00
Andrew Rumble
105d67bd04 Merge pull request #18190 from overleaf/ar-add-download-all-link
[web] Add download all link for output files

GitOrigin-RevId: a275f17b6acf3130250d91462ba01588b93b62f5
2024-05-16 08:05:04 +00:00
Tim Down
0886104862 Merge pull request #18276 from overleaf/td-bs5-load-js
Load correct JS for the active Bootstrap version, second attempt

GitOrigin-RevId: ad8748a941691d745db5cd3e986e9c7b188b3ecb
2024-05-16 08:04:59 +00:00
M Fahru
5c44fb8e9d Merge pull request #18281 from overleaf/mf-decaffeinate-server-admin-controller
[web][admin panel] Decaf cleanup of AdminController

GitOrigin-RevId: fca50565e140435b833c303d2a0dfac7449c3e17
2024-05-15 08:05:24 +00:00
M Fahru
ec1ab82789 Merge pull request #17479 from overleaf/mf-clean-up-plans-styling
[web] Clean up plans page styling

GitOrigin-RevId: fe05e9a1fd6c29c62941c878fe5e676d062c37de
2024-05-15 08:05:20 +00:00
Antoine Clausse
9419cc3b37 [web] Add tests to collect_paypal_past_due_invoice.js + update logging (#18310)
* Fix: Invoices collected array length comparison

Update the code with the correct condition to respect the intent of the previous implementation ("exit with non zero code when no invoicess were processed").
See 5476f39984

However, I'm not sure if erroring when no invoices are collected is actually what we want to do.

* Wrap `collect_paypal_past_due_invoice` script and export the function

* Fixup typo `accoutns`

* Log invoices collection data before throwing

* Add note: `handleAPIError` is silencing the errors

* Create a test on `collect_paypal_past_due_invoice`

* Replace `console.log` by `@overleaf/logger` (bunyan)

Our `console.warn` show up as Errors (in red) in GCP. For example the following is an error in GCP:
```
Errors in attemptInvoiceCollection with id=2693634 OError: Recurly API returned with status code: 400
```
https://github.com/overleaf/internal/blob/5476f39/services/web/scripts/recurly/collect_paypal_past_due_invoice.js#L9

---

Does it correctly set the levels as warnings if we use `@overleaf/logger`

GitOrigin-RevId: 37c8bdf4afd8cef4706700aafb44480ec8966a74
2024-05-15 08:04:46 +00:00
David
6718729087 Merge pull request #18318 from overleaf/dp-revert-secondary-email
Revert "Merge pull request #18139 from overleaf/dp-add-secondary-prompt-ui"

GitOrigin-RevId: d8af37a5c332ac21ddd4c85679553df0bda326f9
2024-05-14 08:04:11 +00:00