Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
iram-shehzadi committed Feb 20, 2024
1 parent 97e946f commit f0c55c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
6 changes: 5 additions & 1 deletion app/controllers/super_admin/organisations_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class SuperAdmin::OrganisationsController < SuperAdminController
helper_method :sort_column, :sort_direction

before_action :set_organisation, only: %i[show destroy toggle_cba_feature]
before_action :set_organisation, only: %i[toggle_cba_feature]

def index
@organisations = Organisation.sortable_with_child_counts(sort_column, sort_direction)
Expand Down Expand Up @@ -40,6 +40,10 @@ def toggle_cba_feature

private

def set_organisation
@organisation = Organisation.find(params[:id])
end

def sortable_columns
%w[name created_at locations_count ips_count active_storage_attachments.created_at last_sign_in_at email sign_in_count]
end
Expand Down
9 changes: 2 additions & 7 deletions app/views/logs/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<% unless log_search_form.username %>
<th class="govuk-table__header" scope="col">Username or ID</th>
<% end %>
<% if log_search_form.ip && current_organisation&.cba_enabled? %>
<th class="govuk-table__header" scope="col">Authentication Method</th>
<th class="govuk-table__header" scope="col">Username</th>
<% end %>
<th class="govuk-table__header" scope="col">Access Point</th>
<th class="govuk-table__header" scope="col">MAC Address</th>
Expand All @@ -62,9 +59,7 @@
<% end %>
</td>
<% end %>
<% if log_search_form.ip && current_organisation&.cba_enabled? %>
<td class="govuk-table__cell"><%= log.cert_name %></td>
<% end %>

<td class="govuk-table__cell"><%= log.ap %></td>
<td class="govuk-table__cell"><%= log.mac %></td>
<% unless log_search_form.ip %>
Expand Down
4 changes: 2 additions & 2 deletions spec/features/logging/view_auth_requests_for_an_ip_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
let(:ip) { location.ips.first.address }
let(:location) { user.organisations.first.locations.first }
before do
create(:organisation, :with_location_and_ip, users: [user], cba_enabled: true)
create(:session, siteIP: ip, username: "Aaaaaa", cert_name: "EAP-TLS")
create(:organisation, :with_location_and_ip, users: [user])
create(:session, siteIP: ip, username: "Aaaaaa")
end
describe "when using a link" do
before do
Expand Down

0 comments on commit f0c55c8

Please sign in to comment.