diff --git a/services/web/app/src/Features/Project/ProjectController.mjs b/services/web/app/src/Features/Project/ProjectController.mjs index 982997fc99..f221c01534 100644 --- a/services/web/app/src/Features/Project/ProjectController.mjs +++ b/services/web/app/src/Features/Project/ProjectController.mjs @@ -914,10 +914,6 @@ const _ProjectController = { showAiFeaturesDisabled = false } - // only add-on is ai based, so we only need its pricing info if ai features are usable - const addonPrices = - showAiFeatures && (await ProjectController._getAddonPrices(req, res)) - let standardPlanPricing let recommendedCurrency if (Features.hasFeature('saas')) { @@ -1049,7 +1045,6 @@ const _ProjectController = { isSaas: Features.hasFeature('saas'), shouldLoadHotjar, customerIoEnabled: true, - addonPrices, compileSettings: { compileTimeout: ownerFeatures?.compileTimeout, }, @@ -1092,37 +1087,6 @@ const _ProjectController = { } }, - // todo: quota clean-up: these can be removed potentially? - async _getAddonPrices(req, res, addonPlans = ['assistant']) { - 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 - const annualDividedByTwelve = - Settings.localizedAddOnsPricing[currency][plan].annualDividedByTwelve - - plansData[plan] = { - annual: formatCurrency(annualPrice, currency, locale, true), - annualDividedByTwelve: formatCurrency( - annualDividedByTwelve, - 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. @@ -1490,7 +1454,6 @@ const ProjectController = { _isInPercentageRollout: _ProjectController._isInPercentageRollout, _refreshFeatures: _ProjectController._refreshFeatures, _getPlanPricing: _ProjectController._getPlanPricing, - _getAddonPrices: _ProjectController._getAddonPrices, _setWritefullTrialState: _ProjectController._setWritefullTrialState, } diff --git a/services/web/app/src/Features/Subscription/AiHelper.mjs b/services/web/app/src/Features/Subscription/AiHelper.mjs index 9d4d6d0a8a..96560e6bfc 100644 --- a/services/web/app/src/Features/Subscription/AiHelper.mjs +++ b/services/web/app/src/Features/Subscription/AiHelper.mjs @@ -19,28 +19,9 @@ export function isStandaloneAiAddOnPlanCode(planCode) { ) } -/** - * Returns whether subscription change will have have the ai bundle once the change is processed - * - * @param {Record} subscriptionChange The subscription change object coming from payment provider - * type should be PaymentProviderSubscriptionChange but if imported here, it creates a circular dependency - * TODO: fix this when moved to es modules - * - * @return {boolean} - */ -export function subscriptionChangeIsAiAssistUpgrade(subscriptionChange) { - return Boolean( - isStandaloneAiAddOnPlanCode(subscriptionChange.nextPlanCode) || - subscriptionChange.nextAddOns?.some( - /** @param {any} addOn */ addOn => addOn.code === AI_ADD_ON_CODE - ) - ) -} - export default { AI_ADD_ON_CODE, AI_ASSIST_STANDALONE_MONTHLY_PLAN_CODE, AI_ASSIST_STANDALONE_ANNUAL_PLAN_CODE, isStandaloneAiAddOnPlanCode, - subscriptionChangeIsAiAssistUpgrade, } diff --git a/services/web/app/views/project/editor/_meta.pug b/services/web/app/views/project/editor/_meta.pug index fe48efabe9..f16c95c1c8 100644 --- a/services/web/app/views/project/editor/_meta.pug +++ b/services/web/app/views/project/editor/_meta.pug @@ -45,7 +45,6 @@ meta(name="ol-isSaas" data-type="boolean" content=isSaas) meta(name="ol-shouldLoadHotjar" data-type="boolean" content=shouldLoadHotjar) meta(name='ol-customerIoEnabled' data-type="boolean" content=customerIoEnabled) meta(name='ol-compileSettings' data-type="json" content=compileSettings) -meta(name="ol-addonPrices" data-type="json" content=addonPrices) if (standardPlanPricing) meta( name='ol-recommendedCurrency' diff --git a/services/web/frontend/js/utils/meta.ts b/services/web/frontend/js/utils/meta.ts index 3231bb59e9..04149c6e11 100644 --- a/services/web/frontend/js/utils/meta.ts +++ b/services/web/frontend/js/utils/meta.ts @@ -73,10 +73,6 @@ import { FullHistoryFailure } from '@ol-types/history/projectHistory' export interface Meta { 'ol-ExposedSettings': ExposedSettings - 'ol-addonPrices': Record< - string, - { annual: string; monthly: string; annualDividedByTwelve: string } - > 'ol-adminCapabilities': AdminCapability[] 'ol-adminSubscription': AdminSubscription 'ol-adminUserExists': boolean