mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-27 02:16:20 +08:00
Merge branch 'develop'
This commit is contained in:
commit
26d4ac3f4f
|
@ -32,23 +32,29 @@ class AtWhoController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def rep_items
|
def rep_items
|
||||||
repository = Repository.find_by_id(params[:repository_id]) || Repository.active.accessible_by_teams(@team).first
|
repository =
|
||||||
items =
|
if params[:repository_id].present?
|
||||||
if repository && can_read_repository?(repository)
|
Repository.find_by(id: params[:repository_id])
|
||||||
SmartAnnotation.new(current_user, current_team, @query)
|
|
||||||
.repository_rows(repository)
|
|
||||||
else
|
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
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json do
|
format.json do
|
||||||
render json: {
|
render json: {
|
||||||
res: [render_to_string(partial: 'shared/smart_annotation/repository_items.html.erb', locals: {
|
res: [
|
||||||
repository_rows: items
|
render_to_string(partial: 'shared/smart_annotation/repository_items.html.erb',
|
||||||
})],
|
locals: { repository_rows: items })
|
||||||
repository: repository.id,
|
],
|
||||||
team: current_team.id,
|
repository: repository_id,
|
||||||
status: :ok
|
team: current_team.id
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -69,8 +69,10 @@ module ApplicationHelper
|
||||||
def smart_annotation_notification(options = {})
|
def smart_annotation_notification(options = {})
|
||||||
title = options.fetch(:title) { :title_must_be_present }
|
title = options.fetch(:title) { :title_must_be_present }
|
||||||
message = options.fetch(:message) { :message_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] || ''
|
old_text = options[:old_text] || ''
|
||||||
|
new_text = options[:new_text]
|
||||||
|
return if new_text.blank?
|
||||||
|
|
||||||
sa_user = /\[\@(.*?)~([0-9a-zA-Z]+)\]/
|
sa_user = /\[\@(.*?)~([0-9a-zA-Z]+)\]/
|
||||||
# fetch user ids from the previous text
|
# fetch user ids from the previous text
|
||||||
old_user_ids = []
|
old_user_ids = []
|
||||||
|
|
|
@ -22,12 +22,9 @@ class TinyMceAsset < ApplicationRecord
|
||||||
validates :estimated_size, presence: true
|
validates :estimated_size, presence: true
|
||||||
|
|
||||||
def self.update_images(object, images, current_user)
|
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
|
# image ids that are present in text
|
||||||
text_images =
|
text_images = text_field.scan(/data-mce-token="([^"]+)"/).flatten
|
||||||
object.public_send(Extends::RICH_TEXT_FIELD_MAPPINGS[object.class.name])
|
|
||||||
.scan(/data-mce-token="([^"]+)"/)
|
|
||||||
.flatten
|
|
||||||
|
|
||||||
images = JSON.parse(images) + text_images
|
images = JSON.parse(images) + text_images
|
||||||
|
|
||||||
current_images = object.tiny_mce_assets.pluck(:id)
|
current_images = object.tiny_mce_assets.pluck(:id)
|
||||||
|
|
|
@ -21,7 +21,6 @@ Canaid::Permissions.register_for(MyModule) do
|
||||||
update_my_module_description
|
update_my_module_description
|
||||||
manage_my_module_tags
|
manage_my_module_tags
|
||||||
update_my_module_status
|
update_my_module_status
|
||||||
move_my_module
|
|
||||||
manage_my_module_steps
|
manage_my_module_steps
|
||||||
complete_my_module_steps
|
complete_my_module_steps
|
||||||
uncomplete_my_module_steps
|
uncomplete_my_module_steps
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<span class="button-text"><%= t("experiments.table.toolbar.duplicate") %></span>
|
<span class="button-text"><%= t("experiments.table.toolbar.duplicate") %></span>
|
||||||
</button>
|
</button>
|
||||||
<% end %>
|
<% end %>
|
||||||
<button id="moveTask" class="btn btn-light multiple-object-action hidden only-active" data-for="moveable">
|
<button id="moveTask" class="btn btn-light multiple-object-action hidden" data-for="moveable">
|
||||||
<i class="fas fa-arrow-right"></i>
|
<i class="fas fa-arrow-right"></i>
|
||||||
<span class="button-text"><%= t("experiments.table.toolbar.move") %></span>
|
<span class="button-text"><%= t("experiments.table.toolbar.move") %></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -10995,9 +10995,9 @@ typescript@^2.5.1:
|
||||||
integrity sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==
|
integrity sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==
|
||||||
|
|
||||||
ua-parser-js@^0.7.18:
|
ua-parser-js@^0.7.18:
|
||||||
version "0.7.28"
|
version "0.7.33"
|
||||||
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.28.tgz#8ba04e653f35ce210239c64661685bf9121dec31"
|
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.33.tgz#1d04acb4ccef9293df6f70f2c3d22f3030d8b532"
|
||||||
integrity sha512-6Gurc1n//gjp9eQNXjD9O3M/sMwVtN5S8Lv9bvOYBfKfDNiIIhqiyi01vMBO45u4zkDE420w/e0se7Vs+sIg+g==
|
integrity sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw==
|
||||||
|
|
||||||
uncontrollable@^4.1.0:
|
uncontrollable@^4.1.0:
|
||||||
version "4.1.0"
|
version "4.1.0"
|
||||||
|
|
Loading…
Reference in a new issue