Skip to content

Commit

Permalink
Merge pull request #1553 from VirtualFlyBrain/alpha
Browse files Browse the repository at this point in the history
user interface changes after user testing of v2.2.4.0 RC
  • Loading branch information
Robbie1977 authored Jul 9, 2024
2 parents 707ca0c + 596e94a commit ede09a2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
15 changes: 15 additions & 0 deletions components/VFBMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,21 @@ class VFBMain extends React.Component {
multipleQueries?.forEach( query => {
const querySplit = query.split(",");
that.urlQueryLoader.push({ id : querySplit[0].trim(), selection : querySplit[1].trim() });
if (querySplit[1].trim() == "SimilarMorphologyToUserData") {
// if a user data query is called and the VFBu_ id is not loaded after timeout then it must still be being analysed
let url = window.location.origin + window.location.pathname + "?q=" + query;
// Use an IIFE (Immediately Invoked Function Expression) to create a closure and capture the variables
(function(querySplit, url) {
setTimeout(function() {
if (window[querySplit[0].trim()] == undefined) {
if (confirm("The image you uploaded is still being analysed; this can take over an hour. \nClick OK to check again or Cancel to just open VFB.")) {
window.ga('vfb.send', 'event', 'opening', 'uploadQuery', querySplit[0].trim());
window.open(url, "_self");
}
}
}, 10000);
})(querySplit, url);
}
});
// if no other ids are loaded the query target is added.
if (idsList.length == 0 && this.urlQueryLoader.length > 1) {
Expand Down
8 changes: 4 additions & 4 deletions components/configuration/VFBUploader/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
"acceptedFiles" : [".swc", ".nrrd"],
"filesLimit" : 1,
"maxFileSize" : 5242880,
"queryType": "uploaderQuery",
"queryType": "SimilarMorphologyToUserData",
"cookieStorageDays" : 100,
"cookiesLearnLink" : "https://en.wikipedia.org/wiki/HTTP_cookie",
"text" : {
"dialogTitle" : "Upload Data File",
"dialogSubtitle" : "Generate a nblast query from your own data.",
"selectTemplate" : "1. Select a Template",
"select" : "Select",
"addYourFile" : "2. Add your file (Please use a .swc)",
"addYourFile" : "2. Add your file (Please use .swc or .nrrd file)",
"dropZoneMessage" : "Click or Drag & Drop your file here",
"agreeTerms" : "I agree to the use of cookies to store the NBLAST QUERY URL. ",
"learnMore" : "Learn More",
"blastButtonText" : "Generate a nblast query link",
"restartButtonText" : "Restart",
"copyButtonText" : "Copy",
"infoMessage" : "Generating a nblast query can take up to 30 min. Save this link to find the result of your query.",
"copyButtonText" : "Copy Link",
"infoMessage" : "Generating a nblast query can take over an hour. Save this link to find the result of your query.",
"errorDialog" : "Something went wrong... We were not able to generate a nblast query link from your data. Please try again.",
"errorButtonText" : "Try Again"
}
Expand Down
2 changes: 1 addition & 1 deletion components/interface/VFBUploader/VFBUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class VFBUploader extends React.Component {
requestUpload (formData, url) {
let self = this;
let _id = formData.get("vfbID");
let newURL = window.location.origin + window.location.pathname + "&q=" + _id + "," + this.configuration.queryType;
let newURL = window.location.origin + window.location.pathname + "?q=" + _id + "," + this.configuration.queryType;

this.setState({ fileNBLASTURL: newURL, uploading : true });
window.setCookie(_id, newURL, this.configuration.cookieStorageDays);
Expand Down

0 comments on commit ede09a2

Please sign in to comment.