Skip to content

Fix cookie consent, extract billing/shop modules - #453

Merged
ddon merged 15 commits into
BeamLabEU:devfrom
timujinne:legal-cookie-consent-fix
Mar 27, 2026
Merged

Fix cookie consent, extract billing/shop modules#453
ddon merged 15 commits into
BeamLabEU:devfrom
timujinne:legal-cookie-consent-fix

Conversation

@timujinne

@timujinne timujinne commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix cookie consent widget: dynamic legal links, theme-aware backdrop, daisyUI toggle
  • Extract billing module to phoenix_kit_billing package
  • Extract shop module to phoenix_kit_ecommerce package
  • Add Estonian to backend languages, fix Chinese language code zh-CN → zh
  • Add CountryData utility to core for billing extraction support

Changes

Cookie Consent Fix

  • Dynamic legal page links derived from published pages instead of hardcoded URLs
  • Theme-aware glass-morphic backdrop with proper dark mode support
  • Replace custom CSS toggle with native daisyUI toggle toggle-primary component
  • Add legal_index_url to consent widget config

Billing Extraction

  • Remove billing UI components from core (moved to phoenix_kit_billing)
  • Decouple billing from core: routes, auth, cart, module registry
  • Remove billing module code (extracted to external package)

Shop Extraction

  • Remove shop module from core (extracted to phoenix_kit_ecommerce)
  • Fix shop modules: remove billing struct patterns and fix nil clause ordering
  • Shop routes now loaded dynamically via safe_route_call

Merge with upstream/dev

  • Resolved 11 conflicts from upstream changes (comments extraction, V88 migration, generators)
  • Updated tests to reflect extracted modules
  • Added dialyzer ignores for extracted module references

Test Plan

  • mix compile --warnings-as-errors passes
  • mix format clean
  • mix credo --strict no issues
  • mix dialyzer passes
  • 200 unit tests pass, 0 failures

Merge dev → main: Fix SeedTemplates System.halt
…I toggle

- Replace hardcoded cookie/privacy URLs with Routes.path() to fix double-slash bug
- Add dynamic legal_links from published pages + single /legal index link
- Use bg-base-100/70 backdrop instead of bg-black for light/dark theme compatibility
- Improve glass opacity (0.95→0.98), card bg (50→80%), text contrast
- Replace custom toggle with standard daisyUI toggle toggle-primary
…rdering

- Replace %Currency{} struct matches with plain variables (cross-package dep)
- Replace %PaymentOption{} struct matches with %{} map patterns
- Move nil clauses before catch-all in format_price/2 functions
- Fix alias ordering for CountryData (Utils.* after Modules.*)
- Cross-package Billing references will resolve when phoenix_kit_billing dep added
- Add Estonian (et) to the default admin panel language list
- Fix Chinese language code from zh-CN to zh for consistency
  (all backend language codes should be two-letter ISO 639-1)
…age)

- Delete lib/modules/shop/ (63 files), routes/shop.ex, mix task
- Remove Shop from internal_modules in module_registry
- Update integration.ex: conditional shop pipeline, safe_route_call for
  admin routes, Code.ensure_loaded? guards for public/authenticated routes
- Update users/auth.ex: guard maybe_merge_guest_cart with ensure_loaded?
- Add @compile no_warn_undefined for cross-package Shop references
- Add admin_locale_routes to emails routes to avoid alias conflicts
- Fix safe_route_call to silently handle :nofile and :unavailable
- Add dialyzer ignore for extracted module references in integration.ex
# Conflicts:
#	.dialyzer_ignore.exs
#	lib/modules/billing/billing.ex
#	lib/modules/legal/legal.ex
#	lib/modules/shop/web/catalog_category.ex
#	lib/modules/shop/web/catalog_product.ex
#	lib/modules/sync/web/connections_live.ex
#	lib/phoenix_kit/module_registry.ex
#	lib/phoenix_kit_web/components/core/cookie_consent.ex
#	lib/phoenix_kit_web/integration.ex
#	lib/phoenix_kit_web/live/modules.html.heex
#	lib/phoenix_kit_web/routes/emails.ex
@timujinne timujinne changed the title Extract Billing module into phoenix_kit_billing package Fix cookie consent, extract billing/shop modules Mar 26, 2026
@ddon
ddon merged commit ce7da9d into BeamLabEU:dev Mar 27, 2026
6 checks passed
ddon added a commit that referenced this pull request Mar 27, 2026
…language naming

- Add Code.ensure_loaded? guard to delete_user_shop_carts/1 (runtime crash without Shop package)
- Add missing legal_links and legal_index_url attrs to root.html.heex consent component
- Render legal_links in cookie consent modal footer (attr was declared but never used)
- Sync JS consent widget glass opacity (0.95->0.98) and backdrop color (--bc->--b1) to match Elixir component
- Rename @top_10_languages to @default_languages (list has 13 items, not 10)
- Add PR #453 review documentation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants