fix(auth)+feat(cli): Create User dialog — translatable action params (#3030) and explicit-password-wins semantics (#3031)#3033
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 3 package(s): 23 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…nslations (#3030) `os i18n extract` never walked `actions[].params`, so the `o.<object>._actions.<action>.params.*` keys the console client already resolves were absent from generated bundles — action dialogs (Setup → Create User, Set Password, Ban…) rendered raw English under any locale. - collectExpectedEntries now emits inline-param label/helpText/placeholder/ options (field-backed params only when they carry a literal override), for object actions and top-level actions alike. - Regenerate the en/zh-CN/ja-JP/es-ES bundles in platform-objects and fill the new key groups; a second `--merge` pass is idempotent.
…r/set-password (#3031) The console Create User dialog defaults `generatePassword: true` and labels the password input "leave empty to generate" — so typing a password sent both and the endpoint 400'd ("Provide either password or generatePassword, not both"), making the most natural flow always fail. The param `visible` CEL can't see other params' live values, so the dialog can't uncheck the box client-side. resolvePassword now treats an explicit non-empty password as an unambiguous override: use it (complexity-checked, no temporaryPassword in the response); generate only when the password is empty and generatePassword is true. Applies to create-user and set-password alike.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3030, closes #3031.
Two fixes for the Setup app Create User flow (and every other action param dialog), split into one commit each:
1. feat(cli): extract action param i18n keys + fill translations (#3030)
os i18n extractnever walkedactions[].params, so theo.<object>._actions.<action>.params.*keys the console client already resolves were absent from generated bundles — the dialog rendered raw English underzh-CN/ja-JP/es-ES.collectExpectedEntries(packages/cli/src/utils/i18n-extract.ts) now emits inline-paramlabel/helpText/placeholder/options.<value>— for object actions and top-level actions. Field-backed params ({ field: '…' }) are skipped unless they carry a literal override, since field translations cover them at runtime.variables.*form keys). A second--mergepass is idempotent (zero diff).@objectstack/climinor,@objectstack/platform-objectspatch.Verified in the showcase: with
zh-CNactive the Create User dialog renders fully in Chinese.2. fix(auth): explicit password overrides
generatePassword(#3031)The dialog defaults
generatePassword: trueand labels the password input "Password (leave empty to generate)" — so typing a password sent both flags and the endpoint 400'd ("Provide either password or generatePassword, not both"): the most natural flow always failed. The paramvisibleCEL scope can't reference other params' live values, so this can't be fixed client-side.resolvePassword(packages/plugins/plugin-auth/src/admin-user-endpoints.ts) now treats an explicit non-empty password as an unambiguous override:temporaryPasswordnot returned;generatePassword: true→ temporary password generated (unchanged);Applies to both
create-userandset-password(newPassword). Backward compatible — the only change is that a previously-rejected request now succeeds with the intent the label promised. Pure bug fix, no changeset.Testing
plugin-authunit tests: 32/32 (new: explicit-password-wins, empty-password-still-generates).clii18n-extract tests extended for param extraction (inline vs field-backed, global actions).temporaryPassword.Related client-side crash on this 400 (error envelope →
toast.error→ React #31) is fixed separately in objectstack-ai/objectui#2579.