While users should still be allowed to enter genes using the gene symbol, they should be stored internally using Ensembl IDs.
User can enter genes using any type of ID
If they select something from the dropdown, we save the ensembl ID as the underlying ID
If they don't select anything from the dropdown, we server-side search for exact matches. If one match is found, we store the ensembl ID as the underlying ID. If none are found, we store the user-entered text as the underlying ID.
On page visualization, we include the ensembl ID in a hidden field and show the gene symbol instead (like we do with phenotypes/HPO terms). If there is no gene symbol, but the ID matches "^ENSG[0-9]+$", then we display it as a valid ID. If it doesn't match, we display it as a non-standard/invalid ID.
I've updated the description based on a very helpful conversation with
Variants are broken, since a variant still references its parent gene with the gene symbol.
Temporarily reverted until other parts dealing with genes are refactored.
To re-apply: 163b859893b4738e2544a64a9902bae17c6621ea and 5494a153ae4a29bf1d0d97f90b5e69a752831242