revoved trim options from TaxonomyTab textfields, because the value can be incertae sedis which has a space

This commit is contained in:
juhanikat
2025-06-02 12:17:48 +03:00
parent 216e25f57a
commit 424d28b460
2 changed files with 6 additions and 5 deletions
@@ -17,15 +17,16 @@ export const TaxonomyTab = () => {
]
const classification = [
// TODO Add static Class field
['Class', 'Mammalia', 'Subclass or Superorder', textField('subclass_or_superorder_name')],
['Order', textField('order_name'), 'Suborder or Superfamily', textField('suborder_or_superfamily_name')],
['Family', textField('family_name'), 'Subfamily or Tribe', textField('subfamily_name')],
['Genus', textField('genus_name'), ''],
['Genus', textField('genus_name')],
['Species', textField('species_name'), 'Unique Identifier', textField('unique_identifier')],
['Taxonomic Status', dropdown('taxonomic_status', taxonStatusOptions, 'Taxonomic Status')],
]
if (mode.new) classification[0][0] = copyTaxonomyButton // adds copy button to the start of the array
const comment = [['Comment', bigTextField('sp_comment')]]
const author = [['Author', textField('sp_author')]]
+3 -3
View File
@@ -6,12 +6,12 @@ export const validateSpecies = (
fieldName: keyof EditDataType<SpeciesDetailsType>
) => {
const validators: Validators<Partial<EditDataType<SpeciesDetailsType>>> = {
// const isNew = editData.lid === undefined
order_name: {
name: 'Order',
required: true,
asString: (orderName: string) => {
if (orderName !== 'incertae sedis' && orderName.indexOf(' ') !== -1) return 'Order must not contain any spaces.'
if (orderName !== 'incertae sedis' && orderName.indexOf(' ') !== -1)
return 'Order must not contain any spaces, unless the value is "incertae sedis".'
},
},
family_name: {
@@ -19,7 +19,7 @@ export const validateSpecies = (
required: true,
asString: (familyName: string) => {
if (familyName !== 'incertae sedis' && familyName.indexOf(' ') !== -1)
return 'Family must not contain any spaces.'
return 'Family must not contain any spaces, unless the value is "incertae sedis".'
},
},
genus_name: {