-
Notifications
You must be signed in to change notification settings - Fork 17
2x tests #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2x tests #49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request enhances custom field handling with improved tenant resolution, data flow fixes, and test refinements. The changes focus on making custom fields work more reliably in Filament forms and adding support for custom tenant resolvers.
Key Changes
- Added custom tenant resolver functionality allowing flexible tenant ID resolution through callbacks
- Fixed custom field handling in Filament create/edit forms by removing section wrappers and implementing proper data flow
- Refactored custom field attribute handling to use mutators instead of relying on event hooks
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Fixtures/Resources/Posts/Pages/CreatePost.php | Override handleRecordCreation to ensure custom fields are saved after record creation |
| tests/Feature/TenantResolverTest.php | Added comprehensive tests for custom tenant resolver functionality |
| tests/Feature/Models/CustomFieldRelationshipsTest.php | Updated assertions and fixed column references from label to name |
| tests/Feature/Integration/Resources/Pages/EditRecordTest.php | Changed assertions from checking section visibility to checking form field existence |
| tests/Feature/Integration/Resources/Pages/CreateRecordTest.php | Changed assertions from checking section visibility to checking form field existence |
| tests/Debug/FormContainerDebugTest.php | Added debug test to verify custom field component integration |
| src/Services/Visibility/FrontendVisibilityService.php | Changed closure parameter type from CustomFieldOption to mixed and removed unused import |
| src/Services/TenantContextService.php | Added custom tenant resolver functionality with priority-based resolution |
| src/Models/CustomFieldOption.php | Added null check before accessing customField relationship |
| src/Models/Concerns/UsesCustomFields.php | Refactored to use setCustomFieldsAttribute mutator and improved temporary storage key generation |
| src/Filament/Management/Schemas/FieldForm.php | Added null coalescing for searchable property access |
| src/Filament/Integration/Concerns/Forms/ConfiguresColorOptions.php | Changed color option filtering from truthy check to filled() |
| src/Filament/Integration/Builders/FormContainer.php | Added try-catch blocks to gracefully handle unavailable record/model |
| src/Filament/Integration/Builders/FormBuilder.php | Removed section wrappers to flatten custom field structure |
| src/Filament/Integration/Builders/BaseBuilder.php | Removed static caching mechanism |
| src/Filament/Integration/Base/AbstractFormComponent.php | Fixed dehydration logic by correcting boolean operator precedence |
| src/FieldTypeSystem/FieldManager.php | Added null parameter handling to getFieldType() method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add resolveTenantUsing and clearTenantResolver methods to CustomFields facade for test isolation and custom tenant resolution
Replace direct Filament::getTenant() calls with TenantContextService for consistent tenant handling across management interfaces
Use spl_object_id for temp storage key to avoid key mismatch during model save lifecycle
Custom fields now handle creation automatically via model lifecycle hooks
Add clearBootedModels call in setUp to force models to re-boot after application initialization, ensuring event handlers are properly wired to the event dispatcher
Organize imports in alphabetical order per PSR-12 standards
Remove temporary debug test file used during investigation
No description provided.