Skip to content

Commit

Permalink
Merge pull request #4240 from sanger/anospp-modify-sample-desc-valida…
Browse files Browse the repository at this point in the history
…tion

ANOSPP - modify specimen plate barcode column validation
  • Loading branch information
andrewsparkes authored Jul 29, 2024
2 parents c521413 + c125c64 commit 63a0379
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/sequencescape_excel/sequencescape_excel/validation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def inspect
##
# formula1 is defined within the options, however it needs to be updated
# with:
# 1) A provided rage in the case of lists
# 1) A provided range in the case of lists
# 2) Proper cell names in the case of custom formulas
# 3) AXLSX doesn't escape text fields for us, so we do that ourselves
def formula1
Expand Down
20 changes: 20 additions & 0 deletions config/sample_manifest_excel/columns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,26 @@ sample_description_specimen_plate_barcode:
operator: ">"
operand: 20
is_number:
sample_description_specimen_plate_barcode_mandatory:
heading: SAMPLE DESCRIPTION
updates: sample_description
unlocked: true
validation:
options:
type: :custom
operator: :between
formula1: "=AND(LEN(A1)>=7,LEN(A1)<=11)"
allowBlank: false
showInputMessage: true
promptTitle: "Sample Description - Specimen Plate Barcode"
prompt: "Please enter the specimen plate barcode (NB. should be the same for all wells on the input plate, and between 7 and 11 characters in length)."
showErrorMessage: true
errorStyle: :stop
errorTitle: "Sample Description - Specimen Plate Barcode"
error: "The barcode length must be between 7 and 11 characters in length."
conditional_formattings:
empty_mandatory_cell:
is_number:
sample_strain_att:
heading: STRAIN
unlocked: true
Expand Down
2 changes: 1 addition & 1 deletion config/sample_manifest_excel/manifest_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ plate_anospp:
- :date_of_sample_collection
- :sample_taxon_id
- :sample_common_name
- :sample_description_specimen_plate_barcode
- :sample_description_specimen_plate_barcode_mandatory
- :sample_type
- :donor_id
- :control_type
Expand Down
20 changes: 20 additions & 0 deletions spec/data/sample_manifest_excel/columns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,26 @@ sample_description_specimen_plate_barcode:
operator: ">"
operand: 20
is_number:
sample_description_specimen_plate_barcode_mandatory:
heading: SAMPLE DESCRIPTION
updates: sample_description
unlocked: true
validation:
options:
type: :custom
operator: :between
formula1: "=AND(LEN(A1)>=7,LEN(A1)<=11)"
allowBlank: false
showInputMessage: true
promptTitle: "Sample Description - Specimen Plate Barcode"
prompt: "Please enter the specimen plate barcode (NB. should be the same for all wells on the input plate, and between 7 and 11 characters in length)."
showErrorMessage: true
errorStyle: :stop
errorTitle: "Sample Description - Specimen Plate Barcode"
error: "The barcode length must be between 7 and 11 characters in length."
conditional_formattings:
empty_mandatory_cell:
is_number:
sample_strain_att:
heading: STRAIN
unlocked: true
Expand Down
2 changes: 1 addition & 1 deletion spec/data/sample_manifest_excel/manifest_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ plate_anospp:
- :date_of_sample_collection
- :sample_taxon_id
- :sample_common_name
- :sample_description_specimen_plate_barcode
- :sample_description_specimen_plate_barcode_mandatory
- :sample_type
- :donor_id
- :control_type
Expand Down

0 comments on commit 63a0379

Please sign in to comment.