Phone App: finish the admin screen; translate the last English strings
Three loose ends from the last two commits, each of which was named as deliberately-not-done and none of which is worth carrying further. The phone's create-user sheet had no organization picker. The endpoint has taken an `organization` since orgs existed and the Web App has offered the choice all along, so a superadmin on the phone could only ever create accounts in their own org - a silent restriction rather than a stated one. The sheet now loads the orgs and offers them to a superadmin, with the same blank "no organization" option and the same hint as the web. An admin still gets no picker, because the server forces its own org on their members and a picker that cannot change the outcome is a lie. The listing is manager-only and can fail, in which case the picker offers only "no organization" rather than blocking the form. A locked role picker or delete action was greyed out with no reason given. The web has explained itself in a title attribute since those guards existed, and the sentences - admin.cantChangeOwnRole and the rest - have been sitting translated in the phone's own language files since the screen was translated. Hover has no touch equivalent, so the two controls take different routes: a long-press on the role picker shows the reason as a tooltip, and the overflow menu carries it under the action, because a disabled menu item cannot be long-pressed and silently greying it out is the thing being fixed. settings.integrations.* and charging.control.* were English-only in *both* apps - 70 keys, identical text, identical key sets - so they are translated once and land in all four language files. OCPP and CSMS are protocol names and stay; product names (Toyota Connected, MyToyota, Anker Solix, Lexus) stay; everything else follows the wording already in each language's file. The Web App's files are edited as text rather than round-tripped through a JSON dump, because they keep a blank line before every nested block and a dump flattens it - a 900-line translation file is hard enough to read without losing its paragraphs. Both diffs are purely additive as a result. Both apps now have every key in all three languages: 738 in the web, and the phone reports zero fallbacks. A new test locks that in - every key en.json carries must exist in pl.json and da.json - and it was checked by deleting a key and watching it fail, because a guard that cannot fire is not a guard. Verified by flutter analyze (clean), flutter test - 21 pass, 1 of them new - flutter build apk --debug, and npm run build for the Web App. The key checker reports 575 static t() keys in the phone and 738 in the web resolving with no fallbacks in either language. Not verified: still nothing run against a live API Server or on a device. In particular the organization picker's happy path - a superadmin creating an account into a chosen org - has not been exercised end to end; it is the one piece here that touches the API rather than only the language files. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4372b870ac
commit
dc6febf815
9 files changed
+508
-43
No files matched your search
+8
-4
@@ -89,7 +89,11 @@ navigation bar** — Garage, Charging, Settings, and Users for admins — in an
|
||||
asks first, with the number of cars the file actually holds. Auth relays PocketBase's own stateless
|
||||
tokens, so there is no per-device session list to show or revoke.
|
||||
- **Users (admin)** — user management tab (list / create / role / reset password
|
||||
/ delete), shown only for the admin role.
|
||||
/ delete), shown only for the admin role. A blocked control says why rather
|
||||
than only greying out: long-press a locked role picker, and the overflow menu
|
||||
carries the reason under the action. Superadmins also choose which
|
||||
organization a new account lands in (or none at all); an admin gets no picker,
|
||||
because the server puts their members in their own organization regardless.
|
||||
|
||||
Sharing/ownership: `Car.access` drives `isOwner` / `canWrite` / `isReadOnly`
|
||||
getters that gate the UI, mirroring the server's access checks.
|
||||
@@ -115,9 +119,9 @@ tag the phone cannot render can still arrive from the web. `format.dart` resolve
|
||||
through a supported-language check and falls back to `en-US` instead of throwing;
|
||||
`test/models_format_test.dart` covers it.
|
||||
|
||||
Every screen reads its text from the language files. The one gap left is the
|
||||
Integrations and charger-control strings, which the web app shares — so it
|
||||
belongs to both apps at once. See [TRANSLATIONS.md](../TRANSLATIONS.md).
|
||||
Every screen reads its text from the language files, and `flutter test` fails if
|
||||
a key exists in English but not in Polish or Danish. See
|
||||
[TRANSLATIONS.md](../TRANSLATIONS.md).
|
||||
|
||||
## Biometric / face sign-in & app lock
|
||||
|
||||
|
||||
Reference in new issue
Block a user