Skip to content

Commit

Permalink
Merge pull request #2363 from alphagov/small-improvements-users-page
Browse files Browse the repository at this point in the history
Small improvements to the Users page
  • Loading branch information
mike29736 authored Sep 18, 2023
2 parents 5a4561c + a0fa1d5 commit 0dfda52
Show file tree
Hide file tree
Showing 20 changed files with 33 additions and 609 deletions.
31 changes: 0 additions & 31 deletions app/controllers/bulk_grant_permission_sets_controller.rb

This file was deleted.

42 changes: 0 additions & 42 deletions app/helpers/bulk_grant_permission_sets_helper.rb

This file was deleted.

5 changes: 0 additions & 5 deletions app/jobs/bulk_grant_permission_set_job.rb

This file was deleted.

53 changes: 0 additions & 53 deletions app/models/bulk_grant_permission_set.rb

This file was deleted.

This file was deleted.

6 changes: 3 additions & 3 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class User < ApplicationRecord
USER_STATUS_INVITED = "invited".freeze
USER_STATUS_LOCKED = "locked".freeze
USER_STATUS_ACTIVE = "active".freeze
USER_STATUSES = [USER_STATUS_SUSPENDED,
USER_STATUSES = [USER_STATUS_ACTIVE,
USER_STATUS_SUSPENDED,
USER_STATUS_INVITED,
USER_STATUS_LOCKED,
USER_STATUS_ACTIVE].freeze
USER_STATUS_LOCKED].freeze

TWO_STEP_STATUS_ENABLED = "enabled".freeze
TWO_STEP_STATUS_NOT_SET_UP = "not_set_up".freeze
Expand Down
9 changes: 0 additions & 9 deletions app/policies/bulk_grant_permission_set_policy.rb

This file was deleted.

32 changes: 0 additions & 32 deletions app/views/bulk_grant_permission_sets/new.html.erb

This file was deleted.

54 changes: 0 additions & 54 deletions app/views/bulk_grant_permission_sets/show.html.erb

This file was deleted.

8 changes: 0 additions & 8 deletions app/views/users/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@
margin_bottom: 4,
} %>
<% end %>
<% if policy(BulkGrantPermissionSet).new? %>
<%= render "govuk_publishing_components/components/button", {
text: "Grant access to all users",
href: new_bulk_grant_permission_set_path,
secondary: true,
margin_bottom: 4,
} %>
<% end %>
</div>
<% end %>
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
controller: :batch_invitation_permissions
end

resources :bulk_grant_permission_sets, only: %i[new create show]
resources :organisations, only: %i[index edit update]
resources :suspensions, only: %i[edit update]
resources :two_step_verification_exemptions, only: %i[edit update]
Expand Down
27 changes: 27 additions & 0 deletions db/migrate/20230918141453_drop_bulk_grant_permission_sets_et_al.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class DropBulkGrantPermissionSetsEtAl < ActiveRecord::Migration[7.0]
def change
drop_table :bulk_grant_permission_set_application_permissions do |t|
t.belongs_to :bulk_grant_permission_set,
null: false,
index: { name: "index_bulk_grant_permissions_on_bulk_grant_permission_set_id" }
t.belongs_to :supported_permission,
null: false,
index: { name: "index_bulk_grant_permissions_on_permission_id" }

t.timestamps

t.index %i[bulk_grant_permission_set_id supported_permission_id],
name: "index_bulk_grant_permissions_on_permission_id_and_bulk_grant_id",
unique: true
end

drop_table :bulk_grant_permission_sets do |t|
t.belongs_to :user
t.string :outcome
t.integer :processed_users, default: 0, null: false
t.integer :total_users, default: 0, null: false

t.timestamps
end
end
end
19 changes: 1 addition & 18 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2023_09_11_092404) do
ActiveRecord::Schema[7.0].define(version: 2023_09_18_141453) do
create_table "batch_invitation_application_permissions", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.integer "batch_invitation_id", null: false
t.integer "supported_permission_id", null: false
Expand Down Expand Up @@ -40,23 +40,6 @@
t.index ["outcome"], name: "index_batch_invitations_on_outcome"
end

create_table "bulk_grant_permission_set_application_permissions", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.integer "bulk_grant_permission_set_id", null: false
t.integer "supported_permission_id", null: false
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.index ["bulk_grant_permission_set_id", "supported_permission_id"], name: "index_app_permissions_on_bulk_grant_permission_set", unique: true
end

create_table "bulk_grant_permission_sets", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.integer "user_id", null: false
t.string "outcome"
t.integer "processed_users", default: 0, null: false
t.integer "total_users", default: 0, null: false
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
end

create_table "event_logs", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "uid"
t.datetime "created_at", precision: nil, null: false
Expand Down
12 changes: 0 additions & 12 deletions test/controllers/users_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,6 @@ def change_user_password(user_factory, new_password)
assert_select "a", text: "Upload a batch of users"
end

should "display 'Grant access to all users' button" do
get :index

assert_select "a", text: "Grant access to all users"
end

should "display 'Export N users as CSV' button" do
get :index

Expand Down Expand Up @@ -950,12 +944,6 @@ def change_user_password(user_factory, new_password)
assert_select "a", text: "Upload a batch of users", count: 0
end

should "not display 'Grant access to all users' button" do
get :index

assert_select "a", text: "Grant access to all users", count: 0
end

should "not display organisations filter" do
get :index

Expand Down
16 changes: 0 additions & 16 deletions test/factories/bulk_grant_permission_set.rb

This file was deleted.

Loading

0 comments on commit 0dfda52

Please sign in to comment.