diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /lib/gitlab/analytics | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'lib/gitlab/analytics')
-rw-r--r-- | lib/gitlab/analytics/cycle_analytics/aggregated/records_fetcher.rb | 13 | ||||
-rw-r--r-- | lib/gitlab/analytics/cycle_analytics/request_params.rb | 6 |
2 files changed, 13 insertions, 6 deletions
diff --git a/lib/gitlab/analytics/cycle_analytics/aggregated/records_fetcher.rb b/lib/gitlab/analytics/cycle_analytics/aggregated/records_fetcher.rb index 2143497f084..6a1529ade92 100644 --- a/lib/gitlab/analytics/cycle_analytics/aggregated/records_fetcher.rb +++ b/lib/gitlab/analytics/cycle_analytics/aggregated/records_fetcher.rb @@ -14,12 +14,14 @@ module Gitlab Issue => { serializer_class: AnalyticsIssueSerializer, includes_for_query: { project: { namespace: [:route] }, author: [] }, - columns_for_select: %I[title iid id created_at author_id project_id] + columns_for_select: %I[title iid id created_at author_id project_id], + finder_class: IssuesFinder }, MergeRequest => { serializer_class: AnalyticsMergeRequestSerializer, includes_for_query: { target_project: [:namespace], author: [] }, - columns_for_select: %I[title iid id created_at author_id state_id target_project_id] + columns_for_select: %I[title iid id created_at author_id state_id target_project_id], + finder_class: MergeRequestsFinder } }.freeze @@ -80,14 +82,17 @@ module Gitlab def load_issuables(stage_event_records) stage_event_records_by_issuable_id = stage_event_records.index_by(&:issuable_id) - issuable_model = stage_event_model.issuable_model - issuables_by_id = issuable_model.id_in(stage_event_records_by_issuable_id.keys).index_by(&:id) + issuables_by_id = finder.execute.id_in(stage_event_records_by_issuable_id.keys).index_by(&:id) stage_event_records_by_issuable_id.map do |issuable_id, record| [issuables_by_id[issuable_id], record] if issuables_by_id[issuable_id] end.compact end + def finder + MAPPINGS.fetch(subject_class).fetch(:finder_class).new(params[:current_user]) + end + def serializer MAPPINGS.fetch(subject_class).fetch(:serializer_class).new end diff --git a/lib/gitlab/analytics/cycle_analytics/request_params.rb b/lib/gitlab/analytics/cycle_analytics/request_params.rb index 0c4a0afa1d5..4a444b06500 100644 --- a/lib/gitlab/analytics/cycle_analytics/request_params.rb +++ b/lib/gitlab/analytics/cycle_analytics/request_params.rb @@ -119,7 +119,9 @@ module Gitlab attrs[:namespace] = namespace_attributes attrs[:enable_tasks_by_type_chart] = 'false' attrs[:enable_customizable_stages] = 'false' + attrs[:can_edit] = 'false' attrs[:enable_projects_filter] = 'false' + attrs[:enable_vsd_link] = 'false' attrs[:default_stages] = Gitlab::Analytics::CycleAnalytics::DefaultStages.all.map do |stage_params| ::Analytics::CycleAnalytics::StagePresenter.new(stage_params) end.to_json @@ -151,8 +153,8 @@ module Gitlab helpers = ActionController::Base.helpers {}.tap do |paths| - paths[:empty_state_svg_path] = helpers.image_path("illustrations/analytics/cycle-analytics-empty-chart.svg") - paths[:no_data_svg_path] = helpers.image_path("illustrations/analytics/cycle-analytics-empty-chart.svg") + paths[:empty_state_svg_path] = helpers.image_path("illustrations/empty-state/empty-dashboard-md.svg") + paths[:no_data_svg_path] = helpers.image_path("illustrations/empty-state/empty-dashboard-md.svg") paths[:no_access_svg_path] = helpers.image_path("illustrations/analytics/no-access.svg") if project |