Merged
Conversation
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Changes in this pull request
Resolves #2233
Additional info
This pull request refactors how selected rows and their types are managed in the recycle bin module. The main improvement is the introduction of a custom context that tracks both the selection state and the types of selected items, enabling batch actions to function without receiving the full items list as a prop. This change simplifies component interfaces and centralizes selection logic.
Refactoring and State Management Improvements:
SelectedRowsProvideranduseSelectedRowsContextimplementation inselected-items-context.tsx, which manages both the selected row IDs and a mapping of selected row types, and exposes methods to update and reset selection state. ([assets/js/src/core/modules/recycle-bin/context/selected-items-context.tsxR1-R85](https://github.com/pimcore/studio-ui-bundle/pull/3388/files#diff-92c0f882f3d0abfc06b7a887c7a703322e23488286de3e40768c6d2fdeeffe6aR1-R85))TableandBatchActionscomponents to use the new context, removing the need to pass the full items list to batch actions and enabling selection state updates to also track item types. ([[1]](https://github.com/pimcore/studio-ui-bundle/pull/3388/files#diff-97f4b6c11d9c15c7f700a092d0f962e6f73cf140d9082354a4203397e2b5ccbeL162-R162),[[2]](https://github.com/pimcore/studio-ui-bundle/pull/3388/files#diff-0eee8d5aefec832169bbd20008db851ae841ab5be5ab7ac17bee47ab01385bbfL20-R29),[[3]](https://github.com/pimcore/studio-ui-bundle/pull/3388/files#diff-0eee8d5aefec832169bbd20008db851ae841ab5be5ab7ac17bee47ab01385bbfL44-R39),[[4]](https://github.com/pimcore/studio-ui-bundle/pull/3388/files#diff-0eee8d5aefec832169bbd20008db851ae841ab5be5ab7ac17bee47ab01385bbfL56-R49),[[5]](https://github.com/pimcore/studio-ui-bundle/pull/3388/files#diff-3ea697f6b7512dc9ed9a4a2bf8895ab94383c1d1e1b2686b20abe25de9c33d27L81-R81))selected-items-context.ts. ([assets/js/src/core/modules/recycle-bin/context/selected-items-context.tsL1-L17](https://github.com/pimcore/studio-ui-bundle/pull/3388/files#diff-4f33c104766830b0b0fe3c7a87255e02ba12054cb7376a35934ddb38ab6c3ef9L1-L17))RecycleBinContainerto match the new provider signature. ([assets/js/src/core/modules/recycle-bin/recycle-bin-container.tsxL17-R17](https://github.com/pimcore/studio-ui-bundle/pull/3388/files#diff-89cf46593a70cb19e802436fc7d23d9df1d7b6e7c2dff49d2b04bdad155caf79L17-R17))