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

2262 add verification permission #1727

Merged
merged 3 commits into from
Oct 2, 2023
Merged
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
1 change: 1 addition & 0 deletions app/controllers/staff/invitations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def configure_permitted_parameters
change_work_history_permission
reverse_decision_permission
support_console_permission
verify_permission
withdraw_permission
],
)
Expand Down
1 change: 1 addition & 0 deletions app/controllers/support_interface/staff_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def staff_params
:change_work_history_permission,
:reverse_decision_permission,
:support_console_permission,
:verify_permission,
:withdraw_permission,
)
end
Expand Down
1 change: 1 addition & 0 deletions app/models/staff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions app/views/personas/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
<%= govuk_table do |table|
table.with_colgroup do |colgroup|
colgroup.with_col(span: 1)
colgroup.with_col(span: 6)
colgroup.with_col(span: 7)
thomasleese marked this conversation as resolved.
Show resolved Hide resolved
colgroup.with_col(span: 1)
end

table.with_head do |head|
head.with_row do |row|
row.with_cell(scope: false)
row.with_cell(header: true, text: "Permissions", colspan: 5)
row.with_cell(header: true, text: "Permissions", colspan: 7)
row.with_cell(scope: false)
end

Expand All @@ -29,6 +29,7 @@
row.with_cell(header: true, text: "Change work history")
row.with_cell(header: true, text: "Reverse decisions")
row.with_cell(header: true, text: "Support console")
row.with_cell(header: true, text: "Verify applicants")
row.with_cell(header: true, text: "Withdraw")
row.with_cell(header: true, text: "Actions", numeric: true)
end
Expand All @@ -44,6 +45,7 @@
row.with_cell { govuk_boolean_tag(staff.change_work_history_permission) }
row.with_cell { govuk_boolean_tag(staff.reverse_decision_permission) }
row.with_cell { govuk_boolean_tag(staff.support_console_permission) }
row.with_cell { govuk_boolean_tag(staff.verify_permission) }
row.with_cell { govuk_boolean_tag(staff.withdraw_permission) }
thomasleese marked this conversation as resolved.
Show resolved Hide resolved

row.with_cell(numeric: true) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
9 changes: 9 additions & 0 deletions app/views/support_interface/staff/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down
1 change: 1 addition & 0 deletions config/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@
- support_console_permission
- unconfirmed_email
- updated_at
- verify_permission
- withdraw_permission
:teachers:
- canonical_email
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddVerificationPermissionToStaffUsers < ActiveRecord::Migration[7.0]
def change
add_column :staff, :verify_permission, :boolean, default: false, null: false
end
end
3 changes: 2 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions lib/tasks/example_data.rake
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def staff_members
change_work_history_permission: false,
reverse_decision_permission: false,
support_console_permission: false,
verify_permission: false,
withdraw_permission: false,
},
{
Expand All @@ -70,6 +71,7 @@ def staff_members
change_work_history_permission: false,
reverse_decision_permission: false,
support_console_permission: false,
verify_permission: false,
withdraw_permission: false,
},
{
Expand All @@ -80,6 +82,7 @@ def staff_members
change_work_history_permission: true,
reverse_decision_permission: true,
support_console_permission: true,
verify_permission: false,
withdraw_permission: true,
},
{
Expand All @@ -90,6 +93,18 @@ def staff_members
change_work_history_permission: false,
reverse_decision_permission: false,
support_console_permission: false,
verify_permission: false,
withdraw_permission: false,
},
{
name: "Victarion Verifier",
email: "[email protected]",
award_decline_permission: false,
change_name_permission: false,
change_work_history_permission: false,
reverse_decision_permission: false,
support_console_permission: false,
verify_permission: true,
withdraw_permission: false,
},
]
Expand Down
5 changes: 5 additions & 0 deletions spec/factories/staff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -79,6 +80,10 @@
support_console_permission { true }
end

trait :with_verification_permission do
verify_permission { true }
end

trait :with_withdraw_permission do
withdraw_permission { true }
end
Expand Down
1 change: 1 addition & 0 deletions spec/models/staff_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/system/support_interface/staff_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def and_i_see_the_helpdesk_user
end

def when_i_click_on_the_helpdesk_user
find(:xpath, "(//a[text()='Change'])[7]").click
find(:xpath, "(//a[text()='Change'])[8]").click
end

def then_i_see_the_staff_edit_form
Expand Down
Loading