Skip to content

Conversation

@alexander-schranz
Copy link
Contributor

@alexander-schranz alexander-schranz commented Jul 18, 2022

Q A
Bug fix? no
New feature? yes
Tickets Fix #...
License MIT

This PR is based on the awesome work of @stakovicz in: #90

TODO

  • Move logic for data attribute from twig files to form types
  • Use Symfony Button FormType for Add and Remove
  • Implement Toolbar FormType for extendability over Form Extensions (Copy & Paste, ..)
  • Add Toolbar and ButtonType over symfony Form for easier theming and extending
  • Make JS component compatible with new form type and simplify the logic
  • Fix possibility of overwrite data-controller for customization
  • Keep nested collections in mind
  • Find a way to use entry_type instead of ux_entry_type

stakovicz and others added 30 commits July 18, 2022 22:47
From UXCollectionType to the view
Comment on lines +14 to +15
class UXCollectionEntryToolbarType extends AbstractType
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The UXCollectionEntryToolbarType and UXCollectionToolbarType allows to add additional buttons later via a form extension. Example can be a Copy & Paste Functionality.

@alexander-schranz alexander-schranz mentioned this pull request Jul 18, 2022
2 tasks
@dunglas
Copy link
Member

dunglas commented Jul 19, 2022

Does this approach support nested dynamic collections (here is a test case: https://github.com/symfony/ux/tree/e901026aa1d2e2cd2b27a5796962bc8fc4b5dcca/src/Collection/Tests/app/Form)?

For the record, I proposed an alternative patch in #398 which doesn't require changing the existing forms to use this feature (see #398 (comment) for the rationale).

@alexander-schranz
Copy link
Contributor Author

@dunglas yes you can have and I'm using nested collections this way. But like documented in the CollectionType you should use the different prototype_name to avoid conflicts between the 2 prototypes.

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.

3 participants