Skip to content
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

Fix tabular not properly dealiasing items #18186

Merged
merged 7 commits into from Apr 21, 2023
Merged

Fix tabular not properly dealiasing items #18186

merged 7 commits into from Apr 21, 2023

Conversation

Nitwel
Copy link
Member

@Nitwel Nitwel commented Apr 14, 2023

The problem was that when merging the item returned from the api to replace alaised fields with their original names, I didn't take into account that the field without an alias could override the dealiased field, thus resulting in the wrong item.

closes #18181

@Nitwel Nitwel requested a review from a team April 14, 2023 11:58
@Nitwel Nitwel self-assigned this Apr 14, 2023
@Nitwel Nitwel requested review from rijkvanzanten, br41nslug and connorwinston and removed request for a team April 14, 2023 11:58
app/src/layouts/tabular/index.ts Outdated Show resolved Hide resolved
@Nitwel
Copy link
Member Author

Nitwel commented Apr 19, 2023

@rijkvanzanten Going back to the discussion we had on Discord, your idea of being able to apply the translations display to any field wouldn't work at the moment as the display needs to configure which fields it should load, but the problem here is that you can only specify fields relative to your field so you can't load fields on the same level meaning, the display wouldn't be able to access the languages_code.code field.

What I did now is to remove the hacky logic so we can fix this for now and figure out a proper way to support translations display on none translations fields, meaning that for now we will only show it as an array like so:
grafik

@rijkvanzanten rijkvanzanten merged commit 6e707b7 into main Apr 21, 2023
5 checks passed
@rijkvanzanten rijkvanzanten deleted the fix-18181 branch April 21, 2023 19:13
@rijkvanzanten rijkvanzanten added this to the Next Release milestone Apr 24, 2023
meditadvisors pushed a commit to ciso360ai/directus-mod that referenced this pull request May 13, 2023
* Fix tabular not properly dealiasing items

* run linter

* remove translations edgecase

* Fix linter warnings

* Remove unused var

---------

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tabular view translations only showing when primary "Translations" is added
2 participants