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

Solve #109 problem #113

Merged
merged 5 commits into from
Jan 31, 2024
Merged

Solve #109 problem #113

merged 5 commits into from
Jan 31, 2024

Conversation

EstelleDa
Copy link
Member

No description provided.

@EstelleDa EstelleDa requested a review from ashsny January 25, 2024 09:26
@@ -1282,7 +1284,27 @@ export default {
this.secondaryPublicationIdentifiers = []
this.publicationIdentifiers = []
this.dataUsagePolicy = null
this.targetGene = null
this.existingTargetGene = null
this.targetGene = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is redundant with l686 where target gene is created. I think you want to add a helper function emptyTargetGene outside the component to wrap this code and then find all the similar code and replace it with this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

for (const dbName of externalGeneDatabases) {
if (newValue[dbName]?.identifier?.identifier != null && newValue[dbName]?.offset == null) {
this.targetGene.externalIdentifiers[dbName].offset = 0
if (newValue) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of wrapping the whole function in if (newValue) {
just add

if (!newValue) {
  return
}

@@ -1291,7 +1313,6 @@ export default {
this.geneName = null
this.geneNameAccessionSuggestions = []
this.geneNameDropdownValue = null
this.targetGenes = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this deleted? what is the effect of not clearing this on clear()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's repeated. Another this.targetGenes = [] is in line 1308.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.targetGenes is no longer getting cleared in the 'New score set' case when clear is clicked due to this deletion. not sure what you mean by it's repeated here, I don't see it on l1308 before or after your changes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the repeated codes were from my other branch.

this.fileCleared('targetGeneTargetSequenceSequenceFile')
this.referenceGenome = null
this.targetGene = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also fix redundancy with l686 by adding helper function returning this target gene

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like you're not yet using the helper function for the initialization at l686.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Ashley! Now I know what is the helper function.

@ashsny
Copy link
Contributor

ashsny commented Jan 31, 2024

I'll finish this up as I want it to go in with the frontend push today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants