mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
revoved trim options from TaxonomyTab textfields, because the value can be incertae sedis which has a space
This commit is contained in:
@@ -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')]]
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user