Skip to content

Commit

Permalink
fixed plugin for catalog upload
Browse files Browse the repository at this point in the history
  • Loading branch information
titima15 committed Dec 20, 2022
1 parent 70be199 commit b74a8be
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
24 changes: 13 additions & 11 deletions lib/CXGN/Stock/ParseUpload/Plugin/CatalogXLS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,19 @@ sub _validate_with_plugin {
my %supported_types;
my %supported_categories;
my %supported_material_sources;
my %supported_availability;
my %supported_material_types;

$supported_types{'single item'} = 1;
$supported_types{'set of items'} = 1;

# $supported_categories{'released variety'} = 1;
# $supported_categories{'pathogen assay'} = 1;
# $supported_categories{'control'} = 1;
$supported_categories{'released variety'} = 1;
$supported_categories{'pathogen assay'} = 1;
$supported_categories{'control'} = 1;
$supported_categories{'transgenic line'} = 1;

$supported_material_types{'seed'} = 1;
$supported_material_types{'plant'} = 1;
$supported_material_types{'construct'} = 1;

# $supported_material_sources{'OrderingSystemTest'} = 1;
# $supported_material_sources{'Sendusu'} = 1;
Expand Down Expand Up @@ -203,19 +208,16 @@ sub _validate_with_plugin {

if (!$material_type || $material_type eq '') {
push @error_messages, "Cell C$row_name: material_type missing";
} elsif (!$supported_material_types{$material_type}) {
push @error_messages, "Cell C$row_name: material type is not supported: $material_type";
}

if (!$category || $category eq '') {
push @error_messages, "Cell D$row_name: category missing";
} elsif (!$supported_categories{$category}) {
push @error_messages, "Cell C$row_name: category is not supported: $category";
}

# } elsif (!$supported_categories{$category}) {
# push @error_messages, "Cell C$row_name: category is not supported: $category";
# }
# if (!$description || $description eq '') {
# push @error_messages, "Cell D$row_name: description missing";
# }

# if (!$material_source || $material_source eq '') {
# push @error_messages, "Cell E$row_name: material_source missing";
# } elsif (!$supported_material_sources{$material_source}) {
Expand Down
14 changes: 7 additions & 7 deletions mason/order/edit_catalog_details_dialog.mas
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ $item_prop_id
<div class="col-sm-8">
<div class="input-group">
<select class="form-control" id="edit_material_type" value="<%$material_type%>">
<option value="Plant">Plant</option>
<option value="Seed">Seed</option>
<option value="Construct">Construct</option>
<option value="plant">plant</option>
<option value="seed">seed</option>
<option value="construct">construct</option>
</select>
</div>
</div>
Expand All @@ -76,10 +76,10 @@ $item_prop_id
<div class="col-sm-8">
<div class="input-group">
<select class="form-control" id="edit_item_category" value="<%$category%>">
<option value="Released Variety">Released Variety</option>
<option value="Pathogen Assay ">Pathogen Assay</option>
<option value="Control">Control</option>
<option value="Transgenic Line">Transgenic Line</option>
<option value="released variety">released variety</option>
<option value="pathogen assay ">pathogen assay</option>
<option value="control">control</option>
<option value="transgenic line">transgenic line</option>
</select>
</div>
</div>
Expand Down
10 changes: 6 additions & 4 deletions mason/order/upload_catalog_items_dialog.mas
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
<br>
<b>Header:</b>
<br>
The first row (header) must contain the following:
<br>
<table class="table table-bordered table-hover">
<tbody>
<tr>
Expand All @@ -112,10 +114,10 @@
<ul>
<li><b>item_name:</b>Item name must be in the database.</li>
<li><b>item_type:</b>Must be one of the following (single item, set of items). This field can be customized, please contact us.</li>
<li><b>material_type:</b>e.g. plant, seed, construct.</li>
<li><b>category:</b> e.g. released variety, pathogen assay, control, transgenic line </li>
<li><b>additional_info:</b> optional </li>
<li><b>material_source:</b></li>
<li><b>material_type:</b>Must be one of the following (plant, seed, construct). This field can be customized, please contact us.</li>
<li><b>category:</b>Must be one of the following (released variety, pathogen assay, control, transgenic line). This field can be customized, please contact us. </li>
<li><b>additional_info:</b> (optional) </li>
<li><b>material_source:</b> (optional)</li>
<li><b>breeding_program:</b>Breeding program must be in the database.</li>
<li><b>contact_person_username:</b>Please indicate contact person of each item. Contact person username must be in the database</li>
</ul>
Expand Down

0 comments on commit b74a8be

Please sign in to comment.