mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 02:00:10 +02:00
[web] Add option to send survey to enterprise plans (#32721)
* [web] Add option to send survey to enterprise plans GitOrigin-RevId: ccf3760a7443fdf1a21231592e3cb661fd8e1af1
This commit is contained in:
@@ -25,7 +25,8 @@ async function getSurvey(userId) {
|
||||
survey.options.hasIndividualStandardSubscription ||
|
||||
survey.options.hasIndividualProfessionalSubscription ||
|
||||
survey.options.hasGroupStandardSubscription ||
|
||||
survey.options.hasGroupProfessionalSubscription
|
||||
survey.options.hasGroupProfessionalSubscription ||
|
||||
survey.options.hasEnterpriseSubscription
|
||||
|
||||
if (hasFilters) {
|
||||
const subscriptions =
|
||||
@@ -92,15 +93,19 @@ function _canDisplaySurvey(subscription, options = {}) {
|
||||
hasIndividualProfessionalSubscription,
|
||||
hasGroupStandardSubscription,
|
||||
hasGroupProfessionalSubscription,
|
||||
hasEnterpriseSubscription,
|
||||
} = options
|
||||
const isGroupPlan = subscription.groupPlan
|
||||
const isProfessional = PlansHelper.isProfessionalPlan(subscription.planCode)
|
||||
const isEnterprise =
|
||||
isGroupPlan && subscription.planCode?.includes('enterprise')
|
||||
|
||||
return (
|
||||
(hasIndividualStandardSubscription && !isGroupPlan && !isProfessional) ||
|
||||
(hasIndividualProfessionalSubscription && !isGroupPlan && isProfessional) ||
|
||||
(hasGroupStandardSubscription && isGroupPlan && !isProfessional) ||
|
||||
(hasGroupProfessionalSubscription && isGroupPlan && isProfessional)
|
||||
(hasGroupProfessionalSubscription && isGroupPlan && isProfessional) ||
|
||||
(hasEnterpriseSubscription && isEnterprise)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,10 @@ export const SurveySchema = new Schema(
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hasEnterpriseSubscription: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
earliestSignupDate: {
|
||||
type: Date,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user