mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-23 06:07:56 +00:00
Open Overleaf assist paywall if in "overleaf-assist-bundle" split-test (#23894)
* Add overleaf assist paywall modal component in storybook * update img alt * remove data-action * rename assistant -> assist * use css var for blue color * Open Overleaf assist paywall if in "overleaf-assist-bundle" split-test * dont use optional planCode GitOrigin-RevId: 9315ee2350cb7bc804afa720047849c220781686
This commit is contained in:
parent
a8030f9e32
commit
0a270e0870
5 changed files with 59 additions and 1 deletions
|
@ -356,6 +356,7 @@ const _ProjectController = {
|
|||
'papers-integration',
|
||||
'editor-redesign',
|
||||
'paywall-change-compile-timeout',
|
||||
'overleaf-assist-bundle',
|
||||
].filter(Boolean)
|
||||
|
||||
const getUserValues = async userId =>
|
||||
|
@ -756,6 +757,9 @@ const _ProjectController = {
|
|||
chatEnabled = Features.hasFeature('chat')
|
||||
}
|
||||
|
||||
const isOverleafAssistBundleEnabled =
|
||||
splitTestAssignments['overleaf-assist-bundle']?.variant === 'enabled'
|
||||
|
||||
const isPaywallChangeCompileTimeoutEnabled =
|
||||
splitTestAssignments['paywall-change-compile-timeout']?.variant ===
|
||||
'enabled'
|
||||
|
@ -764,6 +768,10 @@ const _ProjectController = {
|
|||
isPaywallChangeCompileTimeoutEnabled &&
|
||||
(await ProjectController._getPaywallPlansPrices(req, res))
|
||||
|
||||
const addonPrices =
|
||||
isOverleafAssistBundleEnabled &&
|
||||
(await ProjectController._getAddonPrices(req, res))
|
||||
|
||||
res.render(template, {
|
||||
title: project.name,
|
||||
priority_title: true,
|
||||
|
@ -865,7 +873,10 @@ const _ProjectController = {
|
|||
reviewerRoleAssignment?.variant === 'enabled' ||
|
||||
Object.keys(project.reviewer_refs || {}).length > 0,
|
||||
isPaywallChangeCompileTimeoutEnabled,
|
||||
isOverleafAssistBundleEnabled,
|
||||
paywallPlans,
|
||||
addonPrices,
|
||||
planCode: subscription?.planCode,
|
||||
})
|
||||
timer.done()
|
||||
} catch (err) {
|
||||
|
@ -900,6 +911,28 @@ const _ProjectController = {
|
|||
return plansData
|
||||
},
|
||||
|
||||
async _getAddonPrices(req, res, addonPlans = ['assistBundle']) {
|
||||
const plansData = {}
|
||||
|
||||
const locale = req.i18n.language
|
||||
const { currency } = await SubscriptionController.getRecommendedCurrency(
|
||||
req,
|
||||
res
|
||||
)
|
||||
|
||||
addonPlans.forEach(plan => {
|
||||
const annualPrice = Settings.localizedAddOnsPricing[currency][plan].annual
|
||||
const monthlyPrice =
|
||||
Settings.localizedAddOnsPricing[currency][plan].monthly
|
||||
|
||||
plansData[plan] = {
|
||||
annual: formatCurrency(annualPrice, currency, locale, true),
|
||||
monthly: formatCurrency(monthlyPrice, currency, locale, true),
|
||||
}
|
||||
})
|
||||
return plansData
|
||||
},
|
||||
|
||||
async _refreshFeatures(req, user) {
|
||||
// If the feature refresh has failed in this session, don't retry
|
||||
// it - require the user to log in again.
|
||||
|
@ -1203,6 +1236,7 @@ const ProjectController = {
|
|||
_isInPercentageRollout: _ProjectController._isInPercentageRollout,
|
||||
_refreshFeatures: _ProjectController._refreshFeatures,
|
||||
_getPaywallPlansPrices: _ProjectController._getPaywallPlansPrices,
|
||||
_getAddonPrices: _ProjectController._getAddonPrices,
|
||||
}
|
||||
|
||||
module.exports = ProjectController
|
||||
|
|
|
@ -45,7 +45,10 @@ meta(name="ol-isPaywallChangeCompileTimeoutEnabled" data-type="boolean" content=
|
|||
if(isPaywallChangeCompileTimeoutEnabled)
|
||||
//- expose plans info to show prices in paywall-change-compile-timeout test
|
||||
meta(name="ol-paywallPlans", data-type="json" content=paywallPlans)
|
||||
|
||||
if(isOverleafAssistBundleEnabled)
|
||||
//- expose plans info to show prices in paywall-change-compile-timeout test
|
||||
meta(name="ol-addonPrices", data-type="json" content=addonPrices)
|
||||
meta(name="ol-planCode", data-type="string" content=planCode)
|
||||
// translations for the loading page, before i18n has loaded in the client
|
||||
meta(name="ol-loadingText", data-type="string" content=translate("loading"))
|
||||
meta(name="ol-translationIoNotLoaded", data-type="string" content=translate("could_not_connect_to_websocket_server"))
|
||||
|
|
|
@ -84,6 +84,8 @@
|
|||
"add_ons": "",
|
||||
"add_ons_are": "",
|
||||
"add_or_remove_project_from_tag": "",
|
||||
"add_overleaf_assist": "",
|
||||
"add_overleaf_assist_to_your_plan": "",
|
||||
"add_people": "",
|
||||
"add_role_and_department": "",
|
||||
"add_to_dictionary": "",
|
||||
|
@ -460,6 +462,7 @@
|
|||
"edit_tag": "",
|
||||
"editing": "",
|
||||
"editing_captions": "",
|
||||
"editing_tools_to_paraphrase_change_style_and_more": "",
|
||||
"editor": "",
|
||||
"editor_and_pdf": "",
|
||||
"editor_disconected_click_to_reconnect": "",
|
||||
|
@ -498,9 +501,11 @@
|
|||
"enter_image_url": "",
|
||||
"enter_the_confirmation_code": "",
|
||||
"enter_the_number_of_users_youd_like_to_add_to_see_the_cost_breakdown": "",
|
||||
"equation_generator": "",
|
||||
"equation_preview": "",
|
||||
"error": "",
|
||||
"error_assist": "",
|
||||
"error_assist_to_help_fixing_latex_errors": "",
|
||||
"error_opening_document": "",
|
||||
"error_opening_document_detail": "",
|
||||
"error_performing_request": "",
|
||||
|
@ -520,6 +525,7 @@
|
|||
"failed_to_send_group_invite_to_email": "",
|
||||
"failed_to_send_managed_user_invite_to_email": "",
|
||||
"failed_to_send_sso_link_invite_to_email": "",
|
||||
"fair_usage_policy_applies": "",
|
||||
"fast": "",
|
||||
"features_like_track_changes": "",
|
||||
"file": "",
|
||||
|
@ -841,6 +847,7 @@
|
|||
"labels_help_you_to_easily_reference_your_figures": "",
|
||||
"labels_help_you_to_reference_your_tables": "",
|
||||
"language": "",
|
||||
"language_suggestions_for_texts_in_any_language": "",
|
||||
"large_or_high-resolution_images_taking_too_long": "",
|
||||
"large_or_high_resolution_images_taking_too_long_to_process": "",
|
||||
"last_active": "",
|
||||
|
@ -1113,6 +1120,7 @@
|
|||
"output_file": "",
|
||||
"overall_theme": "",
|
||||
"overleaf": "",
|
||||
"overleaf_assist_streamline_your_workflow": "",
|
||||
"overleaf_history_system": "",
|
||||
"overleaf_labs": "",
|
||||
"overleaf_logo": "",
|
||||
|
@ -1640,6 +1648,7 @@
|
|||
"syntax_validation": "",
|
||||
"tab_connecting": "",
|
||||
"tab_no_longer_connected": "",
|
||||
"table_generator": "",
|
||||
"tag_color": "",
|
||||
"tag_name_cannot_exceed_characters": "",
|
||||
"tag_name_is_already_used": "",
|
||||
|
@ -1662,6 +1671,7 @@
|
|||
"test_configuration": "",
|
||||
"test_configuration_successful": "",
|
||||
"tex_live_version": "",
|
||||
"texgpt_for_help_writing_latex": "",
|
||||
"thank_you_exclamation": "",
|
||||
"thank_you_for_your_feedback": "",
|
||||
"thanks_for_confirming_your_email_address": "",
|
||||
|
|
|
@ -53,6 +53,7 @@ import { DefaultNavbarMetadata } from '@/features/ui/components/types/default-na
|
|||
import { FooterMetadata } from '@/features/ui/components/types/footer-metadata'
|
||||
export interface Meta {
|
||||
'ol-ExposedSettings': ExposedSettings
|
||||
'ol-addonPrices': Record<string, { annual: string; monthly: string }>
|
||||
'ol-allInReconfirmNotificationPeriods': UserEmailData[]
|
||||
'ol-allowedExperiments': string[]
|
||||
'ol-allowedImageNames': AllowedImageName[]
|
||||
|
|
|
@ -97,6 +97,8 @@
|
|||
"add_ons": "Add-ons",
|
||||
"add_ons_are": "<strong>Add-ons:</strong> __addOnName__",
|
||||
"add_or_remove_project_from_tag": "Add or remove project from tag __tagName__",
|
||||
"add_overleaf_assist": "Add Overleaf Assist",
|
||||
"add_overleaf_assist_to_your_plan": "Add Overelaf assist to your __planName__ plan",
|
||||
"add_people": "Add people",
|
||||
"add_role_and_department": "Add role and department",
|
||||
"add_to_dictionary": "Add to Dictionary",
|
||||
|
@ -595,6 +597,7 @@
|
|||
"editing": "Editing",
|
||||
"editing_and_collaboration": "Editing and collaboration",
|
||||
"editing_captions": "Editing captions",
|
||||
"editing_tools_to_paraphrase_change_style_and_more": "<0>Editing tools</0> to paraphrase, change style and more",
|
||||
"editor": "Editor",
|
||||
"editor_and_pdf": "Editor & PDF",
|
||||
"editor_disconected_click_to_reconnect": "Editor disconnected, click anywhere to reconnect.",
|
||||
|
@ -646,9 +649,11 @@
|
|||
"enter_your_email_address": "Enter your email address",
|
||||
"enter_your_email_address_below_and_we_will_send_you_a_link_to_reset_your_password": "Enter your email address below, and we will send you a link to reset your password",
|
||||
"enter_your_new_password": "Enter your new password",
|
||||
"equation_generator": "Equation Generator",
|
||||
"equation_preview": "Equation preview",
|
||||
"error": "Error",
|
||||
"error_assist": "Error Assist",
|
||||
"error_assist_to_help_fixing_latex_errors": "<0>Error Assist</0> for help fixing LaTeX errors",
|
||||
"error_opening_document": "Error opening document",
|
||||
"error_opening_document_detail": "Sorry, something went wrong opening this document. Please try again.",
|
||||
"error_performing_request": "An error has occurred while performing your request.",
|
||||
|
@ -682,6 +687,7 @@
|
|||
"failed_to_send_group_invite_to_email": "Failed to send Group invite to <0>__email__</0>. Please try again later.",
|
||||
"failed_to_send_managed_user_invite_to_email": "Failed to send Managed User invite to <0>__email__</0>. Please try again later.",
|
||||
"failed_to_send_sso_link_invite_to_email": "Failed to send SSO invite reminder to <0>__email__</0>. Please try again later.",
|
||||
"fair_usage_policy_applies": "Fair usage policy applies.",
|
||||
"faq_how_does_free_trial_works_answer": "You get full access to your chosen __appName__ plan during your __len__-day free trial. There is no obligation to continue beyond the trial. Your card will be charged at the end of your __len__ day trial unless you cancel before then. You can cancel via your subscription settings.",
|
||||
"fast": "Fast",
|
||||
"fastest": "Fastest",
|
||||
|
@ -1105,6 +1111,7 @@
|
|||
"labels_help_you_to_reference_your_tables": "Labels help you to reference your tables throughout your document easily. To reference a table within the text, reference the label using the <0>\\ref{...}</0> command. This makes it easy to reference tables without manually remembering the table numbering. <1>Read about labels and cross-references</1>.",
|
||||
"labs_program_benefits": "By signing up for Overleaf Labs you can get your hands on in-development features and try them out as much as you like. All we ask in return is your honest feedback to help us develop and improve. It’s important to note that features available in this program are still being tested and actively developed. This means they could change, be removed, or become part of a premium plan.",
|
||||
"language": "Language",
|
||||
"language_suggestions_for_texts_in_any_language": "</>Language suggestions<//> for texts in any language",
|
||||
"large_or_high-resolution_images_taking_too_long": "Large or high-resolution images taking too long to process. You may be able to <0>optimize them</0>.",
|
||||
"large_or_high_resolution_images_taking_too_long_to_process": "Large or high-resolution images taking too long to process.",
|
||||
"last_active": "Last Active",
|
||||
|
@ -1480,6 +1487,7 @@
|
|||
"over_n_users_at_research_institutions_and_business": "Over __userCountMillion__ million users at research institutions and businesses worldwide love __appName__",
|
||||
"overall_theme": "Overall theme",
|
||||
"overleaf": "Overleaf",
|
||||
"overleaf_assist_streamline_your_workflow": "Streamline your workflow with unlimited access to Overleaf and Writefull AI features.",
|
||||
"overleaf_group_plans": "Overleaf group plans",
|
||||
"overleaf_history_system": "Overleaf History System",
|
||||
"overleaf_individual_plans": "Overleaf individual plans",
|
||||
|
@ -2133,6 +2141,7 @@
|
|||
"syntax_validation": "Code check",
|
||||
"tab_connecting": "Connecting with the editor",
|
||||
"tab_no_longer_connected": "This tab is no longer connected with the editor",
|
||||
"table_generator": "Table Generator",
|
||||
"tag_color": "Tag color",
|
||||
"tag_name_cannot_exceed_characters": "Tag name cannot exceed __maxLength__ characters",
|
||||
"tag_name_is_already_used": "Tag \"__tagName__\" already exists",
|
||||
|
@ -2166,6 +2175,7 @@
|
|||
"test_configuration": "Test configuration",
|
||||
"test_configuration_successful": "Test configuration successful",
|
||||
"tex_live_version": "TeX Live version",
|
||||
"texgpt_for_help_writing_latex": "<0>TeXGPT</0> for help writing LaTeX",
|
||||
"thank_you": "Thank you!",
|
||||
"thank_you_email_confirmed": "Thank you, your email is now confirmed",
|
||||
"thank_you_exclamation": "Thank you!",
|
||||
|
|
Loading…
Add table
Reference in a new issue