Using permanentFilters on two different fields which reference the same entity does not work
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.9k
- Forks
- 703
- PR merge metrics
- No merged PRs in 30d
Description
projects.creationView()
.fields([
nga.field('name'),
nga.field('description'),
nga.field('accounting_rep','reference')
.targetEntity(admin.getEntity('employees'))
.targetField(nga.field('full_name'))
.permanentFilters({"department":"accounting"})
.label("Accounting Rep"),
nga.field('engineering_rep','reference')
.targetEntity(admin.getEntity('employees'))
.targetField(nga.field('full_name'))
.permanentFilters({"department":"engineering"})
.label("Engineering Rep")
]);
In this scenario, the dropdown lists for the accounting rep and engineering rep fields both show employees from both departments. I can see the browser make the request for the filtered lists and get back the correct responses from the server. So I think maybe ng-admin is using the same datastore for the referenced values in these two fields?
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Reproduce the projects.creationView() example with its two reference fields and their permanentFilters, then trace how the referenced employees values are loaded and stored. Verify the browser requests and compare the dropdown results for each field; done means accounting_rep shows only accounting employees while engineering_rep shows only engineering employees.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angularjs, javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100