Skip to content

Commit

Permalink
Merge pull request #3440 from DMPRoadmap/aaron/bullet-fixes
Browse files Browse the repository at this point in the history
Address Some Bullet Warnings / Optimise Mean Request Times
  • Loading branch information
aaronskiba authored Dec 11, 2024
2 parents 994bb60 + d6687c8 commit a5f5b53
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion app/controllers/org_admin/plans_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ def index

@super_admin = current_user.can_super_admin?
@clicked_through = params[:click_through].present?
@plans = @super_admin ? Plan.all.page(1) : current_user.org.org_admin_plans.page(1)
@plans = if @super_admin
Plan.all.page(1).includes(:template, roles: { user: :org })
else
current_user.org.org_admin_plans.page(1)
end
end
# rubocop:enable Metrics/AbcSize

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/public_pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def template_export
# GET /plans_index
# ------------------------------------------------------------------------------------
def plan_index
@plans = Plan.publicly_visible.includes(:template)
@plans = Plan.publicly_visible.includes(:template, roles: { user: :org })
render 'plan_index', locals: {
query_params: {
page: paginable_params.fetch(:page, 1),
Expand Down
2 changes: 1 addition & 1 deletion app/views/org_admin/plans/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</div>
</div>
<% end %>
<% if @plans.length > 0 %>
<% if @plans.any? %>
<% unless @super_admin %>
<%= link_to sanitize(_('Download plans <em class="sr-only">(new window)</em><span class="new-window-popup-info">%{open_in_new_window_text}</span>') %
{ open_in_new_window_text: _('Opens in new window') },
Expand Down
2 changes: 1 addition & 1 deletion app/views/super_admin/api_clients/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%
url = @api_client.new_record? ? super_admin_api_clients_path : super_admin_api_client_path(@api_client)
method = @api_client.new_record? ? :post : :put
orgs = Org.where(is_other: false)
orgs = Org.where(is_other: false).includes(identifiers: :identifier_scheme)
%>

<%= form_for @api_client, url: url, method: method,
Expand Down

0 comments on commit a5f5b53

Please sign in to comment.