Commit 0fbe97da authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '914-restrict-organism-to-taxonomy-id-in-edit-project' into 'master'

Resolve "restrict Organism to Taxonomy id in Edit project"

Closes #914

See merge request !906
parents 70dd55fc 9b8e0532
Pipeline #13138 passed with stage
in 13 minutes and 4 seconds
......@@ -9,6 +9,7 @@ minerva (14.0.0~beta.0) unstable; urgency=low
* Bug fix: fetching list of miRnas resulted sometimes in "Internal Server
Error" (#889)
* Bug fix: user without admin right can accept terms of service (#893)
* Bug fix: edit project dialog verifies organism id (#914)
* Bug fix: user without admin or curator privileges shouldn't be able to
check logs (#894)
* Bug fix: user without admin or curator privileges had issues with accesing
......
......@@ -300,9 +300,23 @@ EditProjectDialog.prototype.createGeneralTabContent = function () {
content: "<input name='projectOrganism'/>",
xss: false,
onchange: function () {
var id = $("[name='projectOrganism']", this).val();
var project = self.getProject();
project.setOrganism(prepareMiriamData("TAXONOMY", $("[name='projectOrganism']", this).val()));
return self.updateProject(project);
GuiConnector.showProcessing();
return self.getServerConnector().getTaxonomy({id: id}).catch(function () {
if (id !== "") {
var newId = "";
if (project.getOrganism() !== undefined) {
newId = xss(project.getOrganism().getResource());
}
$("[name='projectOrganism']", this).val(newId);
$("[name='projectOrganism']", this).focus();
throw new ValidationError("Invalid taxonomy id: " + id);
}
}).then(function () {
project.setOrganism(prepareMiriamData("TAXONOMY", id));
return self.updateProject(project);
}).catch(GuiConnector.alert).finally(GuiConnector.hideProcessing);
}
}));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment