Skip to content

Commit

Permalink
Background Activity new form persistency
Browse files Browse the repository at this point in the history
Form didn't remember user_id and remote_resource_id
when going through multiple rounds of submit.
  • Loading branch information
prioux committed Apr 16, 2024
1 parent 47aaeca commit fc2817e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion BrainPortal/app/models/background_activity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def prepare_repeat!
# "tomorrow@HH:MM"
# "monday@HH:MM" .. "sunday@HH:MM"
if rep_code =~ /(tomorrow|monday|tuesday|wednesday|thursday|friday|saturday|sunday)@(\d\d):(\d\d)/i
_,nextday,hour,minutes = Rexexp.last_match.to_a
_,nextday,hour,minutes = Regexp.last_match.to_a

if nextday == 'tomorrow'
daystart = DateTime.now.tomorrow.at_beginning_of_day.getlocal
Expand Down
5 changes: 3 additions & 2 deletions BrainPortal/app/views/background_activities/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
<div class="generalbox">

<p><%= f.label :user_id, "User" %><br>
<%= user_select("background_activity[user_id]", { :selected => @bac.user_id } ) %>
<%= user_select("background_activity[user_id]", :selector => @bac.user_id.to_s) %>

<p><%= f.label :remote_resource_id, "Portal or Execution Server" %><br>
<%= bourreau_select("background_activity[remote_resource_id]", {
:bourreaux => RemoteResource.all.order(:name).to_a,
:selected => @bac.remote_resource_id } ) %>
:selector => @bac.remote_resource_id.to_s } ) %>

<p><%= f.label :start_date, "Initial Start Date" %><br>
<%= text_field_tag :start_date, @start_date, :class => "datepicker" %>
Expand Down Expand Up @@ -73,6 +73,7 @@
[ "Every 30 minutes" , 'start+30' ],
[ "Every hour" , 'start+60' ],
[ "Every 12 hours" , 'start+720' ],
[ "Every 24 hours" , 'start+1440' ],
[ "Tomorrow and everyday at..." , 'tomorrow@' ],
[ "Mondays at..." , 'monday@' ],
[ "Tuesdays at..." , 'tuesday@' ],
Expand Down

0 comments on commit fc2817e

Please sign in to comment.