Settings: fold Users and Organization into the Settings tabs

The left rail is back to the three places you actually go — Garage,
Charging, Settings — and user management moves inside Settings as an
admin-only tab, next to a new Organization tab that used to be a card
buried in the personal settings. Tab order is Personal settings, Users,
Organization, Integrations. /admin redirects to /settings?tab=users so
old links keep working, and ?tab= picks the starting tab in general.

AdminUsers moves from views/ to components/ since it is a panel now, not
a route, and its page header becomes a section header like its
neighbours. The personal panel was split in two around the integrations
markup, which left no gap between the Profile and Privacy cards; it is
one block again.

Creating a user gets an organization picker for superadmins, defaulting
to "no organization" so an org-less account stays a deliberate choice.
Admins see no picker: the server pins their members to their own org
regardless, which users_test.go now covers along with both superadmin
paths.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
tajniak81andClaude Opus 5 committed 2026-08-17 17:38:54 +02:00
1 parent cd16d4383f
commit e373497958
10 files changed
+387 -151

No files matched your search

+12 -11
View File
@@ -21,7 +21,7 @@ server/ Go BFF: embeds web/dist, proxies /api -> API_BASE
web/ Vue 3 + Vite + Tailwind v4 source
src/
main.js app bootstrap
router.js /login, / (dashboard), /charging, /cars/:id, /settings, /admin
router.js /login, / (dashboard), /charging, /cars/:id, /settings
api.js the only place that calls the API Server (base URL resolution)
auth.js token/profile state, isAdmin
prefs.js theme/locale/date/font preferences -> <html>
@@ -29,12 +29,12 @@ web/ Vue 3 + Vite + Tailwind v4 source
lib/format.js date/km formatting + next-service status badges
lib/attachment.js upload / fetch / open a record's attached file
style.css Tailwind v4 entry (+ dark custom-variant)
App.vue layout shell + nav (Charging + Admin links when relevant)
App.vue layout shell + nav (Garage, Charging, Settings)
components/ Modal, AttachmentField, CarFormModal, ServiceFormModal,
TechnicalCheckFormModal, MaintenanceFormModal, FuelFormModal,
DocumentFormModal, ReminderFormModal, PartFormModal, ShareModal,
OrgManager, Logo
views/ Login, Dashboard, CarDetail, Charging, Settings, AdminUsers
OrgManager, AdminUsers, Logo
views/ Login, Dashboard, CarDetail, Charging, Settings
```
## Requirements
@@ -116,13 +116,14 @@ Config (`server/.env`, copy from `.env.example`):
- **Charging** — the EV charging screen for connected Anker Solix chargers:
live status and, in own/proxy control mode, start/stop and charge-limit
controls driven by the API Server's OCPP Central System.
- **Settings** — split into tabs: account (name / email verification / password),
appearance (theme light/dark/system, locale, date format, currency, font size),
profile (avatar, bio), **integrations** (Toyota, Anker Solix), **organization**
(create your own — which makes you its admin — or rename/delete the one you
administer), data **export/import**, and the account-deletion state machine.
- **Admin** — `/admin` user management (list / create / role / reset password /
delete), gated by the admin role via a router guard + nav link.
- **Settings** — split into tabs: *Personal settings* — account (name / email
verification / password), appearance (theme light/dark/system, locale, date
format, currency, font size), profile (avatar, bio), data **export/import**,
and the account-deletion state machine; *Integrations* (Toyota, Anker Solix);
*Users* for admins; and *Organization* (create your own — which makes you its
admin — or rename/delete the one you administer).
- **Users** — user management (list / create / role / reset password / delete)
as the admin-only Settings tab; `/admin` redirects there for old links.
- **Theming** — light/dark/system app-wide (Tailwind v4 class strategy); `prefs.js`
toggles `.dark` on `<html>` and applies the saved theme/locale/date/font.