Bernt Christian Egeland 5 месяцев назад
Родитель
Сommit
3d72f2b4b4

+ 5 - 0
messages/de/portal.json

@@ -7,6 +7,11 @@
     "noResults": "Keine Werkstatt entspricht Ihrer Suche.",
     "openPortal": "Portal öffnen"
   },
+  "directLink": {
+    "title": "Kundenportal",
+    "description": "Bitte verwenden Sie den direkten Link Ihrer Werkstatt, um auf das Kundenportal zuzugreifen.",
+    "hint": "Ihre Werkstatt wird Ihnen den Portal-Link per E-Mail oder SMS mitteilen."
+  },
   "landing": {
     "contactTitle": "Kontakt",
     "aboutTitle": "Über uns",

+ 5 - 0
messages/en/portal.json

@@ -7,6 +7,11 @@
     "noResults": "No workshops match your search.",
     "openPortal": "Open portal"
   },
+  "directLink": {
+    "title": "Customer Portal",
+    "description": "Please use the direct link provided by your workshop to access the customer portal.",
+    "hint": "Your workshop will share the portal link with you via email or SMS."
+  },
   "landing": {
     "contactTitle": "Contact us",
     "aboutTitle": "About us",

+ 5 - 0
messages/es/portal.json

@@ -7,6 +7,11 @@
     "noResults": "Ningún taller coincide con tu búsqueda.",
     "openPortal": "Abrir portal"
   },
+  "directLink": {
+    "title": "Portal de clientes",
+    "description": "Utiliza el enlace directo proporcionado por tu taller para acceder al portal de clientes.",
+    "hint": "Tu taller compartirá el enlace del portal contigo por correo electrónico o SMS."
+  },
   "landing": {
     "contactTitle": "Contáctanos",
     "aboutTitle": "Sobre nosotros",

+ 5 - 0
messages/fr/portal.json

@@ -7,6 +7,11 @@
     "noResults": "Aucun garage ne correspond à votre recherche.",
     "openPortal": "Ouvrir le portail"
   },
+  "directLink": {
+    "title": "Portail client",
+    "description": "Veuillez utiliser le lien direct fourni par votre garage pour accéder au portail client.",
+    "hint": "Votre garage vous communiquera le lien du portail par e-mail ou SMS."
+  },
   "landing": {
     "contactTitle": "Nous contacter",
     "aboutTitle": "À propos",

+ 5 - 0
messages/it/portal.json

@@ -7,6 +7,11 @@
     "noResults": "Nessuna officina corrisponde alla tua ricerca.",
     "openPortal": "Apri portale"
   },
+  "directLink": {
+    "title": "Portale clienti",
+    "description": "Utilizza il link diretto fornito dalla tua officina per accedere al portale clienti.",
+    "hint": "La tua officina condividerà il link del portale tramite e-mail o SMS."
+  },
   "landing": {
     "contactTitle": "Contattaci",
     "aboutTitle": "Chi siamo",

+ 5 - 0
messages/lt/portal.json

@@ -7,6 +7,11 @@
     "noResults": "Pagal jūsų paiešką nerasta dirbtuvių.",
     "openPortal": "Atidaryti portalą"
   },
+  "directLink": {
+    "title": "Klientų portalas",
+    "description": "Norėdami pasiekti klientų portalą, naudokite tiesioginę nuorodą, kurią gavote iš savo dirbtuvių.",
+    "hint": "Jūsų dirbtuvės pasidalins portalo nuoroda el. paštu arba SMS žinute."
+  },
   "landing": {
     "contactTitle": "Susisiekite su mumis",
     "aboutTitle": "Apie mus",

+ 5 - 0
messages/nb/portal.json

@@ -7,6 +7,11 @@
     "noResults": "Ingen verksteder samsvarer med søket.",
     "openPortal": "Åpne portal"
   },
+  "directLink": {
+    "title": "Kundeportal",
+    "description": "Bruk den direkte lenken fra verkstedet ditt for å få tilgang til kundeportalen.",
+    "hint": "Verkstedet ditt vil dele portallenken med deg via e-post eller SMS."
+  },
   "landing": {
     "contactTitle": "Kontakt oss",
     "aboutTitle": "Om oss",

+ 5 - 0
messages/nl/portal.json

@@ -7,6 +7,11 @@
     "noResults": "Geen werkplaatsen gevonden voor uw zoekopdracht.",
     "openPortal": "Portaal openen"
   },
