payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
23.58k stars 1.5k forks source link

Filtering enums does not work in admin #7953

Closed bmamouri closed 1 month ago

bmamouri commented 1 month ago

Link to reproduction

No response

Environment Info

Binaries:
  Node: 18.20.4
  npm: 10.7.0
  Yarn: 4.4.1
  pnpm: N/A
Relevant Packages:
  payload: 3.0.0-beta.95
  next: 15.0.0-canary.134
  @payloadcms/db-postgres: 3.0.0-beta.95
  @payloadcms/email-nodemailer: 3.0.0-beta.95
  @payloadcms/graphql: 3.0.0-beta.95
  @payloadcms/next/utilities: 3.0.0-beta.95
  @payloadcms/plugin-cloud: 3.0.0-beta.95
  @payloadcms/plugin-cloud-storage: 3.0.0-beta.95
  @payloadcms/richtext-lexical: 3.0.0-beta.95
  @payloadcms/richtext-slate: 3.0.0-beta.95
  @payloadcms/translations: 3.0.0-beta.95
  @payloadcms/ui/shared: 3.0.0-beta.95
  react: 19.0.0-rc-06d0b89e-20240801
  react-dom: 19.0.0-rc-06d0b89e-20240801
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:21 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8103
  Available memory (MB): 16384
  Available CPU cores: 8

Describe the Bug

Enum fileds cannot be filtered in the admin page.

This is the collection that I am using:

import { CollectionConfig } from 'payload'

export const Category: CollectionConfig = {
  slug: 'category',
  fields: [
    {
      name: 'code',
      type: 'text',
      required: true,
      unique: true,
    },
    {
      name: 'group',
      type: 'radio',
      required: true,
      options: [
        {
          label: 'Women',
          value: 'women',
        },
        {
          label: 'Men',
          value: 'men',
        },
        {
          label: 'Baby Girl',
          value: 'baby-girl',
        },
        {
          label: 'Baby Boy',
          value: 'baby-boy',
        },
        {
          label: 'Girls 2-8Y',
          value: 'girls-2-8y',
        },
        {
          label: 'Boys 2-8Y',
          value: 'boys-2-8y',
        },
        {
          label: 'Girls 9-14Y',
          value: 'girls-9-14y',
        },
        {
          label: 'Boys 9-14Y',
          value: 'boys-9-14y',
        },
      ],
    },
  ],
}

I expect to see the enum values in the admin filter section. But instead an input field is shown:

image

I've tried to type the enum value. But as soon as I start typing one of the enum values I get this error:

image

Reproduction Steps

As stated above

Adapters and Plugins

No response

paulpopus commented 1 month ago

This will be fixed in https://github.com/payloadcms/payload/pull/8002

You'll now see a dropdown menu similar to a select field

github-actions[bot] commented 3 weeks ago

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.