diff --git a/CHANGELOG b/CHANGELOG index b7489356167db6ebc3dde0f952f0b30cf770ba03..3253567599735cc861cd49b63521a9885a1f309d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/frontend-js/src/main/js/gui/admin/AddProjectDialog.js b/frontend-js/src/main/js/gui/admin/AddProjectDialog.js index 59a57ee98b003208737cba96ff9ad7fc4dbefb8e..d42a9bbf7d002dc787f8fcda61a32700e4b9a719 100644 --- a/frontend-js/src/main/js/gui/admin/AddProjectDialog.js +++ b/frontend-js/src/main/js/gui/admin/AddProjectDialog.js @@ -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++; } } diff --git a/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js b/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js index e9b8ad55e5ddc9cddcde2e9993362d7d7128591a..658d425042b1e8467a8e3ef18ac7de636b633643 100644 --- a/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js +++ b/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js @@ -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"); diff --git a/persist/src/main/resources/db/migration/14.0.0~alpha.0/V14.0.0.20190527__extract_center_line.sql b/persist/src/main/resources/db/migration/14.0.0~alpha.0/V14.0.0.20190527__extract_center_line.sql index 6a4f8b980fd4141cf61a3e835f1f793531a58d12..5587be387421ff9ef5fdfeea7c62efa55a75c17d 100644 --- a/persist/src/main/resources/db/migration/14.0.0~alpha.0/V14.0.0.20190527__extract_center_line.sql +++ b/persist/src/main/resources/db/migration/14.0.0~alpha.0/V14.0.0.20190527__extract_center_line.sql @@ -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); diff --git a/persist/src/main/resources/db/migration/14.0.0~alpha.0/V14.0.0.20190618__new_permission_model.sql b/persist/src/main/resources/db/migration/14.0.0~alpha.0/V14.0.0.20190618__new_permission_model.sql index 1d41199dc66441b0061393d1fabbb77029458695..37b6f26808c5cd97ce09a1cb465c049a92a5919a 100644 --- a/persist/src/main/resources/db/migration/14.0.0~alpha.0/V14.0.0.20190618__new_permission_model.sql +++ b/persist/src/main/resources/db/migration/14.0.0~alpha.0/V14.0.0.20190618__new_permission_model.sql @@ -1,5 +1,5 @@ --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