You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/functionality/species_taxonomy_checks.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
### Species taxonomy checks
2
2
3
+
NOTE: This document might be outdated, especially the order/content of the lists.
4
+
3
5
If you are unsure how the taxonomic conventions work or what the different taxonomic fields mean, you should read [this document](https://github.com/nowcommunity/NOW-Django/wiki/Data-Conventions%3A-Taxonomic-Fields) first. (NOTE: some information might be incorrect, outdated or not implemented in the new version of the app. Once an updated document is made, it should be linked here.)
4
6
5
-
When the user is creating a new species or editing an existing one, clicking the write button calls the functions inside [taxonomyFunctions.tsx](../../frontend/src/components/Species/taxonomyFunctions.tsx) in the following order:
7
+
In edit views which have the need for a taxonomy check, the `taxonomy` prop should be given to the [WriteButton](../../frontend/src/components/DetailView/components.tsx) component. The WriteButton then runs the taxonomy checks once pressed. For example, if the user is creating a new species or editing an existing one, clicking the write button calls the functions inside [taxonomyUtilities.tsx](../../frontend/src/util/taxonomyUtilities.tsx) in the following order:
6
8
7
9
1. The `convertTaxonomyFields` function formats the taxonomy values given by the user. Everything except `species_name` and `unique_identifier` begins with a capital letter, with all other letters lowercased. The exceptions to this are special values: "incertae sedis", "indet.", "fam.", "gen." and "sp.", which are left unchanged. `species_name` is fully lowercased, and `unique_identifier` is also left unchanged.
8
10
2. The `checkTaxonomy` function ensures that the species does not already exist in the database, and that the taxonomy tree is correct. The function loops through every species in the database and for each one:
@@ -13,7 +15,7 @@ When the user is creating a new species or editing an existing one, clicking the
13
15
14
16
If any of these checks fail, the creating/updating fails and the user is notified about it.
15
17
16
-
The [taxonomyFunctions file](../../frontend/src/components/Species/taxonomyFunctions.tsx) has a bunch of functions named `checkXY` which check the validity of taxonomic data between fields X and Y (step 4 in the list above). For example, X could be `family` and Y could be `subfamily`, and the function `checkFamilySubfamily` returns `true` if:
18
+
The [taxonomyUtilities file](../../frontend/src/util/taxonomyUtilities.tsx) has a bunch of functions named `checkXY` which check the validity of taxonomic data between fields X and Y (step 4 in the list above). For example, X could be `family` and Y could be `subfamily`, and the function `checkFamilySubfamily` returns `true` if:
17
19
18
20
1. The new species contains both `family` and `subfamily` values
19
21
2. These values are not "incertae sedis" or "indet."
0 commit comments