From 667e0be9f693506643cc62ee6951f411adbe0d9c Mon Sep 17 00:00:00 2001 From: aignatov-bio <47317017+aignatov-bio@users.noreply.github.com> Date: Fri, 27 Jan 2023 10:40:01 +0100 Subject: [PATCH 1/5] Add ability to move archived tasks [SCI-7733] (#4892) --- app/permissions/my_module.rb | 1 - app/views/experiments/_table_toolbar.html.erb | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/permissions/my_module.rb b/app/permissions/my_module.rb index 69a4686c4..ee5929def 100644 --- a/app/permissions/my_module.rb +++ b/app/permissions/my_module.rb @@ -21,7 +21,6 @@ Canaid::Permissions.register_for(MyModule) do update_my_module_description manage_my_module_tags update_my_module_status - move_my_module manage_my_module_steps complete_my_module_steps uncomplete_my_module_steps diff --git a/app/views/experiments/_table_toolbar.html.erb b/app/views/experiments/_table_toolbar.html.erb index daa407c11..738bedac3 100644 --- a/app/views/experiments/_table_toolbar.html.erb +++ b/app/views/experiments/_table_toolbar.html.erb @@ -12,7 +12,7 @@ <% end %> <% if can_manage_experiment?(@experiment) %> <% end %> - From 29883908764db63b7556b8ae2fb53fab489b94b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Jan 2023 11:55:21 +0100 Subject: [PATCH 2/5] Bump ua-parser-js from 0.7.28 to 0.7.33 (#4896) Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.28 to 0.7.33. - [Release notes](https://github.com/faisalman/ua-parser-js/releases) - [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/changelog.md) - [Commits](https://github.com/faisalman/ua-parser-js/compare/0.7.28...0.7.33) --- updated-dependencies: - dependency-name: ua-parser-js dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7e9501945..3419ca048 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10995,9 +10995,9 @@ typescript@^2.5.1: integrity sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w== ua-parser-js@^0.7.18: - version "0.7.28" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.28.tgz#8ba04e653f35ce210239c64661685bf9121dec31" - integrity sha512-6Gurc1n//gjp9eQNXjD9O3M/sMwVtN5S8Lv9bvOYBfKfDNiIIhqiyi01vMBO45u4zkDE420w/e0se7Vs+sIg+g== + version "0.7.33" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.33.tgz#1d04acb4ccef9293df6f70f2c3d22f3030d8b532" + integrity sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw== uncontrollable@^4.1.0: version "4.1.0" From 02da980ab8fabf9c22d08e32517efddce8338ac3 Mon Sep 17 00:00:00 2001 From: Alex Kriuchykhin Date: Fri, 27 Jan 2023 14:15:09 +0100 Subject: [PATCH 3/5] Fix task protocol editing with empty description [SCI-7823] (#4897) --- app/helpers/application_helper.rb | 4 +++- app/models/tiny_mce_asset.rb | 7 ++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8769979f9..78c6c7e86 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -69,8 +69,10 @@ module ApplicationHelper def smart_annotation_notification(options = {}) title = options.fetch(:title) { :title_must_be_present } message = options.fetch(:message) { :message_must_be_present } - new_text = options.fetch(:new_text) { :new_text_must_be_present } old_text = options[:old_text] || '' + new_text = options[:new_text] + return if new_text.blank? + sa_user = /\[\@(.*?)~([0-9a-zA-Z]+)\]/ # fetch user ids from the previous text old_user_ids = [] diff --git a/app/models/tiny_mce_asset.rb b/app/models/tiny_mce_asset.rb index b2b0bb1cf..9a7300407 100644 --- a/app/models/tiny_mce_asset.rb +++ b/app/models/tiny_mce_asset.rb @@ -22,12 +22,9 @@ class TinyMceAsset < ApplicationRecord validates :estimated_size, presence: true def self.update_images(object, images, current_user) + text_field = object.public_send(Extends::RICH_TEXT_FIELD_MAPPINGS[object.class.name]) || '' # image ids that are present in text - text_images = - object.public_send(Extends::RICH_TEXT_FIELD_MAPPINGS[object.class.name]) - .scan(/data-mce-token="([^"]+)"/) - .flatten - + text_images = text_field.scan(/data-mce-token="([^"]+)"/).flatten images = JSON.parse(images) + text_images current_images = object.tiny_mce_assets.pluck(:id) From e7c61d6fd94c5746149da4290ea8d69f64b9ccc4 Mon Sep 17 00:00:00 2001 From: Alex Kriuchykhin Date: Fri, 27 Jan 2023 14:16:52 +0100 Subject: [PATCH 4/5] Fix smart annotation inventory items flyout, case with no available inventories [SCI-7824] (#4898) --- app/controllers/at_who_controller.rb | 30 +++++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/app/controllers/at_who_controller.rb b/app/controllers/at_who_controller.rb index c46ab54ef..6c01dc05a 100644 --- a/app/controllers/at_who_controller.rb +++ b/app/controllers/at_who_controller.rb @@ -32,23 +32,29 @@ class AtWhoController < ApplicationController end def rep_items - repository = Repository.find_by_id(params[:repository_id]) || Repository.active.accessible_by_teams(@team).first - items = - if repository && can_read_repository?(repository) - SmartAnnotation.new(current_user, current_team, @query) - .repository_rows(repository) + repository = + if params[:repository_id].present? + Repository.find_by(id: params[:repository_id]) else - [] + Repository.active.accessible_by_teams(@team).first end + if repository && can_read_repository?(repository) + items = SmartAnnotation.new(current_user, current_team, @query) + .repository_rows(repository) + repository_id = repository.id + else + items = [] + repository_id = nil + end respond_to do |format| format.json do render json: { - res: [render_to_string(partial: 'shared/smart_annotation/repository_items.html.erb', locals: { - repository_rows: items - })], - repository: repository.id, - team: current_team.id, - status: :ok + res: [ + render_to_string(partial: 'shared/smart_annotation/repository_items.html.erb', + locals: { repository_rows: items }) + ], + repository: repository_id, + team: current_team.id } end end From a2a9e59518146bb65dae28e0925962871f01e25b Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Mon, 30 Jan 2023 14:24:38 +0100 Subject: [PATCH 5/5] Bump version to 1.26.5.2 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 250414387..b1bd4f21f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.26.5.1 +1.26.5.2