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

feat: adds disableListColumn & disableListFilter to fields admin props #6188

Merged
merged 5 commits into from May 3, 2024

Conversation

PatrikKozak
Copy link
Contributor

@PatrikKozak PatrikKozak commented May 2, 2024

Description

Feat: adds new props to fields - admin.disableListColumn & admin.disableListFilter

Setting disableListColumn to true will prevent fields from appearing in the list view column selector .

Setting disableListFilter to true will prevent fields from appearing in the list view filter options.

  • I have read and understand the CONTRIBUTING.md document in this repository.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • I have added tests that prove my fix is effective or that my feature works
  • Existing test suite passes locally with my changes
  • I have made corresponding changes to the documentation

Copy link
Member

@denolfe denolfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to split out the column from the filters into two separate properties. We should add a new disableListFilter property to accommodate just the filter from the where builder.

packages/payload/src/fields/config/types.ts Outdated Show resolved Hide resolved
@PatrikKozak PatrikKozak changed the title feat: adds admin.disabledListColumn prop to fields feat: adds disabledListColumn & disableListFilter to fields admin props May 3, 2024
@PatrikKozak PatrikKozak changed the title feat: adds disabledListColumn & disableListFilter to fields admin props feat: adds disableListColumn & disableListFilter to fields admin props May 3, 2024
@@ -57,8 +57,12 @@ const reduceFields = (fields, i18n) =>
...field,
},
}

if (field.admin?.disableListFilter) return reduced
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Early returns, love it 👍

@denolfe denolfe merged commit db4aace into main May 3, 2024
33 checks passed
@denolfe denolfe deleted the feat/admin-disabledListColumn branch May 3, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants