18F/identity-dashboard

View on GitHub
app/views/service_config_wizard/settings.html.erb

Summary

Maintainability
Test Coverage
<h1 class="usa-display"><%= t('service_provider_form.wizard_steps.settings') %></h1>
<p class="usa-intro"><%= t('simple_form.lead.settings_html') %></p>
<div class="wizard-main">
  <%= wizard_form do |form| %>
    <%= form.association :team,
                         as: :usa_collection_select,
                         value_method: :id,
                         collection: current_user.scoped_teams,
                         label: t('simple_form.labels.service_provider.team'),
                         prompt: t('simple_form.labels.select'),
                         disabled: !can_edit_teams?(current_user),
                         required: true,
                         hint: I18n.t('service_provider_form.team') %>

    <%= render partial: 'fieldset', locals: {
        form: form,
        fieldname: 'dashboard_config',
        description: false,
        html_desc: false,
        input_type: 'radio',
        required: true,
        db_fieldname: :prod_config,
        inputs: {
          t('simple_form.labels.service_provider.sandbox') => false,
          t('simple_form.labels.service_provider.production') => true,
        },
      } %>

    <%= form.input :app_name,
                    input_html: { class: 'usa-input' },
                    label_html: { class: 'usa-input-required'},
                    required: true,
                    label: t('simple_form.labels.service_provider.app_name'),
                    placeholder: 'Ex: DHS-CSP',
                    hint: t('service_provider_form.app_name_html') %>

    <%= form.input :friendly_name,
                    input_html: { class: 'usa-input', aria: { invalid: false } },
                    label_html: { class: 'usa-input-required'},
                    required: true,
                    label: t('simple_form.labels.service_provider.friendly_name'),
                    placeholder: 'Ex: DHS Customer Service Portal',
                    hint: t('service_provider_form.friendly_name_html') %>

    <%= form.input :description,
                    as: :usa_textarea,
                    label_html: { class: 'usa-input-optional' },
                    label: t('simple_form.labels.service_provider.description'),
                    hint: I18n.t('service_provider_form.description') %>
    <%= render partial:'footer', locals: { form: form } %>
  <% end %>
</div>