Add "entity" property to FieldDto or "displayIf" method
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 28/100
Research direction
The issue names FieldDto, Field::new(), displayIf, AdminContextProvider, and AdminContext. Start by tracing how field visibility and AJAX boolean switches are handled, then clarify whether the project wants an entity property or a callback API. Done means an agreed entity-aware field visibility behavior is implemented and verified for the index case.
Written by the indexing model from the issue text.
Description
It can be useful when you need check other fields in voter for example.
Imagine users crud and disabled field in user entity.
It is weird to allow disable yourself, so better to hide that field for yourself entity.
Currently I inject AdminContextProvider and get current entity via AdminContext, but it is not possible to do it for index where ajax boolean switches (so I just disabled them all on index).
Also maybe add some generic displayIf method for field with callback. Maybe with entity parameter (if adding property is not preferably)
Something like
Field::new('disabled')->displayIf(fn ($field, $entity) => $entity->getId() !== $this->getUser()->getId());
- Dominant language
- PHP
- Stars
- 4.3k
- Forks
- 1.1k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 52
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EasyCorp/EasyAdminBundle
-
bug design
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
EasyCorp/EasyAdminBundle#7958 ·
Maintainers usually reply within 2 days
-
design feature
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
EasyCorp/EasyAdminBundle#7930 ·
Maintainers usually reply within 2 days
-
design
Difficulty 2/5 Under an hour Newbie friendliness 88/100
EasyCorp/EasyAdminBundle#7879 ·
Maintainers usually reply within 2 days
-
design
Difficulty 1/5 Under an hour Newbie friendliness 90/100
EasyCorp/EasyAdminBundle#7875 ·
Maintainers usually reply within 2 days
-
#[AdminRoute]: the requirements of an action silently replace the ones of the classPossibly taken @anthonyhacart claimed this 1 day ago. Openfeature
Difficulty 3/5 Half a day Newbie friendliness 30/100
EasyCorp/EasyAdminBundle#7956 ·
Maintainers usually reply within 2 days
All issues in EasyCorp/EasyAdminBundle
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
taskforcesh/bullmq#5238 ·
Maintainers usually reply within 1 day
-
[Bug] v-change-database-password reports success but doesn't change the password when MySQL validate_password rejects itPossibly taken @bfs2021 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Automattic/jetpack#55517 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
area/import type/enhancement when/later
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day