Skip to content

Added admin action 'view' on dms files#93

Merged
sgeulette merged 2 commits intomasterfrom
PARAF-347/object_buttons_view
Mar 6, 2026
Merged

Added admin action 'view' on dms files#93
sgeulette merged 2 commits intomasterfrom
PARAF-347/object_buttons_view

Conversation

@chris-adam
Copy link
Copy Markdown
Contributor

@chris-adam chris-adam commented Feb 20, 2026

Summary by CodeRabbit

Release Notes

  • New Features
    • Added "View element" action button to file management interface. Users with appropriate permissions can now open file elements directly in a new browser tab, improving content accessibility and workflow navigation.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d3e0aef and f120dec.

📒 Files selected for processing (4)
  • imio/dms/mail/browser/actionspanel.py
  • imio/dms/mail/profiles/default/types/dmsappendixfile.xml
  • imio/dms/mail/profiles/default/types/dmsmainfile.xml
  • imio/dms/mail/profiles/default/types/dmsommainfile.xml

📝 Walkthrough

Walkthrough

A new "view_element" action is being registered across the mail management system. The action is added to the Python action whitelist and then configured as an object button in three Dexterity content type profiles (dmsappendixfile, dmsmainfile, dmsommainfile), each opening the object's view in a new tab with "Manage portal" permission requirements.

Changes

Cohort / File(s) Summary
Action Whitelist Configuration
imio/dms/mail/browser/actionspanel.py
Added "view_element" to the ACCEPTABLE_ACTIONS whitelist in DmsFileActionsPanelView. Minor formatting change in sorting lambda from single to double quotes for dictionary key access, with no behavioral impact.
Dexterity Content Type Profiles
imio/dms/mail/profiles/default/types/dmsappendixfile.xml, imio/dms/mail/profiles/default/types/dmsmainfile.xml, imio/dms/mail/profiles/default/types/dmsommainfile.xml
Added identical "view_element" action definitions to three content type profiles. Each action is configured as an object button with icon pointing to annex resource, URL expression directing to /view, link target set to new tab (_blank), and "Manage portal" permission requirement.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • sgeulette

Poem

🐰 A button springs forth, so shiny and new,
View elements now in a tab just for you,
Three profiles agree on this action so grand,
While permissions stand guard, ever watchful and planned! 🖱️✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a 'view' action to DMS file types. It is concise, clear, and directly reflects the primary purpose of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch PARAF-347/object_buttons_view

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

<property name="description"></property>
<property name="url_expr">string:${object_url}/view</property>
<property name="icon_expr">string:${portal_url}/++resource++imio.annex/view_element.png</property>
<property name="available_expr">python:object.portal_type in ("dmsmainfile", "dmsommainfile", "dmsappendixfile")</property>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ici, c'est un peu un hack pour ne pas dupliquer l'action "view" déjà présente sur les annexes, sur les annexes de dossiers par exemple. Par contre, l'action de imio.annex n'ouvre pas dans un nouvel onglet

@chris-adam chris-adam requested a review from sgeulette February 20, 2026 12:50
Copy link
Copy Markdown
Member

@sgeulette sgeulette left a comment

Choose a reason for hiding this comment

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

J'adopterais exactement la même approche que pour le download.
Ajouter dans les types concernés dans basecontent et imio.dms.mail l'action view d'imio.annex

@chris-adam chris-adam requested a review from sgeulette February 26, 2026 12:41
@sgeulette sgeulette merged commit eb45bfb into master Mar 6, 2026
1 check passed
@sgeulette sgeulette deleted the PARAF-347/object_buttons_view branch March 6, 2026 09:54
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.

2 participants