From 611307a24b99c5f1c0f22117bb2e1986b939c558 Mon Sep 17 00:00:00 2001 From: Roo Date: Thu, 18 Jun 2026 07:58:30 +0000 Subject: [PATCH] =?UTF-8?q?darabol=C3=A1s=20el=C5=91tti=20=C3=A1llapot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../header/HeaderCompanySwitcher.vue | 17 ++++++- .../components/vehicle/VehicleCardCompact.vue | 3 +- .../vehicle/VehicleCardStandard.vue | 12 +++-- .../components/vehicle/VehiclePlateBadge.vue | 51 +++++++++++++++---- frontend/src/i18n/en.ts | 21 ++++++++ frontend/src/i18n/hu.ts | 21 ++++++++ frontend/src/layouts/PrivateLayout.vue | 15 +----- frontend/src/views/DashboardView.vue | 20 ++++---- 8 files changed, 120 insertions(+), 40 deletions(-) diff --git a/frontend/src/components/header/HeaderCompanySwitcher.vue b/frontend/src/components/header/HeaderCompanySwitcher.vue index a395df4..379880e 100644 --- a/frontend/src/components/header/HeaderCompanySwitcher.vue +++ b/frontend/src/components/header/HeaderCompanySwitcher.vue @@ -10,7 +10,7 @@ - {{ t('header.garageSelector') }} + {{ activeGarageName }} { return route.path.startsWith('/organization/') }) +// ── Active garage name for the button label ──────────────────────── +const activeGarageName = computed(() => { + // If on a company garage route, show the active org name + if (isOnCompanyGarage.value && authStore.user?.active_organization_id) { + const activeOrg = authStore.myOrganizations.find( + (org) => org.organization_id === authStore.user?.active_organization_id + ) + if (activeOrg) { + return activeOrg.display_name || activeOrg.name || `${t('header.companyPrefix')} #${activeOrg.organization_id}` + } + } + // Default: show personal garage label + return t('header.garageSelector') +}) + // ── Check if org is the active one ───────────────────────────────── function isActiveOrg(org: OrganizationItem): boolean { return authStore.user?.active_organization_id === org.organization_id diff --git a/frontend/src/components/vehicle/VehicleCardCompact.vue b/frontend/src/components/vehicle/VehicleCardCompact.vue index 1116d79..3c4b107 100644 --- a/frontend/src/components/vehicle/VehicleCardCompact.vue +++ b/frontend/src/components/vehicle/VehicleCardCompact.vue @@ -3,13 +3,14 @@ class="flex items-center gap-3 p-2 hover:bg-slate-50 rounded-lg cursor-pointer transition-colors" @click="$emit('click', vehicle)" > - +
diff --git a/frontend/src/components/vehicle/VehicleCardStandard.vue b/frontend/src/components/vehicle/VehicleCardStandard.vue index d242c90..e6e5acb 100644 --- a/frontend/src/components/vehicle/VehicleCardStandard.vue +++ b/frontend/src/components/vehicle/VehicleCardStandard.vue @@ -27,7 +27,7 @@ - Nincs feltöltött fotó + {{ t('vehicle.noPhoto') }}
@@ -55,9 +55,10 @@

