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

Feature/sort by buttons #5544

Merged
merged 12 commits into from Feb 13, 2023
Merged

Conversation

bernhardh
Copy link
Contributor

@bernhardh bernhardh commented Jan 25, 2023

As discussed, a couple of days ago on discord, this PR reintroduces optionally the up/down buttons for repeater and builder. By default, the buttons are disabled (not shown), so its a none breaking change. If you don't use it, you will not see any change.

To enable just change the config (forms.components.repeater.up_and_down_buttons and forms.components.builder.up_and_down_buttons).

When enabled, it will look like this:

image

Same goes for the builder. In the following example, i Have enabled collapsible and clonable as well, just to see multiple icons:

image

@what-the-diff
Copy link
Contributor

what-the-diff bot commented Jan 25, 2023

  • Added a new property isReorderableWithButtons to the Builder and Repeater components.
  • Updated the builder component template with buttons for moving items up/down in case this feature is enabled (defaults to false).
  • Updated the repeater component template with buttons for moving items up/down in case this feature is enabled (defaults to false).
  • Added helper functions: array_move_after, array_move_before, blank & filled which are used by these features internally but can be useful elsewhere as well so I added them here instead of creating another package just for those helpers :)

@zepfietje zepfietje added the enhancement New feature or request label Jan 25, 2023
@zepfietje zepfietje added this to the v2 milestone Jan 25, 2023
packages/forms/src/helpers.php Show resolved Hide resolved
packages/forms/src/helpers.php Show resolved Hide resolved
packages/forms/config/forms.php Outdated Show resolved Hide resolved
@danharrin danharrin marked this pull request as draft January 29, 2023 20:43
bernhardh and others added 5 commits January 30, 2023 10:37
…ature/sort-by-buttons

# Conflicts:
#	packages/forms/config/forms.php
#	packages/forms/resources/views/components/repeater.blade.php
@bernhardh
Copy link
Contributor Author

All requested changes done. Thank you!

@zepfietje zepfietje marked this pull request as ready for review January 30, 2023 11:34
@bernhardh bernhardh requested review from danharrin and zepfietje and removed request for danharrin and zepfietje February 1, 2023 15:03
@bernhardh
Copy link
Contributor Author

Any chance, that this PR gets merged soon?

@danharrin danharrin merged commit 196886c into filamentphp:2.x Feb 13, 2023
@danharrin
Copy link
Member

Thanks

@bernhardh bernhardh deleted the feature/sort-by-buttons branch December 4, 2023 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants