diff --git a/components/VFBMain.js b/components/VFBMain.js index 4082c5264..dd08f23cc 100644 --- a/components/VFBMain.js +++ b/components/VFBMain.js @@ -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) { diff --git a/components/configuration/VFBUploader/configuration.json b/components/configuration/VFBUploader/configuration.json index 85f1df101..3dba31390 100644 --- a/components/configuration/VFBUploader/configuration.json +++ b/components/configuration/VFBUploader/configuration.json @@ -5,7 +5,7 @@ "acceptedFiles" : [".swc", ".nrrd"], "filesLimit" : 1, "maxFileSize" : 5242880, - "queryType": "uploaderQuery", + "queryType": "SimilarMorphologyToUserData", "cookieStorageDays" : 100, "cookiesLearnLink" : "https://en.wikipedia.org/wiki/HTTP_cookie", "text" : { @@ -13,14 +13,14 @@ "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" } diff --git a/components/interface/VFBUploader/VFBUploader.js b/components/interface/VFBUploader/VFBUploader.js index 198a77424..58d8daec5 100644 --- a/components/interface/VFBUploader/VFBUploader.js +++ b/components/interface/VFBUploader/VFBUploader.js @@ -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);