From ef9fbe280f597e6044f7de57ee3b9252833e6c9a Mon Sep 17 00:00:00 2001 From: Richard Pattinson Date: Fri, 29 Sep 2023 12:22:31 +0100 Subject: [PATCH] Add verify permission to support console --- app/controllers/staff/invitations_controller.rb | 1 + app/controllers/support_interface/staff_controller.rb | 1 + .../support_interface/staff/_permissions_fields.html.erb | 3 +++ app/views/support_interface/staff/index.html.erb | 9 +++++++++ config/locales/en.yml | 1 + spec/models/staff_spec.rb | 1 + 6 files changed, 16 insertions(+) diff --git a/app/controllers/staff/invitations_controller.rb b/app/controllers/staff/invitations_controller.rb index 05442fc159..ab6bf9b67f 100644 --- a/app/controllers/staff/invitations_controller.rb +++ b/app/controllers/staff/invitations_controller.rb @@ -18,6 +18,7 @@ def configure_permitted_parameters change_work_history_permission reverse_decision_permission support_console_permission + verify_permission withdraw_permission ], ) diff --git a/app/controllers/support_interface/staff_controller.rb b/app/controllers/support_interface/staff_controller.rb index 1568473697..e4885228f1 100644 --- a/app/controllers/support_interface/staff_controller.rb +++ b/app/controllers/support_interface/staff_controller.rb @@ -33,6 +33,7 @@ def staff_params :change_work_history_permission, :reverse_decision_permission, :support_console_permission, + :verify_permission, :withdraw_permission, ) end diff --git a/app/views/support_interface/staff/_permissions_fields.html.erb b/app/views/support_interface/staff/_permissions_fields.html.erb index d7e08d4e46..45d410e24d 100644 --- a/app/views/support_interface/staff/_permissions_fields.html.erb +++ b/app/views/support_interface/staff/_permissions_fields.html.erb @@ -14,6 +14,9 @@ <%= f.govuk_check_box :support_console_permission, 1, 0, multiple: false, link_errors: true, label: { text: t("activerecord.attributes.staff.support_console_permission") } %> + <%= f.govuk_check_box :verify_permission, 1, 0, multiple: false, link_errors: true, + label: { text: t("activerecord.attributes.staff.verify_permission") } %> + <%= f.govuk_check_box :withdraw_permission, 1, 0, multiple: false, link_errors: true, label: { text: t("activerecord.attributes.staff.withdraw_permission") } %> <% end %> diff --git a/app/views/support_interface/staff/index.html.erb b/app/views/support_interface/staff/index.html.erb index 76fde50ca4..9a1e4ca3d6 100644 --- a/app/views/support_interface/staff/index.html.erb +++ b/app/views/support_interface/staff/index.html.erb @@ -65,6 +65,15 @@ ) end + summary_list.with_row do |row| + row.with_key { t("activerecord.attributes.staff.verify_permission") } + row.with_value { govuk_boolean_tag(staff.verify_permission) } + row.with_action( + href: edit_support_interface_staff_path(staff), + visually_hidden_text: t("activerecord.attributes.staff.verify_permission") + ) + end + summary_list.with_row do |row| row.with_key { t("activerecord.attributes.staff.withdraw_permission") } row.with_value { govuk_boolean_tag(staff.withdraw_permission) } diff --git a/config/locales/en.yml b/config/locales/en.yml index c8887b4c0d..a7ec702a90 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -51,6 +51,7 @@ en: change_work_history_permission: Change work history references reverse_decision_permission: Reverse decisions support_console_permission: Support console access + verify_permission: Verify applicants withdraw_permission: Withdraw errors: models: diff --git a/spec/models/staff_spec.rb b/spec/models/staff_spec.rb index 003094f4bd..f591120f94 100644 --- a/spec/models/staff_spec.rb +++ b/spec/models/staff_spec.rb @@ -34,6 +34,7 @@ # support_console_permission :boolean default(FALSE), not null # unconfirmed_email :string # unlock_token :string +# verify_permission :boolean default(FALSE), not null # withdraw_permission :boolean default(FALSE), not null # created_at :datetime not null # updated_at :datetime not null