Migrate first admin mailer and navigation views to ERB#4
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the first batch of HAML templates to ERB format while preserving layout and helpers, alongside adding comprehensive view specs with baseline HTML snapshots for the converted templates.
- Convert admin alert, navigation, and mailer views from HAML to ERB
- Add missing view specs for pagination, mailers, and navigation components
- Generate deterministic HTML snapshots to support future comparison testing
Reviewed Changes
Copilot reviewed 43 out of 47 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| app/views/administrateurs/_*.html.{haml,erb} | Convert navigation, breadcrumbs, login banner, and groups header partials from HAML to ERB |
| app/views/administrateur_mailer/*.html.{haml,erb} | Migrate mailer templates for service notifications, API token expiration, and account activation |
| app/views/administrate/application/_pagination.html.{haml,erb} | Convert pagination partial from HAML to ERB |
| app/views/admin/_closed_mail_template_attestation_inconsistency_alert.html.{haml,erb} | Migrate alert template from HAML to ERB |
| spec/views/**/*_spec.rb | Add comprehensive view specs for all migrated templates |
| spec/views/**/*.html | Generate baseline HTML snapshots for regression testing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| <% alert_classes = ['alert', flash_class('alert')].compact.join(' ') %> | ||
| <div class="<%= alert_classes %>"> |
There was a problem hiding this comment.
The alert_classes variable is defined and used only once. Consider inlining this logic directly in the class attribute: <div class=\"alert <%= flash_class('alert') %>\">
| <% alert_classes = ['alert', flash_class('alert')].compact.join(' ') %> | ||
| <div class="<%= alert_classes %>"> |
There was a problem hiding this comment.
Duplicated logic for building alert classes. This is repeated from lines 4-5. Consider extracting this into a helper method or using the same inline approach consistently.
|
je veux les commits propres. |
Create a single component that replaces UniqueComponent and MultipleComponent: - Handles both single (max=1) and multiple (max>1) files - Automatically deduces max from has_one vs has_many - Explicit drop_zone parameter (:none or :integrated) - Shows uploader OR file for single, uploader AND files for multiple This simplifies the architecture by eliminating the Unique/Multiple distinction and making behavior more predictable. Includes comprehensive specs. Part of attachment components refactoring (#4/7) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Create a single component that replaces UniqueComponent and MultipleComponent: - Handles both single (max=1) and multiple (max>1) files - Automatically deduces max from has_one vs has_many - Explicit drop_zone parameter (:none or :integrated) - Shows uploader OR file for single, uploader AND files for multiple This simplifies the architecture by eliminating the Unique/Multiple distinction and making behavior more predictable. Includes comprehensive specs. Part of attachment components refactoring (#4/7) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Create a single component that replaces UniqueComponent and MultipleComponent: - Handles both single (max=1) and multiple (max>1) files - Automatically deduces max from has_one vs has_many - Explicit drop_zone parameter (:none or :integrated) - Shows uploader OR file for single, uploader AND files for multiple This simplifies the architecture by eliminating the Unique/Multiple distinction and making behavior more predictable. Includes comprehensive specs. Part of attachment components refactoring (#4/7) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Create a single component that replaces UniqueComponent and MultipleComponent: - Handles both single (max=1) and multiple (max>1) files - Automatically deduces max from has_one vs has_many - Explicit drop_zone parameter (:none or :integrated) - Shows uploader OR file for single, uploader AND files for multiple This simplifies the architecture by eliminating the Unique/Multiple distinction and making behavior more predictable. Includes comprehensive specs. Part of attachment components refactoring (#4/7) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Create a single component that replaces UniqueComponent and MultipleComponent: - Handles both single (max=1) and multiple (max>1) files - Automatically deduces max from has_one vs has_many - Explicit drop_zone parameter (:none or :integrated) - Shows uploader OR file for single, uploader AND files for multiple This simplifies the architecture by eliminating the Unique/Multiple distinction and making behavior more predictable. Includes comprehensive specs. Part of attachment components refactoring (#4/7) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Create a single component that replaces UniqueComponent and MultipleComponent: - Handles both single (max=1) and multiple (max>1) files - Automatically deduces max from has_one vs has_many - Explicit drop_zone parameter (:none or :integrated) - Shows uploader OR file for single, uploader AND files for multiple This simplifies the architecture by eliminating the Unique/Multiple distinction and making behavior more predictable. Includes comprehensive specs. Part of attachment components refactoring (#4/7) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Create a single component that replaces UniqueComponent and MultipleComponent: - Handles both single (max=1) and multiple (max>1) files - Automatically deduces max from has_one vs has_many - Explicit drop_zone parameter (:none or :integrated) - Shows uploader OR file for single, uploader AND files for multiple This simplifies the architecture by eliminating the Unique/Multiple distinction and making behavior more predictable. Includes comprehensive specs. Part of attachment components refactoring (#4/7) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary
Testing
bundle exec herb analyze .(fails: herb analyze raises "negative argument" inside Herb::Project#progress_bar)bin/rake lint(fails: bun lint:herb cannot find theherb-lintexecutable)bundle exec rspec spec/views(fails: many legacy view specs depend on asset pipeline artefacts such as pictograms and fail without them)https://chatgpt.com/codex/tasks/task_e_68c90957c8388321aac532ec9c9102f8