Add bulk actions (attach, detach, manage) to Spatie Laravel Tags Plugin#20124
Closed
intrepidws wants to merge 11 commits into
Closed
Add bulk actions (attach, detach, manage) to Spatie Laravel Tags Plugin#20124intrepidws wants to merge 11 commits into
intrepidws wants to merge 11 commits into
Conversation
…SpatieTagsBulkAction
Member
|
Thanks for you work here, I think I am going to pass though. In my opinion customisability is quite important for tagging UIs as tags can be used in a variety of ways, and I think having users define these in their apps is probably not too bad. I would suggest opening discussion threads in the future and tagging me to suggest big features like this as it helps us validate it first before you spend time on the implementation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds table bulk actions to the
filament/spatie-laravel-tags-pluginpackage. Until now the plugin shipped a form field (SpatieTagsInput), a table column (SpatieTagsColumn), and an infolist entry (SpatieTagsEntry), but there was no way to tag many records at once. These actions fill that gap, mirroring the behavior and options of the existingSpatieTagsInput.Three new bulk actions are added:
AttachSpatieTagsBulkAction— opens a modal with a tags input and attaches the chosen tags to every selected record. Existing tags on a record are preserved (viasyncWithoutDetaching), and tags that don't exist yet are created.DetachSpatieTagsBulkAction— removes the chosen tags from the selected records without deleting the tags themselves from the database.ManageSpatieTagsBulkAction— a single modal with two tags inputs, so users can attach some tags and detach others in one pass. Each record's attach + detach is wrapped in aDB::transactionso a mid-record failure can't leave it half-updated.Visual changes
Functional changes
composer cscommand.