-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[24.2] Fix drag and drop for dataset collection elements #19866
[24.2] Fix drag and drop for dataset collection elements #19866
Conversation
I thought it should show an alert if its the wrong history_content_type for galaxy/client/src/components/Form/Elements/FormData/FormData.vue Lines 468 to 472 in bf47f53
but unfortunately dragging a collection to a dataset type input doesn't do anything then: I'm curious then as to what we should do here 🤔 ? Update:I guess one way would be to change it to: if (props.type === "data") {
// if this input doesn't accept collections at all, return false
if (!validSrcs.value.includes(SOURCE.COLLECTION)) {
$emit("alert", "dataset collection is not a valid input for this dataset parameter.");
return false;
}
// otherwise, collection can always be mapped over a data input ... in theory.
// One day we should also validate the map over model
return true;
} where const validSrcs = computed(() => {
return variant.value ? variant.value.map((v) => v.src) : [];
}); |
This refers to `FormData` elements without the collection variant (only single or multiple dataset variants). Explained in galaxyproject#19866 (comment)
Because, as the comment says, it should work, and it does work on 24.2 right now: |
I would suggest to go back to 139f2d3, restore the |
Compare this to the GIF in my comment. The |
I don't know what collection variant means. This is a simple form data input, and it works fine. If you're fixing something unrelated please describe the issue you're having, and ideally open a different PR. |
Only reason I called it Anyways. Ok. I will revert this PR to just:
and fix the rest targeting dev in another PR. |
This adds `HistoryOrCollectionItem` typing to `FormData` and also fixes the bug with multiple item drag-drop not working.
bdb2cec
to
e7fe2f0
Compare
The first commit 09526e4 fixes this bug (drag and drop not working for DCEs) entirely. The other one e7fe2f0 adds additional typing, as well as fixing another bug of multiple dataset drag and drop not working. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this makes sense to me now, though I worry a little that this might get broken again in the future. A set of regression tests asserting the expected behavior would definitely be nice to have.
Thank you! Yes, I am planning to add good jest coverage (ofc I don't think I can simulate actual drag drop there but at least testing the functions themselves should be possible) in a PR targeting dev. |
Yeah, if you can make sure that what goes in and out of the event drag store is handled correctly I think you can cover a lot of ground. |
This refers to `FormData` elements without the collection variant (only single or multiple dataset variants). Explained in galaxyproject#19866 (comment)
How to test the changes?
(Select all options that apply)
License