Skip to content

Commit

Permalink
fixes #743
Browse files Browse the repository at this point in the history
  • Loading branch information
umut-er committed Aug 16, 2024
1 parent a45b9f1 commit 4b3b32c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 53 deletions.
49 changes: 6 additions & 43 deletions app/js/app-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ module.exports = function() {
};
var error = function(data){
promptFileConversionErrorView.render();
document.getElementById("file-conversion-error-message").innerText = "Conversion service is not available!";
document.getElementById("file-conversion-error-message").innerText = "Conversion failed.";
},
caller = chiseInstance.loadSbmlForSBML;
params = [success, error, layoutBy];
Expand All @@ -431,7 +431,7 @@ module.exports = function() {
};
var error = function(data){
promptFileConversionErrorView.render();
document.getElementById("file-conversion-error-message").innerText = "Conversion service is not available!";
document.getElementById("file-conversion-error-message").innerText = "Conversion failed.";
};
caller = chiseInstance.loadCellDesigner;
params = [success, error];
Expand All @@ -443,7 +443,7 @@ module.exports = function() {
};
var error = function(data){
promptFileConversionErrorView.render();
document.getElementById("file-conversion-error-message").innerText = "Conversion service is not available!";
document.getElementById("file-conversion-error-message").innerText = "Conversion failed.";

};
caller = chiseInstance.loadGpml;
Expand Down Expand Up @@ -492,7 +492,7 @@ module.exports = function() {
},
error = function(data){
promptFileConversionErrorView.render();
document.getElementById("file-conversion-error-message").innerText = "Conversion service is not available!";
document.getElementById("file-conversion-error-message").innerText = "Conversion failed.";
});

$(this).val("");
Expand Down Expand Up @@ -611,7 +611,7 @@ module.exports = function() {
chiseInstance.loadSBMLText(data.message, false, file.name, cy);
}, error = function(data){
promptFileConversionErrorView.render();
document.getElementById("file-conversion-error-message").innerText = "Conversion service is not available!";
document.getElementById("file-conversion-error-message").innerText = "Conversion failed.";

}, layoutBy)
};
Expand All @@ -622,43 +622,6 @@ module.exports = function() {

$(this).val("");
}
/*
var chiseInstance = appUtilities.getActiveChiseInstance();
console.log("in imprt sbml file")
var cy = appUtilities.getActiveCy();
if ($(this).val() != "") {
var file = this.files[0];
var loadFcn = function() {
var layoutBy = function() {
appUtilities.triggerLayout( cy, true );
};
}
var layoutBy = function() {
appUtilities.triggerLayout( cy, true );
console.log("in layoutBy")
};
appUtilities.setFileContent(file.name);
chiseInstance.loadSbml(file, success = function(data){
if (cy.elements().length !== 0) {
promptConfirmationView.render(function () {
chiseInstance.loadSBMLText(data.message, false, file.name, cy);
});
}
else {
chiseInstance.loadSBMLText(data.message, false, file.name, cy);
}
},
error = function(data){
promptFileConversionErrorView.render();
document.getElementById("file-conversion-error-message").innerText = "Conversion service is not available!";
}, layoutBy);
$(this).val("");
}
*/

});

$("#gpml-file-input").change(function () {
Expand All @@ -680,7 +643,7 @@ module.exports = function() {
},
error = function(data){
promptFileConversionErrorView.render();
document.getElementById("file-conversion-error-message").innerText = "Conversion service is not available!";
document.getElementById("file-conversion-error-message").innerText = "Conversion failed.";

});

Expand Down
28 changes: 18 additions & 10 deletions app/js/backbone-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -3646,7 +3646,7 @@ var FileSaveView = Backbone.View.extend({
});
promptSbmlConversionErrorView.render();
document.getElementById("file-conversion-error-message").innerText =
"Conversion service is not available!";
"Conversion failed!";
});
$(self.el).modal("toggle");
return;
Expand Down Expand Up @@ -3704,15 +3704,24 @@ var FileSaveView = Backbone.View.extend({
saveAsFcn(filename, version, renderInfo, properties, nodes, edges);
}
} else if (fileformat === "celldesigner") {
if(mapType == "SBML"){
chiseInstance.saveSbmlForSBML(filename, function (data, errorMessage) {
var exportError = new ExportErrorView({el: "#exportError-table"});
exportError.render();
document.getElementById("export-error-message").innerText
= "SBML export failed. Please check if the map is valid!";
});
} else if(mapType == "PD"){
chiseInstance.saveAsCellDesigner(filename, function () {
var promptFileConversionErrorView =
new PromptFileConversionErrorView({
el: "#prompt-fileConversionError-table",
});
promptFileConversionErrorView.render();
document.getElementById("file-conversion-error-message").innerText =
"Conversion service is not available!";
});
var promptFileConversionErrorView =
new PromptFileConversionErrorView({
el: "#prompt-fileConversionError-table",
});
promptFileConversionErrorView.render();
document.getElementById("file-conversion-error-message").innerText =
"Conversion failed.";
});
}
} else if (fileformat === "sbml") {

if (mapType === "PD") {
Expand All @@ -3739,7 +3748,6 @@ var FileSaveView = Backbone.View.extend({
el: "#prompt-sbmlConversionError-table",
});
promptSbmlConversionErrorView.render(data, errorMessage);
//document.getElementById("file-conversion-error-message").innerText = "Conversion service is not available!";
});
} else if (fileformat === "sif") {
chiseInstance.saveAsPlainSif(filename, true);
Expand Down

0 comments on commit 4b3b32c

Please sign in to comment.