Commit d1403ff
authored
feat(billing): unified BillingCardComponent + annual toggle disabled state (#4149)
* fix(billing): align devkit static-content with V4 plan schema + close card edge cases
Phase 0 critical-review BLOCK findings — iter 1:
- [critical] Migrate devkit static-content plans to V4 schema (title/subtitle/highlight)
to match the new BillingCardComponent contract. Drop legacy
name/tagline/highlighted + featureSections + included:false features +
equivalences. Cards now render with proper titles and elevated variant for the
highlighted plan on the devkit dev server.
- [high] BillingCardComponent: skip cta-click emit when cta.to is set. v-btn's
:to binds router-link which navigates natively; emitting also triggered a
duplicate $router.push in the parent's @cta-click handler with a divergent
URL (free+guest plan dropped the redirect query param).
- [medium] Drop dead _equivalences computation in resolvedPlanItems — the new
BillingCardComponent does not consume equivalences. Trawl downstream already
removed them too.
- [low] Drop dead maxAnnualSavingsPct prop on BillingPricingToggleComponent —
caption was removed in V4 (savings live on card price.chip). Also drop the
prop binding in billing.pricing.view.vue.
- Test updates: add cta.to → no-emit test; drop maxAnnualSavingsPct usage in
toggle tests (prop removed); simplify i18n mock (savingsActive key unused).
All tests green (1669/1669, 101 files). Lint clean.
* fix(billing): preserve signup redirect query + drop dead view code
Phase 0 critical-review BLOCK findings — iter 2:
- [high] Free+guest CTA `cta.to` was '/signup' (string), losing the redirect=/pricing
query param. Card skips emit when cta.to is set (intentional double-nav fix), so
the view's onCtaClick fallback that pushed /signup?redirect=/pricing was dead.
Fix: pass cta.to as { path: '/signup', query: { redirect: '/pricing' } } — v-btn :to
accepts the same shape as $router.push().
- [medium] Drop dead `meterMode` computed from the view (only consumed by the
removed _equivalences logic).
- [low] Update billing.pricing.view.unit.tests.js mock fixtures to V4 schema
(title/subtitle/highlight) — masked schema-compliance gaps.
- [low] Clarify BillingCardComponent ITEM SCHEMA doc: cta is a string in
static-content plans but expanded into an object by resolvedPlanItems; cta-click
emit guard now documented (disabled OR to=set).
Note: usePricing.maxAnnualSavingsPct stays — it's a public composable API still
tested by billing.usePricing.unit.tests.js. Downstream may consume it.
All tests green (1669/1669). Lint clean.
* chore(billing): drop inert density attr on pricing toggle (no-op prop)
Phase 0 nit — BillingPricingToggleComponent has no density prop; the binding
falls through as inert HTML attribute on the root div with no effect.
Remove the binding (Vuetify density is not surfaced by this wrapper).
* fix(billing): use template literal for priceChip text (no i18n dep in tests)
Replace this.$t('billing.pricingCard.saveAnnual') with Save ${pct}% template literal
to match master convention and avoid $t not a function failures in unit tests.
* fix(auth): signup honors $route.query.redirect like signin does
Addresses Copilot review on #4149. The pricing CTA already set
?redirect=/pricing on /signup (Phase 0 fix cc6c585), but signup.view
silently dropped it — only signin.view:157 honored redirect. The
redirect param was therefore dead code from the signup CTA's POV.
Adds a pushAfterAuth() helper mirroring signin's pattern:
- typeof redirect === 'string' && redirect.startsWith('/') → push redirect
- otherwise → push config.sign.route
- typeof guard prevents arrays (?redirect=/a&redirect=/b); startsWith('/')
guard prevents open-redirect to external URLs.
5 call sites swapped to pushAfterAuth():
- watch.auth (orgs disabled branch)
- created() (already logged in + has org)
- validate() success, orgs enabled, no setup needed
- validate() success, orgs disabled
- proceedToApp() (end of org flow)
4 new unit tests (redirect honored / fallback / open-redirect guarded /
proceedToApp redirect). Total signup tests 25 → 29.1 parent acf5756 commit d1403ff
9 files changed
Lines changed: 203 additions & 146 deletions
File tree
- src/modules
- auth
- tests
- views
- billing
- components
- config
- tests
- views
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
333 | 334 | | |
334 | 335 | | |
335 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
336 | 423 | | |
337 | 424 | | |
338 | 425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
281 | 292 | | |
282 | 293 | | |
283 | 294 | | |
| |||
320 | 331 | | |
321 | 332 | | |
322 | 333 | | |
323 | | - | |
| 334 | + | |
324 | 335 | | |
325 | 336 | | |
326 | 337 | | |
327 | | - | |
| 338 | + | |
328 | 339 | | |
329 | 340 | | |
330 | 341 | | |
| |||
379 | 390 | | |
380 | 391 | | |
381 | 392 | | |
382 | | - | |
| 393 | + | |
383 | 394 | | |
384 | 395 | | |
385 | 396 | | |
| |||
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
34 | | - | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
137 | 147 | | |
138 | 148 | | |
139 | 149 | | |
140 | 150 | | |
| 151 | + | |
141 | 152 | | |
142 | 153 | | |
143 | 154 | | |
| |||
Lines changed: 6 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | | - | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 51 | | |
59 | 52 | | |
60 | 53 | | |
| |||
0 commit comments