Skip to content

Fix entities multilang and permissions review issues#349

Open
mdon wants to merge 3 commits intoBeamLabEU:devfrom
mdon:dev
Open

Fix entities multilang and permissions review issues#349
mdon wants to merge 3 commits intoBeamLabEU:devfrom
mdon:dev

Conversation

@mdon
Copy link

@mdon mdon commented Feb 18, 2026

Summary

Changes

Entities Multilang

  • Fix rekey_primary/2 to strip old primary to overrides and recompute all secondary languages against the new promoted primary
  • Move title translations from metadata["translations"] into JSONB data column as _title key, unifying with other field translations
  • Add seed_title_in_data for lazy backwards-compat migration on mount
  • Fix set_title_translation/3 to merge _title into existing data instead of replacing
  • Disable slug generation button on secondary language tabs
  • Remove unused timestamp fields from spectator cast
  • Wrap 9 validation error messages in gettext for i18n
  • Update OVERVIEW.md, DEEP_DIVE.md, and multilang.ex docs
  • Add 12 title translation tests and 7 updated rekey tests
  • Fix docs namespace (PhoenixKit.Entities to PhoenixKit.Modules.Entities)
  • Replace String.to_existing_atom with compile-time @preserve_fields map
  • Add 4 tests for maybe_rekey_data/1

Permissions (PR #341 follow-up)

  • Return error atoms from can_edit_role_permissions? and translate with gettext at call sites
  • Allow system role users to edit roles they also hold (Admin+Editor can edit Editor)
  • Sort custom_keys/0 explicitly instead of relying on Erlang map ordering
  • Add catch-all fallback clauses to Scope functions to prevent FunctionClauseError
  • Use UUID instead of integer ID in auto_grant_to_admin_roles
  • Fix custom keys two-column grid layout with CSS columns

Max Don and others added 3 commits February 18, 2026 02:06
…_data tests

- Fix PhoenixKit.Entities → PhoenixKit.Modules.Entities in DEEP_DIVE.md (88), OVERVIEW.md (14), README.md (5)
- Fix field type count 11 → 12 and clarify file vs image registration status
- Fix utc_datetime_usec → utc_datetime in DEEP_DIVE.md schema docs
- Fix inconsistent Routes.locale_aware_path → Routes.path in data_navigator.ex
- Replace String.to_existing_atom with compile-time @preserve_fields map in data_form.ex
- Add 4 tests for maybe_rekey_data/1 (rekey on mismatch, no-op, flat data, nil)
- Return error atoms from can_edit_role_permissions? and translate with
  gettext at LiveView call sites instead of hardcoded English strings
- Allow system role users to edit roles they also hold (Admin+Editor can
  edit Editor), only block self-edit for non-system role users
- Sort custom_keys/0 explicitly instead of relying on Erlang map ordering
- Add catch-all fallback clauses to Scope functions (owner?, admin?,
  system_role?, has_role?, user_roles) to prevent FunctionClauseError
  when cached_roles is nil with a non-nil user
- Use UUID instead of integer ID in auto_grant_to_admin_roles
- Document intentional return type difference between all_module_keys
  (list) and enabled_module_keys (MapSet)
- Fix custom keys two-column grid layout to use CSS columns for proper
  item distribution across both columns

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…text

- Fix rekey_primary/2 to strip old primary to overrides and recompute
  all secondary languages against the new promoted primary
- Move title translations from metadata["translations"] into JSONB data
  column as "_title" key, unifying with other field translations
- Add seed_title_in_data for lazy backwards-compat migration on mount
- Disable slug generation button on secondary language tabs
- Remove unused timestamp fields from spectator cast
- Wrap 9 validation error messages in gettext for i18n
- Fix set_title_translation/3 to merge _title into existing data
- Update OVERVIEW.md, DEEP_DIVE.md, and multilang.ex docs
- Add 12 title translation tests and 7 updated rekey tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant