Skip to content

Show translated titles in lookup admin tables and label tree payload#369

Open
level09 wants to merge 13 commits into
mainfrom
fix/lookup-translations-display
Open

Show translated titles in lookup admin tables and label tree payload#369
level09 wants to merge 13 commits into
mainfrom
fix/lookup-translations-display

Conversation

@level09

@level09 level09 commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a Title (AR) column to the Labels and Sources admin tables so imported translations are reviewable at a glance (Event Types and the component-data lists already show theirs)
  • Include title_ar, comments, comments_ar in Label.build_tree: the tree view feeds the edit dialog from this payload, and without these fields saving from tree view silently wiped a label's translation and comments (from_json defaults them to empty)
  • Add title_ar to Source.to_dict and a Title (AR) field to the source edit dialog; the column existed and is searchable (Search translated titles in lookup typeahead endpoints #365) but was neither visible nor editable

Test plan

  • uv run pytest tests/test_lookup_crud.py (217 passed)
  • Manual: labels admin tree view -> edit a translated label -> Title (AR) populated -> Save -> translation preserved
  • Manual: sources admin -> table shows Title (AR), edit dialog round-trips it

…ude translation fields in label tree payload
@level09
level09 requested a review from apodacaduron as a code owner July 19, 2026 10:30
@level09 level09 self-assigned this Jul 19, 2026
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3bec3ca0-a314-4f47-8641-2629658fc617

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/lookup-translations-display

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

apodacaduron
apodacaduron previously approved these changes Jul 20, 2026
…ns-display

# Conflicts:
#	enferno/templates/layout.html
apodacaduron
apodacaduron previously approved these changes Jul 20, 2026
Comment thread enferno/admin/models/Bulletin.py Outdated
for label in self.labels:
labels_json.append({"id": label.id, "title": label.title})
labels_json.append(
{"id": label.id, "title": label.title, "title_ar": label.title_ar}

@apodacaduron apodacaduron Jul 20, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: should we add path and path_ar here too? So we can implement the "Full label paths, without the clutter" feature

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@apodacaduron agreed. and pushed in f8c187f

Thanks for catching this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@level09 hey, we might need path and path_ar on Actor Profile labels too. Actor profiles render labels in the actor drawer, and I think those label objects may still be missing the path fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants