Open
Conversation
c37e561 to
e59c5ee
Compare
60f188a to
51001d1
Compare
Replaces single customer email field with flexible contact management system: - Create CustomerContact and CustomerContactProject models with many-to-many relationships - Add customer contacts UI with Turbo Frames for inline editing - Implement CRUD operations with proper Turbo Stream responses - Update invoice mailer to use contacts instead of customer email field - Add data migration from old email field to new contact system - Include comprehensive testing and documentation - Support project-specific email contacts for targeted communication Resolves #67 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Enhance error handling in CustomerContactsController to properly integrate with the new error notification system from master: - Add proper HTTP status codes (422 for validation errors, 500 for server errors) - Add rescue blocks to catch and handle server errors gracefully - Return structured JSON error responses with appropriate status codes - Update tests to expect correct HTTP status codes for validation errors This ensures that any AJAX/Turbo Stream errors from customer contact operations will be properly detected and displayed by the error notification system in the navbar. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add proper event listener cleanup in disconnect() method to prevent memory leaks when dynamically created suggestion items are removed. Implements bound event handlers that can be properly removed during controller cleanup. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed NoMethodError in db:seed by removing time_budget= calls for Customer and Project models. The time_budget column was removed in migration 20250805010348_remove_time_budget_columns.rb. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Remove table-light class from customer contacts table header to allow proper Bootstrap 5 dark mode styling. The table header now automatically adapts to light/dark themes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove turbo-frame complexity that caused HTML validation issues - Implement manual form submission with JavaScript for edit forms - Fix routing issues with edit/delete buttons (use contact.id instead of contact object) - Add turbo_prefetch=false to prevent hover-triggered requests - Update controller actions to target individual contact rows - Add comprehensive turbo_stream tests for all contact operations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…ations Added proper turbo-frame targeting to both the new contact creation form and delete form to ensure turbo-stream responses are processed correctly and the UI updates without requiring page reloads. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Enhanced turbo-stream error responses to preserve form state - Pass failed contact attributes to repopulate form on validation errors - Added explicit form URL to prevent routing issues - Added test case for validation errors (currently disabled due to 500 error) The error display logic is in place but needs manual testing to verify turbo-stream error responses work correctly in the browser. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add validation error display to edit forms spanning full table width - Fix error message positioning and dark mode compatibility - Implement multi-stream turbo responses to remove old error rows - Update cancel edit to properly clean up error messages - Improve JavaScript error handling for contact save operations Error messages now display properly in both light and dark modes, don't accumulate duplicates, and are cleaned up when canceling edits. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Key changes: - Move wrapper div from main view to partial to preserve turbo-stream target - Replace turbo-frame with pure turbo-stream approach for better reliability - Add explicit format specification to ensure turbo-stream requests - Remove turbo-frame targeting that conflicted with turbo-stream responses The issue was that turbo-stream was replacing the target element entirely, removing it from the DOM and breaking subsequent requests. Now the wrapper div is included in the partial content, ensuring the target persists. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…tacts Added back missing functionality for managing customer contact associations: - **New contact form**: Add editable checkbox for document types (invoices) and multi-select dropdown for customer projects - **Edit form**: Replace placeholder text with actual project selection control and editable document type checkbox - **JavaScript**: Update saveContact function to handle project_ids array submission for inline editing Projects are scoped to the customer (bill_to_customer relationship) and only active projects are shown. Document types currently support invoices with extensibility for future types as documented in the model. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…diting Replaced basic select boxes with the original tag-style interface that provides much better UX for managing projects and document types: **Features restored:** - **Type-ahead project selection**: Type to search projects by matchcode, description, or display name with dropdown suggestions - **Tag-style interface**: Projects and document types shown as removable badges - **Automatic updates**: Changes save automatically without manual save button - **Smart suggestions**: Shows only available options, filters duplicates **Implementation:** - Restored Stimulus controller integration with proper data attributes - Removed manual saveContact JavaScript in favor of controller methods - Added project data serialization for autocomplete functionality - Fields update on change events rather than manual form submission The edit interface now provides intuitive tag management with excellent keyboard navigation and visual feedback. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Updated new contact form to use same tag-style interface as edit form - Added updateNewContactFormFields method to handle form field synchronization - Both add and edit forms now have identical tag-based project selection - Both forms use consistent document type tag interface - Proper hidden field management for new contact form submissions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add missing Save button that was completely absent from edit forms - Remove confusing auto-save behavior on field changes - Fix JavaScript data attribute access (contact-id vs contact_id) - Add comprehensive system tests covering CRUD operations, tag interface, validation, and hover behaviors - Improve project association handling with integer conversion and error logging - Add explicit save action with turbo_stream integration - Document UI testing commands in CLAUDE.md for future reference Tests identify remaining issues with tag interface and validation error display. Core edit/save/cancel functionality now works correctly with clear user feedback. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Update delivery note email system to use customer_contacts instead of deprecated customer.email field. • Update delivery_note.rb email_unsent scope to join customer_contacts • Add get_delivery_note_recipients helper to delivery_note_mailer.rb • Update bulk email job and controller to check customer_contacts.receives_invoices • Update delivery note show view email status check 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Improve customer contacts interface with better form handling and validation. Add extensive system tests covering form interactions and error states. • Refactor Stimulus controller for improved event handling and cleanup • Update form templates for better UX and accessibility • Add comprehensive system test coverage for customer contacts CRUD operations • Fix before_action scope to prevent 404 errors on missing actions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
51001d1 to
8d95898
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #67
Summary
Changes Made
Test plan
🤖 Generated with Claude Code