Allow populating datasets from a selection
https://redmine.teklia.com/issues/11578
Requires backend#1958 (closed)
The DatasetPopulate type in src/api/dataset.ts should include the new use_selection boolean option. It should use a union of types to enforce that either use_selection is false or just not set, or parent_id and recursive are not set, to ensure we do not do both at once. A similar check is already being done in DeleteWorkerResultsParameters.
The src/components/Corpus/Datasets/Populate.vue component should:
- Accept a new
selectionboolean prop defaulting tofalse. When it is enabled, the subtitle in the modal should show "Based on selected elements incorpus name". - Have its
unsupportedFilterNamesproperty return nothing whenselectionis set. Navigation filters are not present in the context of the selection page, so a warning about filters would just cause more confusion. - Have its
submitmethod setuse_selectiontotruewhen calling thePopulateDatasetendpoint when theselectionflag is set. - Have its
submitmethod throw an error when bothselectionandparentIdare set, as those are forbidden together.