From 79ca7fcb53990b8f7520f35a171f3a3c712a13b0 Mon Sep 17 00:00:00 2001 From: nfebe Date: Mon, 21 Sep 2026 11:23:58 +0100 Subject: [PATCH 1/2] feat(admin): Serve the admin console from the shared layer The console was a single page in this app, so every metric, column and drilldown it showed was hard-coded here and could not be reused. It now comes from the shared admin layer, with Trakli supplying its own brand, navigation, user columns and drilldown targets as configuration. Users can send feedback and read the status of what they sent, and admins triage it. Product analytics are collected once consent is given. --- .env.example | 2 +- assets/css/design-brand.css | 36 + components/TAvatar.vue | 11 +- components/admin/OutreachComposer.vue | 164 +--- components/auth/AuthSocialLogin.vue | 2 +- composables/useAuth.ts | 5 +- composables/useFeedback.ts | 31 + i18n/i18n.config.ts | 6 + i18n/locales/en.json | 147 ++-- middleware/admin.ts | 6 +- middleware/auth.ts | 8 +- nuxt.config.ts | 48 +- package-lock.json | 73 +- package.json | 3 + pages/admin/index.vue | 1109 ------------------------- pages/admin/outreach.vue | 95 +++ pages/budgets/index.vue | 10 +- pages/feedback.vue | 219 +++++ plugins/adminViewer.ts | 14 + plugins/engagement.client.ts | 24 + tests/assets/designBrand.test.ts | 57 ++ 21 files changed, 751 insertions(+), 1319 deletions(-) create mode 100644 assets/css/design-brand.css create mode 100644 composables/useFeedback.ts create mode 100644 i18n/i18n.config.ts delete mode 100644 pages/admin/index.vue create mode 100644 pages/admin/outreach.vue create mode 100644 pages/feedback.vue create mode 100644 plugins/adminViewer.ts create mode 100644 plugins/engagement.client.ts create mode 100644 tests/assets/designBrand.test.ts diff --git a/.env.example b/.env.example index e10ac81..233a110 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ NUXT_PUBLIC_API_BASE_URL=http://localhost:8000/api/v1 +NUXT_PUBLIC_ENGAGEMENT_SITE_KEY=trakli-dashboard # Real-time chat streaming (Laravel Reverb). Leave REVERB_KEY empty to run on # polling only. Host/port are where the browser reaches the Reverb server (the @@ -7,4 +8,3 @@ NUXT_PUBLIC_REVERB_KEY=your-reverb-app-key NUXT_PUBLIC_REVERB_HOST=localhost NUXT_PUBLIC_REVERB_PORT=6001 NUXT_PUBLIC_REVERB_SCHEME=http - diff --git a/assets/css/design-brand.css b/assets/css/design-brand.css new file mode 100644 index 0000000..bc321e9 --- /dev/null +++ b/assets/css/design-brand.css @@ -0,0 +1,36 @@ +/* + * Trakli's brand, expressed in the design system's brand contract. + * + * Only tokens listed in @whilesmart/design/tokens/brand.css belong here. Anything else the + * admin needs is derived from these, so one value changes the whole console. + * + * Every text pair here is held to 4.5:1 in both themes by a test. + */ + +:root { + --ds-brand-primary-50: #f0f5f2; + --ds-brand-primary-100: #d8e8e1; + --ds-brand-primary-200: #b6d8c9; + --ds-brand-primary-300: #89c8ab; + --ds-brand-primary-400: #57c192; + --ds-brand-primary-500: #27a56c; + --ds-brand-primary-600: #129158; + --ds-brand-primary-700: #09864e; + --ds-brand-primary-800: #047844; + --ds-brand-primary-900: #02502d; + + --ds-brand-secondary-50: #edf7f6; + --ds-brand-secondary-100: #d2efeb; + --ds-brand-secondary-200: #aae4dc; + --ds-brand-secondary-300: #78d9cc; + --ds-brand-secondary-400: #43d0bd; + --ds-brand-secondary-500: #24b29f; + --ds-brand-secondary-600: #189584; + --ds-brand-secondary-700: #0e8171; + --ds-brand-secondary-800: #07695c; + --ds-brand-secondary-900: #024b41; + + --ds-brand-font-sans: + 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, + sans-serif; +} diff --git a/components/TAvatar.vue b/components/TAvatar.vue index 1a8789f..39c33d7 100644 --- a/components/TAvatar.vue +++ b/components/TAvatar.vue @@ -25,6 +25,10 @@ {{ t('Admin') }} +