Skip to content
Snippets Groups Projects
Commit 5e1f5d04 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

download status extractet to a method

parent 3605048e
No related branches found
No related tags found
2 merge requests!345Resolve "Genes annotations don't show",!344Resolve "Genome browser in submaps not working"
......@@ -363,18 +363,8 @@ EditGenomeDialog.prototype.init = function () {
genomeLocalUrlInput.val(genome.getLocalUrl());
genomeLocalUrlInput.prop("disabled", true);
var progress;
if (genome.getDownloadProgress() === 100) {
if (genome.getLocalUrl() !== undefined) {
progress = "READY";
} else {
progress = "ERROR";
}
} else {
progress = genome.getDownloadProgress();
}
var genomeProgressInput = $("[name=genomeProgress]", self.getElement());
genomeProgressInput.val(progress);
genomeProgressInput.val(genome.getDownloadProgressStatus());
genomeProgressInput.prop("disabled", true);
});
......
......@@ -164,15 +164,7 @@ GenomeAdminPanel.prototype.genomeToTableRow = function (genome, user) {
row[0] = genome.getType();
row[1] = self.getGuiUtils().createAnnotationLink(genome.getOrganism()).outerHTML;
row[2] = genome.getVersion();
if (genome.getDownloadProgress() === 100) {
if (genome.getLocalUrl() !== undefined) {
row[3] = "READY";
} else {
row[3] = "ERROR";
}
} else {
row[3] = genome.getDownloadProgress();
}
row[3] = genome.getDownloadProgressStatus();
row[4] = genome.getSourceUrl();
var disabled = " disabled ";
......
......@@ -75,6 +75,27 @@ ReferenceGenome.prototype.setDownloadProgress = function (downloadProgress) {
};
/**
*
* @returns {string}
*/
ReferenceGenome.prototype.getDownloadProgressStatus = function () {
if (this.getDownloadProgress() === 100) {
if (this.getLocalUrl() !== undefined) {
return "READY";
} else {
return "ERROR";
}
} else {
if (this.getDownloadProgress() === undefined) {
return "N/A";
} else {
return this.getDownloadProgress().toString();
}
}
};
/**
*
* @param {Annotation} organism
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment