-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
columns are shown in WhereBuilder and ColumnSelector despite admin.hidden, admin.condition, access or disableListColumn/disableListFilter in some cases #10234
Comments
@tylkomat I've got a fix for the blank options within the condition dropdown queued up here: #10246. As for the other issues your facing, let me provide some clarity here. The When it comes to But in addition to my fix above, I think there's likely a couple more things we can do here in the meantime to help. First, I agree that fields which lack read permission for the user should not appear at all in the column selector and the filters, as they cannot see any of that data anyway. I can explore this change in a separate PR. I also agree that if a group field has |
#10246) Fixes #10234. Some fields, such as focal point fields for upload enabled collections, were rendering in the condition selector despite being hidden from the column selector. This was because the logic for the column selector was filtering fields without labels, but the same was not being done for the filter conditions. This, however, is not a good way to filter these fields as it requires this specific logic to be written in multiple places. Instead, they need to explicitly check for `hidden` and `disabled` in addition to `disableListFilter` and `disableListColumn`. The actual filtering logic has been improved across the two instances as well, removing multiple duplicative loops. This change has also exposed a underlying issue with the way columns were handled within the table columns provider. When row selections were enabled, the selector columns were present in column state. This caused problems when interacting with column indices, such as when reordering columns. Instead of needing to manually filter these out every time we need to work with column state, they no longer appear there in the first place. Instead, we inject the row selectors directly into the table itself, completely isolating these row selectors from the column state.
This issue has been automatically locked. |
Describe the Bug
When enabling
upload
on a collection all the upload related columns haveadmin.hidden: true
, but still show up underColumnSelector
andWhereBuilder
.In
WhereBuilder
there are even two additional empty entries (after height).I added an additional field
noAccess
which has all field access set to false, but the field still shows up inColumnSelector
andWhereBuilder
.The same happens with the
noCondition
field, which hasadmin.condition: () => false
.For condition I'm not sure if it should hide the column from
ColumnSelector
andWhereBuilder
, but if read access is false, I would expect the column to be hidden.The only way to hide columns from
ColumnSelector
andWhereBuilder
areadmin.disableListColumn
andadmin.disableListFilter
. ForColumnSelector
it works when placingadmin.disableListColumn
on for examplesizes
field, but forWhereBuilder
the properties have to be placed on the exact field i.e.sizes.fields.mimeType
. It is not enough to putadmin.disableListFilter
and the parentsizes
field, which I would expect to be working.I believe it was working differently in an earlier version. If this is all working as expected, I propose to callback functions on
admin.disableListFilter
andadmin.disableListColumn
, such that these settings can be set based on user roles for example.Link to the code that reproduces this issue
https://github.com/tylkomat/payload/tree/bug-list-filter-columns
Reproduction Steps
Visit Media collection and click on Columns or Filters
Which area(s) are affected? (Select all that apply)
area: core, area: ui
Environment Info
The text was updated successfully, but these errors were encountered: