Merge branch 'release/1.28.0' into develop

This commit is contained in:
Oleksii Kriuchykhin 2023-10-04 13:19:31 +02:00
commit 421ba27a6f
9 changed files with 9 additions and 20 deletions

View file

@ -401,7 +401,7 @@ GEM
mini_magick (4.12.0)
mini_mime (1.1.2)
mini_portile2 (2.8.4)
minitest (5.18.1)
minitest (5.20.0)
msgpack (1.7.1)
multi_json (1.15.0)
multi_test (1.1.0)
@ -673,7 +673,7 @@ GEM
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
whacamole (1.2.0)
wicked_pdf (2.6.3)
wicked_pdf (2.7.0)
activesupport
xpath (3.2.0)
nokogiri (~> 1.8)

View file

@ -21,7 +21,6 @@
ev.preventDefault();
animateSpinner(null, true);
filters.page = moreButton.data('next-page');
filters.starting_timestamp = $('.ga-activities-list').data('starting-timestamp');
$.ajax({
url: $('.ga-activities-list').data('activities-url'),
data: filters,

View file

@ -287,7 +287,6 @@ var globalActivities = (function() {
} else {
noActivitiesMessage.addClass('hidden');
}
$('.ga-activities-list').data('starting-timestamp', json.starting_timestamp);
updateRunning = false;
animateSpinner('.ga-main', false);

View file

@ -49,14 +49,12 @@ class GlobalActivitiesController < ApplicationController
end
@next_page = activities.next_page
@starting_timestamp = activities.first&.created_at.to_i
respond_to do |format|
format.json do
render json: {
activities_html: render_to_string(partial: 'activity_list', formats: :html),
next_page: @next_page,
starting_timestamp: @starting_timestamp
next_page: @next_page
}
end
format.html do
@ -158,7 +156,7 @@ class GlobalActivitiesController < ApplicationController
def activity_filters
params.permit(
:page, :starting_timestamp, :from_date, :to_date, types: [], subjects: {}, users: [], teams: []
:page, :from_date, :to_date, types: [], subjects: {}, users: [], teams: []
)
end

View file

@ -123,7 +123,6 @@ class MyModulesController < ApplicationController
end
@next_page = activities.next_page
@starting_timestamp = activities.first&.created_at.to_i
respond_to do |format|
format.json do
@ -132,8 +131,7 @@ class MyModulesController < ApplicationController
partial: 'global_activities/activity_list',
formats: :html
),
next_page: @next_page,
starting_timestamp: @starting_timestamp
next_page: @next_page
}
end
format.html
@ -562,7 +560,7 @@ class MyModulesController < ApplicationController
def activity_filters
params.permit(
:page, :starting_timestamp, :from_date, :to_date, types: [], users: [], subjects: {}
:page, :from_date, :to_date, types: [], users: [], subjects: {}
)
end

View file

@ -30,8 +30,6 @@ class ActivitiesService
query = query.where(owner_id: filters[:users]) if filters[:users]
query = query.where(type_of: filters[:types].map(&:to_i)) if filters[:types]
query = query.where('created_at <= ?', Time.at(filters[:starting_timestamp].to_i)) if filters[:starting_timestamp]
activities =
if filters[:from_date].present? && filters[:to_date].present?
query.where('created_at <= :from AND created_at >= :to',

View file

@ -11,9 +11,7 @@
<div class="no-activities-message text-center <%= 'hidden' if @grouped_activities.keys.any? %>">
<p><%= t('activities.index.no_activities_message') %></p>
</div>
<div class="ga-activities-list"
data-activities-url="<%= global_activities_path %>"
data-starting-timestamp="<%= @starting_timestamp %>">
<div class="ga-activities-list" data-activities-url="<%= global_activities_path %>">
<%= render partial: "activity_list" %>
</div>
<div class="text-center">

View file

@ -27,9 +27,7 @@
<div class="no-activities-message text-center <%= 'hidden' if @grouped_activities.keys.any? %>">
<p><%= t('activities.index.no_activities_task_message') %></p>
</div>
<div class="ga-activities-list"
data-activities-url="<%= activities_my_module_path(@my_module) %>"
data-starting-timestamp="<%= @starting_timestamp %>">
<div class="ga-activities-list" data-activities-url="<%= activities_my_module_path(@my_module) %>">
<%= render partial: "global_activities/activity_list" %>
</div>
<div class="text-center">

View file

@ -5,4 +5,5 @@ WickedPdf.config ||= {}
ENV['PATH'].split(':').each do |path|
exe_path = File.join(path, 'wkhtmltopdf')
WickedPdf.config[:exe_path] = File.join(path, 'wkhtmltopdf') if File.file?(exe_path)
WickedPdf.config[:allow] = Rails.public_path
end