feat(pricing): restore TB perpetual calculator with reworked pricing model#553
Open
rusikv wants to merge 1 commit into
Open
feat(pricing): restore TB perpetual calculator with reworked pricing model#553rusikv wants to merge 1 commit into
rusikv wants to merge 1 commit into
Conversation
…model Restore the "Estimate your cost" modal calculator removed in thingsboard#485, updated to the current perpetual licensing model: - Base license includes 5,000 devices + 1 production instance ($4,999), 5M AI credits, and white labeling. - Symmetric device/instance scaling: each purchased production instance ($4,999) also grants +5,000 devices; every full 5,000 purchased extra devices unlocks 1 complimentary production instance (which grants no extra device capacity). The devices field always shows the resulting quota (capped at 1M on every path), and the device caption and instances helper render from the same state so they stay in sync. - AI Credits stepper (1 = 1,000,000 credits; 5 packs included). Extra packs have no public list price, so they route to the custom-pricing flow. - Custom pricing from a $24,998 total (or Offline Mode / extra AI credits): the calculation summary is replaced by a centered personal-price notification, Total shows "Custom", and a "Send request" CTA opens Contact Us prefilled with the configuration (quantities only, no prices). - Rewritten on current conventions rather than reverted: modal lifecycle via modal-controller (portal + scroll-lock), analytics via calc-analytics with a new 'tb_perp' CalculatorType (calculator_open / interaction / export / cta_click; interaction adds calculator_ai_credits and calculator_addon_offline; total is null and plan is 'Custom' at the custom tier). - Shared polish: Reset button label is now vertically centered and its height matches the footer CTA (applies to all calculators). The hero card regains the "Estimate your cost" primary CTA (secondary Contact Us keeps the autofill message), the modal mounts alongside the other calculator modals, and the FAQ data-open-calc handler's 'perp' branch is restored. The pre-removal tbPerpetualPlans export was dead code and stays removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restores the ThingsBoard PE perpetual license calculator removed in #485, updated to the current perpetual licensing model as sold on the License Portal.
What's in
Pricing model
5,000 + extras + 5,000 × instances, capped at 1M on every path), and the caption under it + the instances helper render from the same state, e.g.5 000 included + 5 000 included from instance + 7 000 extra devices.Custom pricing — total ≥ $24,998, Offline Mode, or extra AI credits
Implementation — the calculator predates several refactors, so it's rewritten on current conventions rather than reverted: modal lifecycle via
modal-controller(portal-to-body + scroll-lock), analytics viacalc-analyticswith a newtb_perpCalculatorType(calculator_open/calculator_interaction/calculator_export/calculator_cta_click; interaction addscalculator_ai_credits+calculator_addon_offline; total isnulland plan isCustomat the custom tier), shared export buttons,@-prefixed import aliases.Page wiring: hero card regains the "Estimate your cost" primary CTA (
window.openTbPerpCalc), secondary Contact Us keeps the autofill message; modal mounted next to the PAYG/Private Cloud modals; FAQdata-open-calc="perp"branch restored. The pre-removaltbPerpetualPlansexport was dead code and stays removed.Shared polish: the Reset button label is now vertically centered and its height matches the footer CTA (36px box under a 24px text line left the label sitting low — affected all calculator modals).
Verification
astro check— 0 errors; fullastro build— success.tb_perp, null total +Customplan at the custom tier,calculator_ai_credits, export carrying plan+total); typed sub-minimum AI values clamped before the debounced GTM push; 1M device cap held when instances raise the floor; emptied instances field keeps purchases; Reset; Escape close.