From 440ee8cba5d3261adf4a8a667976e044c41309ae Mon Sep 17 00:00:00 2001 From: JG Date: Thu, 28 Jul 2022 16:09:12 +0100 Subject: [PATCH] refactored --- app/controllers/users_controller.rb | 1 - app/views/users/new.html.erb | 17 ++--------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f2c788762..f797bad14 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -65,7 +65,6 @@ class UsersController < ApplicationController def new @organisation_id = params["organisation_id"] @resource = User.new - debugger end def create diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index d90596db6..1350f52a1 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -42,7 +42,7 @@ <% end %> - <% hints_for_roles = { data_provider: ["Provider hint"], data_coordinator: ["Support hint", "Other"], support: [] } %> + <% hints_for_roles = { data_provider: ["Default role for this organisation", "Can view and submit logs for this organisation"], data_coordinator: ["Can view and submit logs for this organisation and any of its managing agents", "Can manage details for this organisation", "Can manage users for this organisation"], support: nil } %> <% roles_with_hints = current_user.assignable_roles.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize, description: hints_for_roles[key.to_sym]) } %> @@ -51,23 +51,10 @@ :id, :name, ->(option) do - result = option.description.sum(nil) {|hint| content_tag(:li, hint) } + result = option.description&.sum(nil) {|hint| content_tag(:li, hint) } end, legend: { text: "Role", size: "m" } %> - <%= f.govuk_collection_radio_buttons :is_dpo, - [OpenStruct.new(id: true, name: "Yes"), OpenStruct.new(id: false, name: "No")], - :id, - :name, - legend: { text: "#{perspective(@user, current_user)} the organisation’s data protection officer?", size: "m" } %> - - <%= f.govuk_collection_radio_buttons :is_key_contact, - [OpenStruct.new(id: true, name: "Yes"), OpenStruct.new(id: false, name: "No")], - :id, - :name, - legend: { text: "#{perspective(@user, current_user)} a key contact for this service?", size: "m" }, - hint: { text: "This is a person responsible for sharing information about social housing lettings and sales data within the organisation." } %> - <%= f.govuk_submit "Continue" %>