Skip to content

Commit

Permalink
Merge pull request #6097 from samvera/3.x-no-ga4-dashboard
Browse files Browse the repository at this point in the history
Disable analytics dashboard for GA4 until support is done
  • Loading branch information
dlpierce authored Jun 26, 2023
2 parents 5b7cff6 + 9201636 commit fcdc4fa
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Analytics
class CollectionReportsController < AnalyticsController
include Hyrax::BreadcrumbsForCollectionAnalytics
def index
return unless Hyrax.config.analytics?
return unless Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4'

@pageviews = Hyrax::Analytics.daily_events('collection-page-view')
@work_page_views = Hyrax::Analytics.daily_events('work-in-collection-view')
Expand All @@ -21,7 +21,7 @@ def index
end

def show
return unless Hyrax.config.analytics?
return unless Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4'
@document = ::SolrDocument.find(params[:id])
@pageviews = Hyrax::Analytics.daily_events_for_id(@document.id, 'collection-page-view')
@work_page_views = Hyrax::Analytics.daily_events_for_id(@document.id, 'work-in-collection-view')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class WorkReportsController < AnalyticsController
include Hyrax::BreadcrumbsForWorksAnalytics

def index
return unless Hyrax.config.analytics?
return unless Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4'

@accessible_works ||= accessible_works
@accessible_file_sets ||= accessible_file_sets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="col-sm-12">
<div class="collection-reports">

<% if Hyrax.config.analytics? %>
<% if Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %>
<div class="panel panel-default">
<div class="panel-heading"><%= t('.repo_summary') %> <b><%= pluralize(Collection.count, "collection") %></b>, <%= t('.repo_summary_2') %> <b><%= @pageviews.all %> <%= t('.views') %></b> <%= t('.and') %> <b><%= @downloads.all %> <%= t('.downloads') %></b>.</div>
<div class="panel-body">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="work-reports">

<div class="panel panel-default">
<% if Hyrax.config.analytics? %>
<% if Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %>
<% if current_user.ability.admin? %>
<div class="panel-heading"><b><%= @works_count %> <%= t('.works') %></b> <%= t('.repo_summary') %> <b><%= @pageviews.all if @pageviews %> <%= t('.views') %></b> <%= t('.and') %> <b><%= @downloads.all if @downloads %> <%= t('.downloads') %></b>.</div>
<% else %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/base/_show_actions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class: presenter.display_unfeature_link? ? 'btn btn-default' : 'btn btn-default collapse' %>
<% end %>
<% end %>
<% if Hyrax.config.analytics? %>
<% if Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %>
<% # turbolinks needs to be turned off or the page will use the cache and the %>
<% # analytics graph will not show unless the page is refreshed. %>
<%= link_to t('.analytics'), presenter.stats_path, id: 'stats', class: 'btn btn-default', data: { turbolinks: false } %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/base/_work_button_row.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
data: { behavior: 'unfeature' },
class: presenter.display_feature_link? ? 'btn btn-default collapse' : 'btn btn-default' %>
<% end %>
<% if Hyrax.config.analytics? %>
<% if Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %>
<%= link_to t(".analytics"), presenter.stats_path, id: 'stats', class: 'btn btn-default' %>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/dashboard/_user_activity.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h3 class="panel-title"><%= t('.title') %></h3>
</div>
<div class="panel-body text-center">
<% if Hyrax.config.analytics? %>
<% if Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %>
<%= render 'user_activity_graph' %>

<div class="col-md-3">
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/dashboard/show_admin.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h1><%= t("hyrax.dashboard.title") %></h1>
<% end %>
<% if Hyrax.config.analytics? %>
<% if Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/dashboard/sidebar/_activity.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<% end %>
<% end %>
<% if current_ability.can_create_any_work? && Hyrax.config.analytics? %>
<% if current_ability.can_create_any_work? && Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %>
<li>
<%= menu.collapsable_section t('hyrax.admin.sidebar.analytics'),
icon_class: "fa fa-pie-chart",
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/file_sets/_show_actions.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="form-actions">
<% if Hyrax.config.analytics? %>
<% if Hyrax.config.analytics? && Hyrax.config.analytics_provider != 'ga4' %>
<% # turbolinks needs to be turned off or the page will use the cache and the %>
<% # analytics graph will not show unless the page is refreshed. %>
<%= link_to t('.analytics'), @presenter.stats_path, id: 'stats', class: 'btn btn-default', data: { turbolinks: false } %>
Expand Down

0 comments on commit fcdc4fa

Please sign in to comment.