feat: multi-module improvements across merchant, store, i18n, and customer systems
All checks were successful
CI / ruff (push) Successful in 12s
CI / pytest (push) Successful in 50m57s
CI / validate (push) Successful in 24s
CI / dependency-scanning (push) Successful in 29s
CI / docs (push) Successful in 40s
CI / deploy (push) Successful in 51s

- Fix platform-grouped merchant sidebar menu with core items at root level
- Add merchant store management (detail page, create store, team page)
- Fix store settings 500 error by removing dead stripe/API tab
- Move onboarding translations to module-owned locale files
- Fix onboarding banner i18n with server-side rendering + context inheritance
- Refactor login language selectors to use languageSelector() function (LANG-002)
- Move HTTPException handling to global exception handler in merchant routes (API-003)
- Add language selector to all login pages and portal headers
- Fix customer module: drop order stats from customer model, add to orders module
- Fix admin menu config visibility for super admin platform context
- Fix storefront auth and layout issues
- Add missing i18n translations for onboarding steps (en/fr/de/lb)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 23:48:25 +01:00
parent f141cc4e6a
commit a77a8a3a98
113 changed files with 3741 additions and 2923 deletions

View File

@@ -20,10 +20,14 @@
</div>
<ul class="flex items-center flex-shrink-0 space-x-6">
<!-- Platform Context Indicator (for platform admins) -->
<!-- Platform Context Indicator -->
<li class="flex" x-data="platformContext()">
<template x-if="platform && !isSuperAdmin">
<!-- Super Admin + Platform selected -->
<template x-if="isSuperAdmin && platform">
<div class="flex items-center space-x-2">
<span class="px-3 py-1 text-xs font-medium text-green-700 bg-green-100 dark:text-green-300 dark:bg-green-900/30 rounded-full">
Super Admin
</span>
<span class="px-3 py-1 text-xs font-medium text-purple-700 bg-purple-100 dark:text-purple-300 dark:bg-purple-900/30 rounded-full">
<span x-text="platform.name"></span>
</span>
@@ -34,10 +38,31 @@
</a>
</div>
</template>
<template x-if="isSuperAdmin">
<span class="px-3 py-1 text-xs font-medium text-green-700 bg-green-100 dark:text-green-300 dark:bg-green-900/30 rounded-full">
Super Admin
</span>
<!-- Super Admin + Global mode (no platform) -->
<template x-if="isSuperAdmin && !platform">
<div class="flex items-center space-x-2">
<span class="px-3 py-1 text-xs font-medium text-green-700 bg-green-100 dark:text-green-300 dark:bg-green-900/30 rounded-full">
Super Admin (Global)
</span>
<a href="/admin/select-platform"
class="text-xs text-gray-500 hover:text-purple-600 dark:text-gray-400 dark:hover:text-purple-400"
title="Switch platform">
<span x-html="$icon('switch-horizontal', 'w-4 h-4')"></span>
</a>
</div>
</template>
<!-- Platform Admin -->
<template x-if="!isSuperAdmin && platform">
<div class="flex items-center space-x-2">
<span class="px-3 py-1 text-xs font-medium text-purple-700 bg-purple-100 dark:text-purple-300 dark:bg-purple-900/30 rounded-full">
<span x-text="platform.name"></span>
</span>
<a href="/admin/select-platform"
class="text-xs text-gray-500 hover:text-purple-600 dark:text-gray-400 dark:hover:text-purple-400"
title="Switch platform">
<span x-html="$icon('switch-horizontal', 'w-4 h-4')"></span>
</a>
</div>
</template>
</li>
@@ -55,10 +80,11 @@
<button
@click="isLangOpen = !isLangOpen"
@click.outside="isLangOpen = false"
class="p-1 rounded-md focus:outline-none focus:shadow-outline-purple"
class="inline-flex items-center gap-1 p-1 rounded-md focus:outline-none focus:shadow-outline-purple"
aria-label="Change language"
>
<span class="fi text-lg" :class="'fi-' + languageFlags[currentLang]"></span>
<span x-html="$icon('globe-alt', 'w-5 h-5')"></span>
<span class="text-xs font-semibold text-gray-600 dark:text-gray-300 uppercase" x-text="currentLang"></span>
</button>
<div
x-show="isLangOpen"
@@ -263,7 +289,7 @@ function platformContext() {
if (storedUser) {
try {
const user = JSON.parse(storedUser);
this.isSuperAdmin = user.role === 'super_admin';
this.isSuperAdmin = user.is_super_admin === true || user.role === 'super_admin';
} catch (e) {
console.warn('Failed to parse stored user:', e);
}

View File

@@ -31,10 +31,11 @@
<button
@click="isLangOpen = !isLangOpen"
@click.outside="isLangOpen = false"
class="p-1 rounded-md focus:outline-none focus:shadow-outline-purple"
class="inline-flex items-center gap-1 p-1 rounded-md focus:outline-none focus:shadow-outline-purple"
aria-label="Change language"
>
<span class="fi text-lg" :class="'fi-' + languageFlags[currentLang]"></span>
<span x-html="$icon('globe-alt', 'w-5 h-5')"></span>
<span class="text-xs font-semibold text-gray-600 dark:text-gray-300 uppercase" x-text="currentLang"></span>
</button>
<div
x-show="isLangOpen"

View File

@@ -52,7 +52,13 @@
@click="toggleSection(section.id)"
class="flex items-center justify-between w-full px-6 py-2 text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wider hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors"
>
<span class="flex items-center" x-text="section.label"></span>
<span class="flex items-center">
<span x-show="section.icon" x-html="$icon(section.icon, 'w-4 h-4 mr-2')" class="opacity-60"></span>
<span x-text="section.label"></span>
<span x-show="section.platform_code"
class="ml-2 px-1.5 py-0.5 text-[10px] font-medium rounded bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-300 normal-case"
x-text="section.platform_code?.toUpperCase()"></span>
</span>
<span
x-html="$icon('chevron-down', 'w-4 h-4 transition-transform duration-200')"
:class="{ 'rotate-180': openSections[section.id] }"

View File

@@ -86,10 +86,11 @@
@click="isOpen = !isOpen"
@click.outside="isOpen = false"
type="button"
class="p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors"
class="inline-flex items-center gap-1 p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors"
:class="{ 'bg-gray-100 dark:bg-gray-700': isOpen }"
>
<span class="fi text-lg" :class="'fi-' + flags[currentLang]"></span>
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"/></svg>
<span class="text-xs font-semibold uppercase" x-text="currentLang"></span>
</button>
<div
x-show="isOpen"

View File

@@ -355,13 +355,13 @@
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<span x-html="$icon('rocket', 'w-5 h-5 text-purple-600 dark:text-purple-400')"></span>
<h3 class="text-lg font-semibold text-gray-900 dark:text-white" x-text="t('onboarding.banner.title')">Get Started</h3>
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">{{ _("onboarding.banner.title") }}</h3>
<span class="text-sm text-gray-500 dark:text-gray-400"
x-text="`${completedSteps}/${totalSteps}`"></span>
</div>
<button @click="dismiss()"
class="text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors"
:title="t('onboarding.banner.dismiss')">
title="{{ _("onboarding.banner.dismiss") }}">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>

View File

@@ -69,7 +69,8 @@
class="inline-flex items-center gap-2 px-3 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500 transition-colors"
:class="{ 'ring-2 ring-purple-500 ring-offset-2': isLangOpen }"
>
<span class="fi" :class="'fi-' + languageFlags[currentLang]"></span>
<span x-html="$icon('globe-alt', 'w-5 h-5')"></span>
<span class="text-xs font-semibold uppercase" x-text="currentLang"></span>
{% if show_label %}
<span x-text="languageNames[currentLang]" class="hidden sm:inline"></span>
{% endif %}
@@ -130,11 +131,12 @@
@click="isLangOpen = !isLangOpen"
@click.outside="isLangOpen = false"
type="button"
class="p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors focus:outline-none"
class="inline-flex items-center gap-1 p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors focus:outline-none"
:class="{ 'text-gray-700 dark:text-white bg-gray-100 dark:bg-gray-700': isLangOpen }"
title="Change language"
>
<span class="fi text-lg" :class="'fi-' + languageFlags[currentLang]"></span>
<span x-html="$icon('globe-alt', 'w-5 h-5')"></span>
<span class="text-xs font-semibold uppercase" x-text="currentLang"></span>
</button>
<div

View File

@@ -41,10 +41,11 @@
<button
@click="isLangOpen = !isLangOpen"
@click.outside="isLangOpen = false"
class="p-1 rounded-md focus:outline-none focus:shadow-outline-purple"
class="inline-flex items-center gap-1 p-1 rounded-md focus:outline-none focus:shadow-outline-purple"
aria-label="Change language"
>
<span class="fi text-lg" :class="'fi-' + languageFlags[currentLang]"></span>
<span x-html="$icon('globe-alt', 'w-5 h-5')"></span>
<span class="text-xs font-semibold text-gray-600 dark:text-gray-300 uppercase" x-text="currentLang"></span>
</button>
<div
x-show="isLangOpen"

View File

@@ -150,10 +150,11 @@
<button
@click="isLangOpen = !isLangOpen"
@click.outside="isLangOpen = false"
class="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700"
class="inline-flex items-center gap-1 p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700"
aria-label="Change language"
>
<span class="fi text-lg" :class="'fi-' + languageFlags[currentLang]"></span>
<span x-html="$icon('globe-alt', 'w-5 h-5')"></span>
<span class="text-xs font-semibold uppercase" x-text="currentLang"></span>
</button>
<div
x-show="isLangOpen"