mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-10 06:37:32 +08:00
Merge pull request #1636 from okriuchykhin/ok_SCI_3285
Fix missing old activities on task activity page and user popup in global activities [SCI-3285]
This commit is contained in:
commit
91d379fc78
2 changed files with 12 additions and 7 deletions
|
@ -17,8 +17,10 @@ module GlobalActivitiesHelper
|
|||
no_links ? generate_name(value) : generate_link(value, activity)
|
||||
end
|
||||
end
|
||||
sanitize_input(I18n.t("global_activities.content.#{activity.type_of}_html",
|
||||
parameters.symbolize_keys))
|
||||
custom_auto_link(
|
||||
I18n.t("global_activities.content.#{activity.type_of}_html", parameters.symbolize_keys),
|
||||
team: activity.team
|
||||
)
|
||||
end
|
||||
|
||||
def generate_link(message_item, activity)
|
||||
|
@ -31,7 +33,7 @@ module GlobalActivitiesHelper
|
|||
|
||||
case obj
|
||||
when User
|
||||
return popover_for_user_name(obj, team, false, true)
|
||||
return "[@#{obj.full_name}~#{obj.id.base62_encode}]"
|
||||
when Tag
|
||||
# Not link for now
|
||||
return current_value
|
||||
|
|
|
@ -13,10 +13,13 @@ class ActivitiesService
|
|||
query = query.where('project_id IN (?)', subjects_with_children[:Project])
|
||||
subjects_with_children.except!(:Project)
|
||||
end
|
||||
query = query.where(
|
||||
subjects_with_children.map { '(subject_type = ? AND subject_id IN(?))' }.join(' OR '),
|
||||
*subjects_with_children.flatten
|
||||
)
|
||||
where_condition = subjects_with_children.map { '(subject_type = ? AND subject_id IN(?))' }.join(' OR ')
|
||||
where_arguments = subjects_with_children.flatten
|
||||
if subjects_with_children[:MyModule]
|
||||
where_condition = where_condition.concat(' OR (my_module_id IN(?))')
|
||||
where_arguments << subjects_with_children[:MyModule]
|
||||
end
|
||||
query = query.where(where_condition, *where_arguments)
|
||||
end
|
||||
|
||||
query = query.where(owner_id: filters[:users]) if filters[:users]
|
||||
|
|
Loading…
Reference in a new issue