Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable populating the taxonomic classifications fields using a list of common taxa #2086

Closed
robyngit opened this issue Jan 27, 2023 · 5 comments · Fixed by #2132
Closed

Enable populating the taxonomic classifications fields using a list of common taxa #2086

robyngit opened this issue Jan 27, 2023 · 5 comments · Fixed by #2132
Assignees
Labels
editor enhancement SCTLD taxa editor Issues related to improving or fixing the taxonomic classifications section of the Editor
Milestone

Comments

@robyngit
Copy link
Member

robyngit commented Jan 27, 2023

When a repository's data is tied to specific taxa, it would be nice to make it easier to enter in these common entities. This feature was requested by the SCTLD hosted repo:

Could we change having to enter all taxa information as separate entities (Kingdom, Phylum...Species) to a drop-down menu for stony coral genus/species?

The exact list of taxa and how it maps to rank & value should all be configurable in the AppModel, so that each repository can customize this appropriately to their data.

I assume that we would still want to allow entry of other taxa besides those specified in the dropdown list.

Other open issues related to the taxa editor here

@robyngit robyngit added enhancement editor taxa editor Issues related to improving or fixing the taxonomic classifications section of the Editor labels Jan 27, 2023
@robyngit
Copy link
Member Author

robyngit commented Feb 3, 2023

Note: This could be implemented as a metadata snippet, see #1933

@robyngit
Copy link
Member Author

robyngit commented Feb 9, 2023

How the Taxon Coverage editor works currently

screenshot showing the taxa editor with a list of dropdown rank options and a blank field for free entry of the value for that rank

  • The Taxon Coverage editor is rendered by the EML211View. There is also a separate WIP not-yet-implemented EMLTaxonView intended to separate out the taxon section into it's own, more modular view. This is likely because the EML211View is large and complex (extended from ScienceMetadataView, 60 methods and 9 templates not including any from ScienceMetadataView, 2375 lines, variable formatting, sparse JSDocs), see also: Add titles to taxa tables #255 (comment) and Add titles to taxa tables #255 (comment)
  • A separate table is created for each taxon, and a row for each rank for that taxon, e.g. rank: Kingdom, value: Animalia is one row.
  • Above each table there is a header displaying the index of the taxon in the list, e.g. Species 7
  • A new, empty table is added automatically below the last table when needed, so that a user can continuously enter more taxon.
  • Uses three templates: taxonomicCoverage.html, taxonomicClassificationTable.html, taxonomicClassificationRow.html
  • Methods that render the taxa editor in EML211View in the order that they are called: render -> renderTaxa -> createTaxonomicCoverage -> createTaxonomicClassifcationTable
  • The updateTaxonCoverage method is used to update the EMLTaxonCoverage model, given the information in the HTML. It's called when a row or table is removed or when a user changes the Rank or Value. It's a complex function and has the note: "This should be ... refactored into tidy functions."
  • Other taxon methods:
    • addNewTaxon adds a new blank row when needed
    • removeTaxonRank removes entry when remove button clicked
    • showTaxonValidation shows or hides errors/help message when user focuses out of table row
    • previewTaxonRemove Shows visual indication that a row will be removed when a user hovers over the remove button

How we could update it

  • Add a new option to the App Model that maps taxa names to taxonomic classifications, e.g.
{
  taxaOptions: {
    Bonobo: [
      {
        taxonRankName: "Kingdom",
        taxonRankValue: "Animalia"
      },
      // ... etc ...
      {
        taxonRankName: "Species",
        taxonRankValue: "Pan paniscus"
      }
    ],
    Chimpanzee: [...],
    Gorilla: [...],
    // ... etc ...
  }
}
  • Add a container for a dropdown of taxa names to the taxonomicCoverage.html template, conditionally added if the taxaOptions option is set in the App Model. The dropdown would show the list of taxa names configured in the app. (e.g. Bonobo, Chimpanzee, Gorilla, etc.)
  • When a user selects a taxon name from the dropdown, a new table will be created in the editor that shows the ranks and values pre-filled for the given species as configured in the app model.
  • Write a new method to handle making these updates when a taxon is selection. This method could work similarly to addNewTaxon to create the HTML elements, and to updateTaxonCoverage to then update the EML model.
  • Some complications to consider are: The header at the top of each table showing the species number will need to be updated when a new coverage is added, and we will need to make sure that there is still always a new, empty table available at the bottom of the taxa editor for free entry.
  • I think ideally we would first complete the EMLTaxonView, and clean up and modularize the updateTaxonCoverage method, or else the EML211View will grow bigger and more complex with all these new updates. However, this would add more time onto completing the issue.
  • We should also consider how we might be able to add the citation for the taxon automatically in these cases, see taxa section: add taxon citation help #200

@robyngit robyngit added this to the 2.24.0 milestone Feb 9, 2023
@robyngit robyngit added the SCTLD label Feb 16, 2023
@robyngit
Copy link
Member Author

Here are some additional requirements for this feature:

  • Allow configuring multiple taxa drop-downs (e.g. for different categories of species)
  • Allow selecting more than one species at a time in the dropdown
  • Include option for adding additional species by typing in text (so, something like 'NEW SPECIES' with a box that allows new text to be typed)
  • Populate the taxonID (EML 2.2.) field automatically

@robyngit
Copy link
Member Author

Here is the issue for finishing the EMLTaxonView and moving this view out of the main EML211View: #25

@robyngit
Copy link
Member Author

We decided today that there should be two ways to configure the list of taxa: either a hard-coded list in the appConfig or a text file stored in the repository. If using a text file, then the object's SID would be configured in the appConfig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor enhancement SCTLD taxa editor Issues related to improving or fixing the taxonomic classifications section of the Editor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant