[deploy] Add display_area & show_in_onboarding to the profile setup ui (#10158)

This commit is contained in:
Ridhwana 2020-09-02 23:30:33 +02:00 committed by GitHub
parent b79766f697
commit c90cb2caf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 4 deletions

View file

@ -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

View file

@ -21,7 +21,6 @@
</div>
<div id="<%= group_name %>BodyContainer" class="collapse hide p-3" aria-labelledby="<%= group_name %>Header">
<% if group.profile_fields.empty? %>
<div> There are no profile fields configured for this group. </div>
<% else %>

View file

@ -25,3 +25,11 @@
<%= form.label :input_type %>
<%= form.select :input_type, ProfileField.input_types.keys, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :display_area %>
<%= form.select :display_area, ProfileField.display_areas.keys, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :show_in_onboarding %>
<%= form.check_box :show_in_onboarding %>
</div>

View file

@ -1,6 +1,5 @@
<main id="profileFields">
<%= render "add_group_modal" %>
<%= render "grouped_profile_fields" %>
<%= render "ungrouped_profile_fields" %>
</div>