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

Support editable mode on FieldDescriptionInterface::TYPE_ENUM #8219

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

onEXHovia
Copy link
Contributor

Subject

    protected function configureListFields(ListMapper $list): void
    {
        $list
            ->add('status', FieldDescriptionInterface::TYPE_ENUM, [
                'editable' => true,
                'class' => Status::class,
                'choices' => Status::cases(),
            ])
            ->add(ListMapper::NAME_ACTIONS, null, [
                ListMapper::TYPE_ACTIONS => [
                    'edit' => [],
                    'delete' => [],
                ],
            ])
        ;
    }

Changelog

### Added
- Support editable mode on `FieldDescriptionInterface::TYPE_ENUM`

@onEXHovia onEXHovia force-pushed the enum-editable branch 2 times, most recently from 9d37283 to 41bdf4a Compare December 4, 2024 10:09
VincentLanglet
VincentLanglet previously approved these changes Dec 4, 2024
@VincentLanglet
Copy link
Member

CI need to be fixed, but PR looks ok

Copy link
Member

@VincentLanglet VincentLanglet left a comment

Choose a reason for hiding this comment

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

You'll have to skip the test in PHP 8 since BackedEnum doesn't exist I think

@onEXHovia
Copy link
Contributor Author

CI green, ready for review

@VincentLanglet VincentLanglet merged commit 23d9004 into sonata-project:4.x Dec 4, 2024
25 checks passed
@VincentLanglet
Copy link
Member

Thanks

@onEXHovia onEXHovia deleted the enum-editable branch December 4, 2024 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants