Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address Some Bullet Warnings / Optimise Mean Request Times #3440

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading