From 25c79c4740f7f1b7c4a98d6a3fde339ed3cbb620 Mon Sep 17 00:00:00 2001 From: Samer Salameh Date: Thu, 12 Nov 2026 15:03:23 +0300 Subject: [PATCH] Navy dashboard headline banner; Arabic name for Madayn office job title Co-Authored-By: Claude Sonnet 5.5 --- src/features/dashboard/infographics.tsx | 4 ++-- src/i18n/roles.ts | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/features/dashboard/infographics.tsx b/src/features/dashboard/infographics.tsx index bfbe2d2..0f14510 100644 --- a/src/features/dashboard/infographics.tsx +++ b/src/features/dashboard/infographics.tsx @@ -377,7 +377,7 @@ export function Pictogram({ a, b, icons: [IconA, IconB] }: { a: Part; b: Part; i export function Hero({ icon: Icon, label, value, parts }: { icon: ElementType; label: string; value: number; parts: Part[] }) { return ( @@ -430,7 +430,7 @@ export function FleetInfographic({ data, lab, rtl }: { data: unknown; lab: Label sx={{ p: 2.5, color: '#fff', - background: 'linear-gradient(135deg, #0b6ea8 0%, #1b8fc9 55%, #2c98d4 100%)', + background: 'linear-gradient(135deg, #1e4a80 0%, #28599a 55%, #3366a8 100%)', position: 'relative', overflow: 'hidden', }} diff --git a/src/i18n/roles.ts b/src/i18n/roles.ts index 9afcb97..0b44ee5 100644 --- a/src/i18n/roles.ts +++ b/src/i18n/roles.ts @@ -2,6 +2,7 @@ // (the Users grid's profession column and a user's job title). Anything unknown still gets a readable form. const ROLES: Record = { MADAYN_FIN: { en: 'Madayn finance', ar: 'مدائن - المالية' }, + MADAYN_OFFICE: { en: 'Madayn office', ar: 'مكتب مدائن' }, FIN_MANAGER: { en: 'Finance manager', ar: 'مدير مالي' }, OPADMIN: { en: 'Operations administrator', ar: 'مسؤول العمليات' }, OPOFF: { en: 'Operations officer', ar: 'موظف العمليات' }, @@ -12,7 +13,11 @@ const looksLikeCode = (s: string) => /^[A-Z][A-Z0-9_]{2,}$/.test(s); /** The caption when the system has one, else our own bilingual name, else a readable form of the code. */ export function roleLabel(raw: string, caption: (k: string) => string, humanize: (k: string) => string, rtl: boolean) { const code = raw.trim(); - if (!looksLikeCode(code)) return raw; + if (!looksLikeCode(code)) { + // some sessions already carry the English name ("Madayn office") instead of the code: show our Arabic name for it + const named = rtl ? Object.values(ROLES).find((r) => r.en.toLowerCase() === code.toLowerCase()) : undefined; + return named ? named.ar : raw; + } if (caption(code) !== code) return caption(code); const own = ROLES[code]; return own ? (rtl ? own.ar : own.en) : humanize(code);