Skip to content

Commit

Permalink
Fixes #36718 - Mark required fields for policy
Browse files Browse the repository at this point in the history
  • Loading branch information
ofedoren authored and adamruzicka committed Oct 5, 2023
1 parent 0397578 commit 09d1197
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/helpers/policies_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ def scap_content_selector(form)
select_f form, :scap_content_id, scap_contents, :id, :title,
{ :include_blank => _("Choose existing SCAP Content") },
{ :label => _("SCAP Content"),
:required => true,
:onchange => 'scap_content_selected(this);',
:'data-url' => method_path('scap_content_selected') }
else
select_f form, :scap_content_id, scap_contents, :id, :title,
{ :label => _("SCAP Content"),
:required => true,
:onchange => 'scap_content_selected(this);',
:'data-url' => method_path('scap_content_selected') }
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/policies/steps/_policy_attributes_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="tab-pane <%= show_partial_wizard(step) %>" id="create-policy">
<%= wizard_header @policy.step_index, *translate_steps(@policy) %>
<%= text_f(f, :name) %>
<%= text_f(f, :name, :required => true) %>
<%= text_f(f, :description, :size => "col-md-8" ) %>
</div>
12 changes: 8 additions & 4 deletions app/views/policies/steps/_schedule_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
<%= wizard_header @policy.step_index, *@policy.steps %>
<%= select_f(f, :period, %w[Weekly Monthly Custom], :downcase, :to_s,
{ :include_blank => _('Choose period') },
{ :onchange => 'period_selected(this)' }) %>
<%= select_f(f, :weekday, days_of_week_hash, :first, :last, :include_blank => _('Choose weekday')) %>
<%= select_f(f, :day_of_month, (1..31).to_a, :to_i, :to_s, :help_inline => _('Number of a day in month, note that not all months have same count of days'), :include_blank => _('Choose day in month')) %>
<%= text_f(f, :cron_line, :help_inline => _('You can specify custom cron line, e.g. "0 3 * * *", separate each of 5 values by space')) %>
{ :onchange => 'period_selected(this)', :required => true }) %>
<%= select_f(f, :weekday, days_of_week_hash, :first, :last,
{ :include_blank => _('Choose weekday') },
{ :required => true }) %>
<%= select_f(f, :day_of_month, (1..31).to_a, :to_i, :to_s,
{ :include_blank => _('Choose day in month') },
{ :help_inline => _('Number of a day in month, note that not all months have same count of days'), :required => true }) %>
<%= text_f(f, :cron_line, :help_inline => _('You can specify custom cron line, e.g. "0 3 * * *", separate each of 5 values by space'), :required => true) %>
</div>

0 comments on commit 09d1197

Please sign in to comment.