iobio / gene.iobio

Gene.iobio vue
MIT License
55 stars 11 forks source link

For selecting custom annotations, simplify code by removing of unnecessary data fields #1026

Open tonydisera opened 8 months ago

tonydisera commented 8 months ago

It is difficult to follow the code when fields sent in as properties are copied to data fields. For example, in VariantInspectCard, the property 'selectedVariantInfo' is copied into the data field 'variantInfo'. This is unnecessary since these fields are not changed in VariantInspectCard. These can be sent as properties to SelectVariantAnnoationsDialog.

Yang, I will remove variantInfo from VariantInspectCard. Please look at the commit and then do the same for selectedFormat and selectedVariantMosaic and selectedVariantAllAnnots. Also, take care when naming these fields so that it is easier to understand the code. A bug was introduced because 'info' and 'selectedInfo' were confused in VariantInspectDetail. (I fixed this in #1015)

tonydisera commented 8 months ago

@YangQi007 , please see above commit [f0788cbb] that removes the unnecessary data field selectedInfo from VariantInspectCard. Now do the same for the other fields (selectedFormat, selectedMosaicVariantAnnotations, selectedAll). Getting rid of this extra layer of data fields will make the code much easier to read.