-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fix dragging annotation into a different orga’s dataset #7816
Conversation
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.
Thanks for this improvement 🙏
I only found one potential improvement of the changes. But as I am unsure whether my suggestion keeps the same functionality, feel free to ignore it and merge
organizationName = if (overwritingDatasetName.isDefined) overwritingOrganizationName | ||
else parseOrganizationName(parameters \ "experiment") |
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.
Shouldn't the if-check check for overwritingOrganizationName
being defined and not for overwritingDatasetName
? Or is there some other place where it is ensured that in case overwritingDatasetName
is defined, then overwritingOrganizationName
is also defined?
And maybe the same syntax as in the line above can be used here as well, as imo the code is more readable this way. Or is there a semantic difference between my suggestion and your code?
organizationName = if (overwritingDatasetName.isDefined) overwritingOrganizationName | |
else parseOrganizationName(parameters \ "experiment") | |
organizationName = overwritingOrganizationName.getOrElse(parseOrganizationName(parameters \ "experiment")) |
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.
Yes, there is in fact a difference. I want the overwritingOrganizationName, even if it is None, if the overwritingDatasetName is defined.
This case will probably not happen, because the frontend sends both or neither. But from the backend point of view, the organizationName from the NML becomes invalid once the datasetName is overwritten (this was already the case before this PR). So in that moment I want to yield the None, so that it will later be filled by the disambiguation logic via dataset name, and not the organizationName from the NML.
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.
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.
Found a CSP fix 🎉
When drag’n’dropping an annotation into a dataset in view-mode, the annotation is uploaded into that dataset, regardless of what dataset is reference din the NML tags.
This PR now makes this available if the organization name has changed as well.
URL of deployed dev instance (used for testing):
Steps to test:
Issues: