Fix project scope for query lists
This commit is contained in:
parent
adb2a16dbd
commit
191ad8a239
@ -1,14 +1,12 @@
|
||||
- cache render_async_cache_key(_dashboard_async_blocks_path(@project, dashboard.async_params(block, async, settings))),
|
||||
expires_in: DashboardContent::RENDER_ASYNC_CACHE_EXPIRES_IN,
|
||||
skip_digest: true do
|
||||
ruby:
|
||||
query = klass.visible.find_by(id: settings[:query_id])
|
||||
project = (dashboard.content_project if query_block[:with_project])
|
||||
|
||||
- query = klass.visible.find_by(id: settings[:query_id])
|
||||
- if query
|
||||
ruby:
|
||||
query.project = @project if query_block[:with_project]
|
||||
count = query.send query_block[:count_method]
|
||||
query.project = project if query_block[:with_project]
|
||||
query.column_names = settings[:columns].split(',').map(&:to_sym) if settings[:columns].present?
|
||||
query.sort_criteria = params[:sort] if params[:sort].present?
|
||||
|
||||
|
@ -24,7 +24,6 @@ module Additionals
|
||||
Role.where(id: [1]).each do |r|
|
||||
r.permissions << :manage_shared_dashboards
|
||||
r.permissions << :set_system_dashboards
|
||||
r.permissions << :manage_shared_dashboards
|
||||
r.save
|
||||
end
|
||||
|
||||
|
@ -138,7 +138,7 @@ class DashboardTest < Additionals::TestCase
|
||||
end
|
||||
|
||||
def test_dashboard_project_scope
|
||||
assert_equal 1, Dashboard.visible.project_only.count
|
||||
assert_equal 2, Dashboard.visible.project_only.count
|
||||
end
|
||||
|
||||
def test_destroy_dashboard_without_roles
|
||||
|
Loading…
x
Reference in New Issue
Block a user