From c90cb2caf0e94fc31d80fe83ee6c7992336d7bff Mon Sep 17 00:00:00 2001 From: Ridhwana Date: Wed, 2 Sep 2020 23:30:33 +0200 Subject: [PATCH] [deploy] Add display_area & show_in_onboarding to the profile setup ui (#10158) --- app/controllers/admin/profile_fields_controller.rb | 4 ++-- .../admin/profile_fields/_grouped_profile_fields.html.erb | 1 - .../admin/profile_fields/_profile_field_form.html.erb | 8 ++++++++ app/views/admin/profile_fields/index.html.erb | 1 - 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/controllers/admin/profile_fields_controller.rb b/app/controllers/admin/profile_fields_controller.rb index b98d177f5..dd7686d49 100644 --- a/app/controllers/admin/profile_fields_controller.rb +++ b/app/controllers/admin/profile_fields_controller.rb @@ -1,12 +1,12 @@ module Admin class ProfileFieldsController < Admin::ApplicationController ALLOWED_PARAMS = %i[ - input_type label active placeholder_text description profile_field_group_id + input_type label active placeholder_text description profile_field_group_id display_area show_in_onboarding ].freeze layout "admin" def index - @grouped_profile_fields = ProfileFieldGroup.all.includes(:profile_fields).order(:name) + @grouped_profile_fields = ProfileFieldGroup.includes(:profile_fields).order(:name) @ungrouped_profile_fields = ProfileField.where(profile_field_group_id: nil).order(:label) end diff --git a/app/views/admin/profile_fields/_grouped_profile_fields.html.erb b/app/views/admin/profile_fields/_grouped_profile_fields.html.erb index a23c29418..eb89b5cd5 100644 --- a/app/views/admin/profile_fields/_grouped_profile_fields.html.erb +++ b/app/views/admin/profile_fields/_grouped_profile_fields.html.erb @@ -21,7 +21,6 @@
- <% if group.profile_fields.empty? %>
There are no profile fields configured for this group.
<% else %> diff --git a/app/views/admin/profile_fields/_profile_field_form.html.erb b/app/views/admin/profile_fields/_profile_field_form.html.erb index c175c2a17..cf3b5c515 100644 --- a/app/views/admin/profile_fields/_profile_field_form.html.erb +++ b/app/views/admin/profile_fields/_profile_field_form.html.erb @@ -25,3 +25,11 @@ <%= form.label :input_type %> <%= form.select :input_type, ProfileField.input_types.keys, class: "form-control" %>
+
+ <%= form.label :display_area %> + <%= form.select :display_area, ProfileField.display_areas.keys, class: "form-control" %> +
+
+ <%= form.label :show_in_onboarding %> + <%= form.check_box :show_in_onboarding %> +
diff --git a/app/views/admin/profile_fields/index.html.erb b/app/views/admin/profile_fields/index.html.erb index bd193562b..eb5d192c3 100644 --- a/app/views/admin/profile_fields/index.html.erb +++ b/app/views/admin/profile_fields/index.html.erb @@ -1,6 +1,5 @@
<%= render "add_group_modal" %> - <%= render "grouped_profile_fields" %> <%= render "ungrouped_profile_fields" %>