Skip to content

Commit

Permalink
enable creation of empty seedlots
Browse files Browse the repository at this point in the history
  • Loading branch information
afpowell committed Oct 21, 2024
1 parent 6f0e62e commit e1be94a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 0 additions & 5 deletions lib/SGN/Controller/AJAX/Seedlot.pm
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,6 @@ sub create_seedlot :Path('/ajax/breeders/seedlot-create/') :Args(0) {
my $transaction_description = $c->req->param("seedlot_transaction_description");
my $breeding_program_id = $c->req->param("seedlot_breeding_program_id");

if (!$weight && !$amount){
$c->stash->{rest} = {error=>'A seedlot must have either a weight or an amount.'};
$c->detach();
}

if (!$timestamp){
$c->stash->{rest} = {error=>'A seedlot must have a timestamp for the transaction.'};
$c->detach();
Expand Down
5 changes: 2 additions & 3 deletions mason/breeders_toolbox/add_seedlot_dialogs.mas
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ $cross_uniquename => ''
<div class="form-group">
<label class="col-sm-3 control-label">Amount (number of seeds): </label>
<div class="col-sm-9" >
<input class="form-control" id="seedlot_amount" placeholder="Amount OR Weight(g) Required">
<input class="form-control" id="seedlot_amount" placeholder="Optional">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Weight (g): </label>
<div class="col-sm-9" >
<input class="form-control" id="seedlot_weight" placeholder="Amount OR Weight(g) Required">
<input class="form-control" id="seedlot_weight" placeholder="Optional">
</div>
</div>
<!--
Expand Down Expand Up @@ -207,7 +207,6 @@ jQuery(document).ready(function(){
if (name == '') { alert("Please provide a name"); return; }
else if (location == '') { alert("Please provide a location"); return; }
else if (box_name == '') { alert("Please provide a box name"); return; }
else if (amount == '' && weight == '') { alert("Please provide a seed count amount or a weight in grams!"); return; }
else if (isNaN(amount)) { alert("If inputting a seed count amount, it must be a numeric value."); return; }
else if (isNaN(weight)) { alert("If inputting a weight, it must be a numeric value."); return; }
else if (breeding_program_id == '') { alert("Please select a breeding program"); return; }
Expand Down

0 comments on commit e1be94a

Please sign in to comment.