mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #28618 from overleaf/jel-commons-enable-while-migrating-to-group
[web] Support Commons migration to a group with domain capture GitOrigin-RevId: 9262a44fc09d6d19a9c17895ef90bcef877e4a42
This commit is contained in:
@@ -163,20 +163,18 @@ function getUserAffiliations(userId, callback) {
|
||||
if (body?.length > 0) {
|
||||
const concurrencyLimit = 10
|
||||
await promiseMapWithLimit(concurrencyLimit, body, async affiliation => {
|
||||
if (!affiliation.institution.commonsAccount) {
|
||||
const group = (
|
||||
await Modules.promises.hooks.fire(
|
||||
'getGroupWithDomainCaptureByV1Id',
|
||||
affiliation.institution.id
|
||||
)
|
||||
)?.[0]
|
||||
const group = (
|
||||
await Modules.promises.hooks.fire(
|
||||
'getGroupWithDomainCaptureByV1Id',
|
||||
affiliation.institution.id
|
||||
)
|
||||
)?.[0]
|
||||
|
||||
if (group) {
|
||||
affiliation.group = {
|
||||
_id: group._id,
|
||||
managedUsersEnabled: Boolean(group.managedUsersEnabled),
|
||||
domainCaptureEnabled: Boolean(group.domainCaptureEnabled),
|
||||
}
|
||||
if (group) {
|
||||
affiliation.group = {
|
||||
_id: group._id,
|
||||
managedUsersEnabled: Boolean(group.managedUsersEnabled),
|
||||
domainCaptureEnabled: Boolean(group.domainCaptureEnabled),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ describe('InstitutionsAPI', function () {
|
||||
requestOptions.url.should.equal(expectedUrl)
|
||||
requestOptions.method.should.equal('GET')
|
||||
requestOptions.maxAttempts.should.equal(3)
|
||||
this.Modules.promises.hooks.fire.should.not.have.been.called
|
||||
this.Modules.promises.hooks.fire.should.have.been.called
|
||||
expect(requestOptions.body).not.to.exist
|
||||
expect(body).to.deep.equal(responseBody)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user