Friendly summaries for app.permission.add/remove audit entries
Task #174: The new `app.permission.add` and `app.permission.remove` audit log actions emitted by `artifacts/api-server/src/routes/apps.ts` were falling through `formatAuditSummary`'s default branch, so the admin audit log only displayed the raw action string instead of a human-readable sentence like the existing `role.permission.*` entries. Changes: - artifacts/tx-os/src/pages/admin.tsx: added `app.permission.add` and `app.permission.remove` cases to `formatAuditSummary`. They reuse the existing `appName(meta, lang, targetId)` helper (which already handles the nameEn/nameAr/slug fallback) and mirror the existing role.permission.* permission-name fallback (permissionName -> #permissionId -> "?"). - artifacts/tx-os/src/locales/en.json: added `admin.audit.summary.app.permissionAdd` / `admin.audit.summary.app.permissionRemove`, matching the wording of the role.* variants ("Added permission '{{permission}}' to app '{{name}}'", "Removed permission '{{permission}}' from app '{{name}}'"). - artifacts/tx-os/src/locales/ar.json: added the Arabic equivalents ("تمت إضافة الصلاحية '...' إلى التطبيق '...'", "تمت إزالة الصلاحية '...' من التطبيق '...'"). Verification: - e2e tested via runTest: created a new app, added/removed a permission via the API to emit both audit entries, opened the admin audit log, and confirmed both rows render the friendly English summary; switched the UI to Arabic and confirmed the same rows render the Arabic summary (no raw "app.permission.add" / "app.permission.remove" strings shown). - JSON files validated; no new TypeScript errors introduced near the edited lines (the pre-existing 36 codegen-related errors in admin.tsx are unrelated). No deviations from the task scope. Replit-Task-Id: eb2f3eea-089a-4afc-803c-2580cbf1cfc9
This commit is contained in:
@@ -767,7 +767,9 @@
|
||||
"update": "تم تعديل التطبيق '{{name}}' ({{changes}})",
|
||||
"rename": "تمت إعادة تسمية التطبيق من '{{previousName}}' إلى '{{name}}'",
|
||||
"delete": "تم حذف التطبيق '{{name}}'",
|
||||
"forceDelete": "تم حذف التطبيق '{{name}}' قسراً (تأثرت {{groups}})"
|
||||
"forceDelete": "تم حذف التطبيق '{{name}}' قسراً (تأثرت {{groups}})",
|
||||
"permissionAdd": "تمت إضافة الصلاحية '{{permission}}' إلى التطبيق '{{name}}'",
|
||||
"permissionRemove": "تمت إزالة الصلاحية '{{permission}}' من التطبيق '{{name}}'"
|
||||
},
|
||||
"auth": {
|
||||
"issueResetLink": "تم إصدار رابط إعادة تعيين كلمة المرور للمستخدم @{{username}}"
|
||||
|
||||
Reference in New Issue
Block a user