Commit 29cfc51b authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge remote-tracking branch 'origin/master' into...

Merge remote-tracking branch 'origin/master' into 928-anonymous-logged-in-after-reopening-the-browser
parents 1dc5c450 f94ea25c
......@@ -13,7 +13,9 @@ minerva (14.0.0~beta.0) unstable; urgency=low
* Small improvement: information about person who uploaded project is visible
in list of projects (#927)
* Small improvement: user role introduced in edit user dialog (#924)
* Bug fix: work on FF Private Window mode could cause logout or raise an
* Small improvement: tab with list of glyps is available when adding project
with glyphs (#925)
* Bug fix: work on FF Private Window mode could cause logout or raise an
error on when opening new tab with minerva (#892)
* Bug fix: fetching list of miRnas resulted sometimes in "Internal Server
Error" (#889)
......@@ -51,6 +53,8 @@ minerva (14.0.0~beta.0) unstable; urgency=low
* Bug fix: after genome is removed list of genomes is refreshed (#922)
* Bug fix: when session expired anonymous user could access admin panel with
very limited access (#928)
* Bug fix: migrating from old minerva will grant WRITE_PROJECT privilege to
users who have manage comments or manage overlays privilege (#902)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 21 Aug 2019 21:00:00 +0200
......
......@@ -80,7 +80,6 @@ AddProjectDialog.prototype.createGui = function () {
content: self.createOverviewImagesTabContent(),
disabled: true
});
};
/**
......@@ -573,7 +572,7 @@ AddProjectDialog.prototype._createGlyphsTable = function () {
var data = [];
for (var i = 0; i < entries.length; i++) {
var entry = entries[i];
if (entry.getType() === "GLYPHS") {
if (entry.getType() === "GLYPH") {
var row = [];
row[0] = entry.getFilename();
data.push(row);
......@@ -1366,7 +1365,7 @@ AddProjectDialog.prototype.setZipFileContent = function (file) {
images++;
} else if (entry.getType() === 'OVERLAY') {
overlays++;
} else if (entry.getType() === 'GLYPHS') {
} else if (entry.getType() === 'GLYPH') {
glyphs++;
}
}
......
......@@ -1195,8 +1195,6 @@ GuiUtils.prototype.hideTab = function (abstractGuiElement, panel) {
GuiUtils.prototype.disableTab = function (element, message) {
var hideReason = $(".minerva-hide-reason", element);
if (hideReason.length === 0) {
console.log("not hidden");
$(element).children().css("visibility", "hidden");
$("[class='minerva-help-button']", element).children().css("visibility", "visible");
var hideReasonDiv = document.createElement("div");
......
......@@ -16,11 +16,32 @@ alter table reaction_table add column product integer;
alter table reaction_table add column input_operator integer;
alter table reaction_table add column output_operator integer;
update reaction_table set reactant = (select id from reaction_node_table where node_type_db='REACTANT_NODE' and reaction_id=reaction_table.id order by id limit 1);
update reaction_table set product = (select id from reaction_node_table where node_type_db='PRODUCT_NODE' and reaction_id=reaction_table.id order by id limit 1);
--old version of computing first reactant, product, input and output operators (this version is ~100 slower than new one). This is an issue for big maps. For db with 30k reactions it toook 25minutes
--
--update reaction_table set reactant = (select id from reaction_node_table where node_type_db='REACTANT_NODE' and reaction_id=reaction_table.id order by id limit 1);
--update reaction_table set product = (select id from reaction_node_table where node_type_db='PRODUCT_NODE' and reaction_id=reaction_table.id order by id limit 1);
--update reaction_table set input_operator = (select id from reaction_node_table where node_type_db in ('AND_OPERATOR_NODE', 'ASSOCIATION_OPERATOR_NODE', 'NAND_OPERATOR_NODE', 'OR_OPERATOR_NODE', 'UNKNOWN_OPERATOR_NODE') and reaction_id=reaction_table.id order by id limit 1);
--update reaction_table set output_operator = (select id from reaction_node_table where node_type_db in ('DISSOCIATION_OPERATOR_NODE', 'SPLIT_OPERATOR_NODE', 'TRUNCATION_OPERATOR_NODE') and reaction_id=reaction_table.id order by id limit 1);
update reaction_table set input_operator = (select id from reaction_node_table where node_type_db in ('AND_OPERATOR_NODE', 'ASSOCIATION_OPERATOR_NODE', 'NAND_OPERATOR_NODE', 'OR_OPERATOR_NODE', 'UNKNOWN_OPERATOR_NODE') and reaction_id=reaction_table.id order by id limit 1);
update reaction_table set output_operator = (select id from reaction_node_table where node_type_db in ('DISSOCIATION_OPERATOR_NODE', 'SPLIT_OPERATOR_NODE', 'TRUNCATION_OPERATOR_NODE') and reaction_id=reaction_table.id order by id limit 1);
create table tmp_node (
node_id integer,
node_type_db varchar,
reaction_id integer,
CONSTRAINT tmp_fkey FOREIGN KEY (reaction_id)
REFERENCES reaction_table (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
);
insert into tmp_node select min(id), node_type_db, reaction_id from reaction_node_table group by node_type_db, reaction_id;
insert into tmp_node select min(id), 'INPUT_NODE', reaction_id from reaction_node_table where node_type_db in ('AND_OPERATOR_NODE', 'ASSOCIATION_OPERATOR_NODE', 'NAND_OPERATOR_NODE', 'OR_OPERATOR_NODE', 'UNKNOWN_OPERATOR_NODE') group by reaction_id;
insert into tmp_node select min(id), 'OUTPUT_NODE', reaction_id from reaction_node_table where node_type_db in ('DISSOCIATION_OPERATOR_NODE', 'SPLIT_OPERATOR_NODE', 'TRUNCATION_OPERATOR_NODE') group by reaction_id;
update reaction_table set reactant = tmp_node.node_id from tmp_node where tmp_node.reaction_id=reaction_table.id and tmp_node.node_type_db = 'REACTANT_NODE';
update reaction_table set product = tmp_node.node_id from tmp_node where tmp_node.reaction_id=reaction_table.id and tmp_node.node_type_db = 'PRODUCT_NODE';
update reaction_table set input_operator = tmp_node.node_id from tmp_node where tmp_node.reaction_id=reaction_table.id and tmp_node.node_type_db = 'INPUT_NODE';
update reaction_table set output_operator = tmp_node.node_id from tmp_node where tmp_node.reaction_id=reaction_table.id and tmp_node.node_type_db = 'OUTPUT_NODE';
drop table tmp_node;
update reaction_table set start_point = (select one_before_last_point from reaction_node_table, polyline_data_table where reaction_node_table.id = reaction_table.reactant and polyline_data_table.id = line_id);
update reaction_table set end_point = (select second_point from reaction_node_table, polyline_data_table where reaction_node_table.id = reaction_table.product and polyline_data_table.id = line_id);
......
--remove artifacts (privileges to non-existing projects)
delete from privilege_table where (type = 'VIEW_PROJECT' or type ='EDIT_COMMENTS_PROJECT') and not id_object in (select id from project_table);
delete from privilege_table where (type = 'VIEW_PROJECT' or type ='EDIT_COMMENTS_PROJECT' or type='LAYOUT_MANAGEMENT') and not id_object in (select id from project_table);
alter table privilege_table rename column id_object to object_id;
delete from privilege_table where level = 0;
......@@ -34,6 +34,12 @@ from (select user_id, object_id from privilege_table where type = 'VIEW_PROJECT'
inner join (select id, object_id from privilege_table where type = 'READ_PROJECT') s2
on s1.object_id = s2.object_id;
insert into user_privilege_map_table (user_id, privilege_id)
select s1.user_id, s2.id
from (select user_id, object_id from privilege_table where type = 'EDIT_COMMENTS_PROJECT' or type = 'LAYOUT_MANAGEMENT') s1
inner join (select id, object_id from privilege_table where type = 'WRITE_PROJECT') s2
on s1.object_id = s2.object_id;
insert into user_privilege_map_table (user_id, privilege_id)
select s1.user_id, s2.id
from (select user_id, object_id from privilege_table where type = 'VIEW_PROJECT' and user_id in (select user_id from privilege_table where type = 'ADD_MAP')) s1
......
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