feat: enable to select collections as components in problems picker #2
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.
This pull request introduces enhanced support for bulk selection and management of collections and their components in the library authoring interface. The main changes add the ability to select entire collections, track selection status (selected/indeterminate), and ensure consistent UI feedback when interacting with collections and their components. Filtering logic has also been updated to ensure all relevant items remain available for selection workflows.
Bulk selection and collection management:
ComponentPickerContext.tsxto track selected collections and their status (selectedorindeterminate). Also introduced logic for updating collection selection status when components are added or removed, supporting both individual and bulk operations. [1] [2]AddComponentWidgetto support bulk selection of all components in a collection, including logic to build component lists and count collection membership. The widget now displays checkboxes that reflect collection selection status and supports indeterminate states. [1] [2] [3]UI integration and feedback:
CollectionCardandComponentCardto use the updatedAddComponentWidget, enabling bulk selection on collection cards and correct checkbox display for both collections and components. [1] [2] [3] [4]Filtering logic improvements:
LibraryAuthoringPage.tsxandLibraryContent.tsxto ensure all components remain available for selection, even when viewing the Collections tab. This supports workflows where components are added to xblocks by selecting an entire collection. [1] [2] [3]Context and provider updates:
selectedCollectionsstate, ensuring all components have access to the latest selection data. [1] [2]How to test
Make sure you have a collection in your Libraries ( http://apps.local.openedx.io:2001/authoring/libraries ) with questions in it
Settings > Advanced Settingsand add"examquestionbank"to the list ofAdvanced module listAdvancedin the component selector and add anExam Question BankAdd Problemsand select a collection; it should be selected and deselected properly, and once you clickAdd Selected Components, they should be displayed in the xblock as will be shown in the following screencastScreencast
Screencast.from.09-01-26.14.40.43.webm