[web] Fix UpgradePrompt in Editor - Retrieve isMember from userIsMemberOfGroupSubscription (#19810)

* Fix: Retrieve `isMember` from `userIsMemberOfGroupSubscription`

* Inline `userIsMemberOfGroupSubscription` call

GitOrigin-RevId: b8b339bbce3934b0b83bf6d805ab6ef6225d43e7
This commit is contained in:
Antoine Clausse 2024-08-06 15:53:11 +02:00 committed by Copybot
parent 2113a94aff
commit a278e70b27
2 changed files with 7 additions and 4 deletions

View file

@ -415,9 +415,12 @@ const _ProjectController = {
collaberator_refs: 1, // used for link sharing analytics
}),
userIsMemberOfGroupSubscription: sessionUser
? LimitationsManager.promises.userIsMemberOfGroupSubscription(
sessionUser
)
? (async () =>
(
await LimitationsManager.promises.userIsMemberOfGroupSubscription(
sessionUser
)
).isMember)()
: false,
_flushToTpds:
TpdsProjectFlusher.promises.flushProjectToTpdsIfNeeded(projectId),

View file

@ -994,7 +994,7 @@ describe('ProjectController', function () {
it('should not show for a user who is a member of a group subscription', function (done) {
this.LimitationsManager.promises.userIsMemberOfGroupSubscription = sinon
.stub()
.resolves(true)
.resolves({ isMember: true })
this.res.render = (pageName, opts) => {
expect(opts.showUpgradePrompt).to.equal(false)
done()