+  "directLink": {
+    "title": "Klantenportaal",
+    "description": "Gebruik de directe link van uw werkplaats om toegang te krijgen tot het klantenportaal.",
+    "hint": "Uw werkplaats deelt de portaallink met u via e-mail of sms."
+  },
   "landing": {
     "contactTitle": "Neem contact op",
     "aboutTitle": "Over ons",

+ 5 - 0
messages/pl/portal.json

@@ -7,6 +7,11 @@
     "noResults": "Żaden warsztat nie pasuje do wyszukiwania.",
     "openPortal": "Otwórz portal"
   },
+  "directLink": {
+    "title": "Portal klienta",
+    "description": "Użyj bezpośredniego linku podanego przez Twój warsztat, aby uzyskać dostęp do portalu klienta.",
+    "hint": "Twój warsztat udostępni Ci link do portalu e-mailem lub SMS-em."
+  },
   "landing": {
     "contactTitle": "Skontaktuj się z nami",
     "aboutTitle": "O nas",

+ 5 - 0
messages/pt-BR/portal.json

@@ -7,6 +7,11 @@
     "noResults": "Nenhuma oficina corresponde à sua busca.",
     "openPortal": "Abrir portal"
   },
+  "directLink": {
+    "title": "Portal do cliente",
+    "description": "Use o link direto fornecido pela sua oficina para acessar o portal do cliente.",
+    "hint": "Sua oficina compartilhará o link do portal com você por e-mail ou SMS."
+  },
   "landing": {
     "contactTitle": "Fale conosco",
     "aboutTitle": "Sobre nós",

+ 5 - 0
messages/ru/portal.json

@@ -7,6 +7,11 @@
     "noResults": "По вашему запросу мастерские не найдены.",
     "openPortal": "Открыть портал"
   },
+  "directLink": {
+    "title": "Портал клиента",
+    "description": "Используйте прямую ссылку от вашей мастерской для доступа к порталу клиента.",
+    "hint": "Ваша мастерская отправит вам ссылку на портал по электронной почте или SMS."
+  },
   "landing": {
     "contactTitle": "Связаться с нами",
     "aboutTitle": "О нас",

+ 5 - 0
messages/tr/portal.json

@@ -7,6 +7,11 @@
     "noResults": "Aramanızla eşleşen servis bulunamadı.",
     "openPortal": "Portalı aç"
   },
+  "directLink": {
+    "title": "Müşteri Portalı",
+    "description": "Müşteri portalına erişmek için servisinizden aldığınız doğrudan bağlantıyı kullanın.",
+    "hint": "Servisiniz portal bağlantısını e-posta veya SMS ile sizinle paylaşacaktır."
+  },
   "landing": {
     "contactTitle": "Bize ulaşın",
     "aboutTitle": "Hakkımızda",

+ 8 - 0
src/app/(public)/portal/page.tsx

@@ -1,14 +1,22 @@
 import { redirect } from 'next/navigation'
 import { db } from '@/lib/db'
+import { isCloudMode } from '@/lib/features'
 import { SETTING_KEYS } from '@/features/settings/Schema/settingsSchema'
 import {
   PortalDirectory,
   type PortalDirectoryEntry,
 } from '@/features/portal/Components/PortalDirectory'
+import { PortalDirectLink } from '@/features/portal/Components/PortalDirectLink'
 
 export const dynamic = 'force-dynamic'
 
 export default async function PortalIndexPage() {
+  // In cloud mode, don't expose a directory of all organizations.
+  // Customers should use the direct portal link provided by their workshop.
+  if (isCloudMode()) {
+    return <PortalDirectLink />
+  }
+
   // Fetch all orgs that have the portal enabled.
   const enabledOrgs = await db.organization.findMany({
     where: {

+ 21 - 0
src/features/portal/Components/PortalDirectLink.tsx

@@ -0,0 +1,21 @@
+'use client'
+
+import { useTranslations } from 'next-intl'
+import { Link2 } from 'lucide-react'
+
+export function PortalDirectLink() {
+  const t = useTranslations('portal.directLink')
+
+  return (
+    <div className="min-h-svh bg-muted/30">
+      <div className="mx-auto max-w-xl px-4 py-24 sm:px-6 sm:py-32 text-center">
+        <div className="mx-auto mb-6 flex h-16 w-16 items-center justify-center rounded-full bg-primary/10">
+          <Link2 className="h-8 w-8 text-primary" />
+        </div>
+        <h1 className="text-2xl font-bold tracking-tight sm:text-3xl">{t('title')}</h1>
+        <p className="mt-3 text-base text-muted-foreground sm:text-lg">{t('description')}</p>
+        <p className="mt-2 text-sm text-muted-foreground">{t('hint')}</p>
+      </div>
+    </div>
+  )
+}