Skip to content

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 selection boolean prop defaulting to false. When it is enabled, the subtitle in the modal should show "Based on selected elements in corpus name".
  • Have its unsupportedFilterNames property return nothing when selection is 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 submit method set use_selection to true when calling the PopulateDataset endpoint when the selection flag is set.
  • Have its submit method throw an error when both selection and parentId are set, as those are forbidden together.