- + @@ -110,7 +111,7 @@ - Következő Szerviz: {{ vehicle.nextService || 'Nincs adat' }} + {{ t('vehicle.nextService') }}: {{ vehicle.nextService || t('vehicle.noData') }} @@ -122,7 +123,7 @@ ? 'bg-amber-400 text-white hover:bg-amber-500' : 'bg-white/60 text-slate-300 opacity-0 group-hover:opacity-100 hover:text-amber-400 hover:bg-white/90'" @click.stop="$emit('set-primary', vehicle)" - :title="vehicle.is_primary ? 'Elsődleges jármű' : 'Beállítás elsődlegessé'" + :title="vehicle.is_primary ? t('vehicle.primaryVehicle') : t('vehicle.setPrimary')" > @@ -143,9 +144,12 @@
@@ -20,12 +20,24 @@ {{ countryCode || 'H' }}
- + +
- {{ licensePlate }} + + + {{ brand }} + + + + {{ licensePlate }} +
@@ -35,6 +47,7 @@ import { computed } from 'vue' const props = withDefaults(defineProps<{ licensePlate: string + brand?: string countryCode?: string size?: 'sm' | 'md' | 'lg' }>(), { @@ -52,9 +65,9 @@ const containerClasses = computed(() => { const bandClasses = computed(() => { switch (props.size) { - case 'sm': return 'w-5 h-6 py-0.5' - case 'lg': return 'w-10 h-14 py-1' - default: return 'w-8 h-10 py-0.5' + case 'sm': return 'w-5 py-0.5' + case 'lg': return 'w-10 py-1' + default: return 'w-8 py-0.5' } }) @@ -76,9 +89,25 @@ const codeClasses = computed(() => { const plateClasses = computed(() => { switch (props.size) { - case 'sm': return 'h-6 px-1.5 text-[10px]' - case 'lg': return 'h-14 px-2 text-base' - default: return 'h-10 px-1 text-sm' + case 'sm': return 'h-6 px-1.5 pt-0 pb-0.5' + case 'lg': return 'h-14 px-2 pt-1 pb-1' + default: return 'h-10 px-1.5 pt-0.5 pb-0.5' + } +}) + +const brandTextClasses = computed(() => { + switch (props.size) { + case 'sm': return 'text-[7px]' + case 'lg': return 'text-[11px]' + default: return 'text-[9px]' + } +}) + +const numberClasses = computed(() => { + switch (props.size) { + case 'sm': return 'text-[10px]' + case 'lg': return 'text-base' + default: return 'text-sm' } }) diff --git a/frontend/src/i18n/en.ts b/frontend/src/i18n/en.ts index 449d0dc..8f49947 100644 --- a/frontend/src/i18n/en.ts +++ b/frontend/src/i18n/en.ts @@ -94,6 +94,21 @@ export default { achievements: 'Achievements', detailedView: 'Detailed View', modalPlaceholder: 'Content for this section will be available soon.', + // ── Dashboard Card 2: Costs & Quick Actions ── + costsTitle: 'Costs & Quick Actions', + vehicle: 'Vehicle', + selectVehicle: 'Select a vehicle', + noVehicleSelected: 'No vehicle selected. Add a vehicle first!', + recordFueling: 'Record Fueling', + parkingToll: 'Parking / Toll', + additionalCosts: 'Additional Costs', + findServicePartners: 'Find reliable service partners', + allVehicles: 'All Vehicles', + // ── Dashboard Card 5: Profile & Trust ── + viewProfile: 'View Profile', + trustScore: 'Trust Score', + notifications: 'Notifications', + settings: 'Settings', }, finance: { wallet: 'Wallet', @@ -498,6 +513,12 @@ export default { edit_title: 'Edit Vehicle', add_title: 'Add New Vehicle', features_hint: 'Select the vehicle equipment and extra options.', + // ── Vehicle Card ── + noPhoto: 'No photo uploaded', + nextService: 'Next Service', + noData: 'No data', + primaryVehicle: 'Primary vehicle', + setPrimary: 'Set as primary', // Fuel types fuelTypes: { benzin: 'Petrol', diff --git a/frontend/src/i18n/hu.ts b/frontend/src/i18n/hu.ts index 8bee184..1594255 100644 --- a/frontend/src/i18n/hu.ts +++ b/frontend/src/i18n/hu.ts @@ -94,6 +94,21 @@ export default { achievements: 'Eredmények', detailedView: 'Részletes Nézet', modalPlaceholder: 'A szekció tartalma hamarosan elérhető lesz.', + // ── Dashboard Card 2: Costs & Quick Actions ── + costsTitle: 'Költségek & Gyorsműveletek', + vehicle: 'Jármű', + selectVehicle: 'Válassz járművet', + noVehicleSelected: 'Nincs kiválasztva jármű. Adj hozzá egy járművet először!', + recordFueling: 'Tankolás rögzítése', + parkingToll: 'Parkolás / Útdíj', + additionalCosts: 'További költségek', + findServicePartners: 'Keress megbízható szervizpartnereket', + allVehicles: 'Összes jármű', + // ── Dashboard Card 5: Profile & Trust ── + viewProfile: 'Profil megtekintése', + trustScore: 'Bizalmi pontszám', + notifications: 'Értesítések', + settings: 'Beállítások', }, finance: { wallet: 'Pénztárca', @@ -498,6 +513,12 @@ export default { edit_title: 'Jármű szerkesztése', add_title: 'Új jármű hozzáadása', features_hint: 'Válaszd ki a jármű felszereltségét és extra opcióit.', + // ── Vehicle Card ── + noPhoto: 'Nincs feltöltött fotó', + nextService: 'Következő Szerviz', + noData: 'Nincs adat', + primaryVehicle: 'Elsődleges jármű', + setPrimary: 'Beállítás elsődlegessé', // Fuel types fuelTypes: { benzin: 'Benzin', diff --git a/frontend/src/layouts/PrivateLayout.vue b/frontend/src/layouts/PrivateLayout.vue index dc82f81..6d6ce47 100644 --- a/frontend/src/layouts/PrivateLayout.vue +++ b/frontend/src/layouts/PrivateLayout.vue @@ -7,10 +7,7 @@