-
Notifications
You must be signed in to change notification settings - Fork 325
Feature/attribute scope #902
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
base: develop
Are you sure you want to change the base?
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 introduces support for custom attribute scopes for resources, allowing attributes to be filtered by specific resources or resource types, similar to how it's handled for reservations. The PR also includes type annotation improvements throughout the codebase.
Key changes:
- New
GetResourceAttributesmethod in AttributeService to filter attributes based on resource ID and resource type ID - Enhanced template logic to display attributes conditionally based on secondary entity assignments
- Type-safe comparison operators using strict equality (
===) for CustomAttributeCategory comparisons
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tpl/Admin/Resources/manage_resources.tpl | Implements conditional attribute rendering based on resource type and direct resource assignment |
| tpl/Admin/Attributes/manage_attributes.tpl | Updates form fields with better labeling, tooltip help text, and visibility rules configuration |
| lib/Application/Attributes/AttributeService.php | Adds GetResourceAttributes method with filtering logic and stub methods for interface compatibility |
| lib/Application/Schedule/ScheduleResourceFilter.php | Updates type comparisons to use type-safe casting |
| lib/Application/Reservation/Validation/CustomAttributeValidationRule.php | Converts loose equality to strict equality for category comparisons |
| Domain/CustomAttribute.php | Extends WithSecondaryEntities to support RESOURCE category in addition to RESERVATION |
| Domain/Access/AttributeFilter.php | Adds type casting for attribute type comparisons |
| Pages/Admin/ManageResourcesPage.php | Updates attribute type comparison with type casting |
| Pages/Admin/ManageAttributesPage.php | Adds SetCategoryVisibilityRules method to define field visibility per category |
| Presenters/Admin/ManageAttributesPresenter.php | Calls SetCategoryVisibilityRules on page load |
| WebServices/Controllers/AttributeSaveController.php | Updates validation with strict type comparisons and adds DATETIME type support |
| Web/scripts/admin/attributes.js | Implements visibility rules and secondary category management (contains duplicate code) |
| tests/fakes/FakeAttributeService.php | Adds stub implementations for new interface methods |
| tests/Presenters/Admin/ManageAttributesPresenterTest.php | Adds comprehensive test cases for resource and resource type secondary entities |
| lang/*.php | Adds help text translations for AdminOnly, Private, and LimitAttributeScope in 7 languages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c82fe7c to
18bf701
Compare
Adds the scoping feature to resources by resource and resource type Allows to collect custom attributes just for specific limited scopes fix: scopefield on edit still visible
Better description of attribute properties and options in admin management page
…pes and CustomAttributeCategory fixes phpstan issues for wrong type comparisson
18bf701 to
f02596d
Compare
This pull request introduces support for custom attribute scopes for ressources. Meaning based on specific resource or resource type custom attributes are shown similar to how its handled for reservation.
I previously committed this code but some final testing and changes were required
While going through the custom attributes I also added some types where suggested