Skip to content

Commit

Permalink
allow DCEs to be dropped to tool form
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Sep 3, 2024
1 parent 29a023d commit 4b9116b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions client/src/components/Form/Elements/FormData/FormData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { BAlert, BButton, BButtonGroup, BCollapse, BFormCheckbox, BTooltip } from "bootstrap-vue";
import { computed, onMounted, type Ref, ref, watch } from "vue";
import { isDatasetElement, isDCE } from "@/api";
import { getGalaxyInstance } from "@/app";
import { useDatatypesMapper } from "@/composables/datatypesMapper";
import { useUid } from "@/composables/utils/uid";
Expand Down Expand Up @@ -314,11 +315,21 @@ function handleIncoming(incoming: Record<string, unknown>, partial = true) {
const incomingValues: Array<DataOption> = [];
values.forEach((v) => {
// Map incoming objects to data option values
let newSrc;
if (isDCE(v)) {
if (isDatasetElement(v)) {
newSrc = SOURCE.DATASET;
v = v.object;
} else {
newSrc = SOURCE.COLLECTION_ELEMENT;
}
} else {
newSrc =
v.src || (v.history_content_type === "dataset_collection" ? SOURCE.COLLECTION : SOURCE.DATASET);
}
const newHid = v.hid;
const newId = v.id;
const newName = v.name ? v.name : newId;
const newSrc =
v.src || (v.history_content_type === "dataset_collection" ? SOURCE.COLLECTION : SOURCE.DATASET);
const newValue: DataOption = {
id: newId,
src: newSrc,
Expand Down

0 comments on commit 4b9116b

Please sign in to comment.