Unverified Commit 7f057c93 authored by Marius van den Beek's avatar Marius van den Beek Committed by GitHub
Browse files

Merge pull request #17268 from mvdbeek/fix_element_not_copied

[23.1] Always copy datasets in collection builder modals
parents 5ba634b0 e4f8315c
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ function listCollectionCreatorModal(elements, options) {
 */
function createListCollection(contents, defaultHideSourceItems = true) {
    const elements = contents.toJSON();
    let copyElements;
    const promise = listCollectionCreatorModal(elements, {
        defaultHideSourceItems: defaultHideSourceItems,
        creationFn: function (elements, name, hideSourceItems) {
@@ -38,8 +37,7 @@ function createListCollection(contents, defaultHideSourceItems = true) {
                //TODO: this allows for list:list even if the filter above does not - reconcile
                src: element.src || (element.history_content_type == "dataset" ? "hda" : "hdca"),
            }));
            copyElements = !hideSourceItems;
            return contents.createHDCA(elements, "list", name, hideSourceItems, copyElements);
            return contents.createHDCA(elements, "list", name, hideSourceItems);
        },
    });
    return promise;
+1 −3
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ function pairCollectionCreatorModal(elements, options) {
}
function createPairCollection(contents, defaultHideSourceItems = true) {
    var elements = contents.toJSON();
    var copyElements;
    var promise = pairCollectionCreatorModal(elements, {
        defaultHideSourceItems: defaultHideSourceItems,
        creationFn: function (elements, name, hideSourceItems) {
@@ -32,8 +31,7 @@ function createPairCollection(contents, defaultHideSourceItems = true) {
                { name: "forward", src: elements[0].src || "hda", id: elements[0].id },
                { name: "reverse", src: elements[1].src || "hda", id: elements[1].id },
            ];
            copyElements = !hideSourceItems;
            return contents.createHDCA(elements, "paired", name, hideSourceItems, copyElements);
            return contents.createHDCA(elements, "paired", name, hideSourceItems);
        },
    });
    return promise;
+1 −3
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ function pairedListCollectionCreatorModal(elements, options) {
 */
function createPairedListCollection(contents, defaultHideSourceItems) {
    const elements = contents.toJSON();
    var copyElements;
    const promise = pairedListCollectionCreatorModal(elements, {
        defaultHideSourceItems: defaultHideSourceItems,
        creationFn: function (elements, name, hideSourceItems) {
@@ -48,8 +47,7 @@ function createPairedListCollection(contents, defaultHideSourceItems) {
                    },
                ],
            }));
            copyElements = !hideSourceItems;
            return contents.createHDCA(elements, "list:paired", name, hideSourceItems, copyElements);
            return contents.createHDCA(elements, "list:paired", name, hideSourceItems);
        },
    });
    return promise;
+1 −2
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ function createCollectionViaRules(selection, defaultHideSourceItems = true) {
    let elementsType;
    let importType;
    const selectionType = selection.selectionType;
    const copyElements = !defaultHideSourceItems;
    if (!selectionType) {
        // Have HDAs from the history panel.
        elements = selection.toJSON();
@@ -81,7 +80,7 @@ function createCollectionViaRules(selection, defaultHideSourceItems = true) {
        ftpUploadSite: selection.ftpUploadSite,
        defaultHideSourceItems: defaultHideSourceItems,
        creationFn: function (elements, collectionType, name, hideSourceItems) {
            return selection.createHDCA(elements, collectionType, name, hideSourceItems, copyElements);
            return selection.createHDCA(elements, collectionType, name, hideSourceItems);
        },
    });
    return promise;
+1 −2
Original line number Diff line number Diff line
@@ -45,12 +45,11 @@ const createBackboneContent = (historyId, selection) => {
        toJSON: () => selectionJson,
        // result must be a $.Deferred object instead of a promise because
        // that's the kind of deprecated data format that backbone likes to use.
        createHDCA(element_identifiers, collection_type, name, hide_source_items, copy_elements, options = {}) {
        createHDCA(element_identifiers, collection_type, name, hide_source_items, options = {}) {
            const def = jQuery.Deferred();
            return def.resolve(null, {
                collection_type,
                name,
                copy_elements,
                hide_source_items,
                element_identifiers,
                options,
Loading