Conversation
📝 WalkthroughWalkthroughCSS adjustments to edit-mode spacing and removal of a rule hiding the versions table, plus logic in the versions table to detect edit views and remove action/icon-clickable columns when editing. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
sgeulette
left a comment
There was a problem hiding this comment.
Ok pour montrer le tableau mais il faut alors enlever tout ce qui est colonne inutile ou d'édition. Soit on ne laisse que le titre, soit on laisse les iconified (mais en lecture seule) et les icones de view et téléchargement des actions
| .template-dmsdocument-edit #fieldset-versions { | ||
| width: 65% !important; | ||
| padding-top: 4em; | ||
| margin-top: 6em; |
There was a problem hiding this comment.
5em
.template-dmsdocument-edit #DV-container {margin-top: 0;}
5b0bed0 to
b8d18c3
Compare
|
@sgeulette J'ai fait les changements que tu as demandé. Mais je ne suis pas certain que c'est la bonne manière d masquer les colonnes en mode edit |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
imio/dms/mail/skins/imio_dms_mail/imiodmsmail.css.dtml (1)
159-161:⚠️ Potential issue | 🟠 MajorMove the
#DV-containermargin override to the effective rule block.
margin-top: 0here is overridden later by the same selector at Line 238 (margin-top: 3em), so this change does not take effect in edit mode.Proposed fix
.template-dmsdocument-edit `#DV-container` { - margin-top: 0; + margin-top: 0; } @@ .template-dmsdocument-edit `#DV-container` { width: 100% !important; - margin-top: 3em; + margin-top: 0; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@imio/dms/mail/skins/imio_dms_mail/imiodmsmail.css.dtml` around lines 159 - 161, The rule setting margin-top: 0 on the selector .template-dmsdocument-edit `#DV-container` is being overridden later by the same selector (margin-top: 3em); move or consolidate the margin-top: 0 into the effective rule block where .template-dmsdocument-edit `#DV-container` is defined later (the block around the later occurrence) so the edit-mode override takes effect — update the later rule to use margin-top: 0 for edit mode or remove the duplicate earlier rule and keep the desired margin-top in the single effective selector (.template-dmsdocument-edit `#DV-container`).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@imio/dms/mail/skins/imio_dms_mail/imiodmsmail.css.dtml`:
- Around line 159-161: The rule setting margin-top: 0 on the selector
.template-dmsdocument-edit `#DV-container` is being overridden later by the same
selector (margin-top: 3em); move or consolidate the margin-top: 0 into the
effective rule block where .template-dmsdocument-edit `#DV-container` is defined
later (the block around the later occurrence) so the edit-mode override takes
effect — update the later rule to use margin-top: 0 for edit mode or remove the
duplicate earlier rule and keep the desired margin-top in the single effective
selector (.template-dmsdocument-edit `#DV-container`).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 10e3e4a1-bb1d-44f4-9042-ff46741d7f7e
📒 Files selected for processing (2)
imio/dms/mail/browser/table.pyimio/dms/mail/skins/imio_dms_mail/imiodmsmail.css.dtml
b8d18c3 to
94fae02
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@imio/dms/mail/browser/table.py`:
- Around line 127-129: The is_edit_mode function can miss edit views when
ACTUAL_URL has trailing slashes or query/fragment parts; update is_edit_mode to
normalize the URL before extracting the view name by first removing query
strings/fragments and trimming trailing slashes (e.g. split on '?' and '#', then
rstrip('/')), then take the last path segment into view_name and check it
against ('edit', '@@edit'); modify the is_edit_mode implementation accordingly
to use this normalized view_name so URLs like "/foo/edit/", "/foo/@@edit?x=1" or
"/foo/@@edit/#frag" are handled.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 892c8d3c-ff41-4261-9b5b-b678fabbcd52
📒 Files selected for processing (2)
imio/dms/mail/browser/table.pyimio/dms/mail/skins/imio_dms_mail/imiodmsmail.css.dtml
| def is_edit_mode(self): | ||
| view_name = self.request.get('ACTUAL_URL', '').split('/')[-1] | ||
| return view_name in ('edit', '@@edit') |
There was a problem hiding this comment.
Harden edit-mode detection against URL suffix variations.
Line 128 can fail for URLs ending with / or containing query params, which would skip edit-mode column filtering.
🔧 Proposed fix
def is_edit_mode(self):
- view_name = self.request.get('ACTUAL_URL', '').split('/')[-1]
+ actual_url = self.request.get('ACTUAL_URL', '')
+ view_name = actual_url.split('?', 1)[0].rstrip('/').split('/')[-1]
return view_name in ('edit', '@@edit')🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@imio/dms/mail/browser/table.py` around lines 127 - 129, The is_edit_mode
function can miss edit views when ACTUAL_URL has trailing slashes or
query/fragment parts; update is_edit_mode to normalize the URL before extracting
the view name by first removing query strings/fragments and trimming trailing
slashes (e.g. split on '?' and '#', then rstrip('/')), then take the last path
segment into view_name and check it against ('edit', '@@edit'); modify the
is_edit_mode implementation accordingly to use this normalized view_name so URLs
like "/foo/edit/", "/foo/@@edit?x=1" or "/foo/@@edit/#frag" are handled.
ça a été demandé par Lasne et Seraing. Mais je vois que cette table a été expressément masquée en mode édition. Je me demande donc quelles étaient les raisons de l'avoir masquée à la base ?
Summary by CodeRabbit
Style
Bug Fixes