Skip to content

Commit

Permalink
Merge pull request #529 from ncats/sitesShorthand
Browse files Browse the repository at this point in the history
sitesShorthand removal for bug fix
  • Loading branch information
NikoAnderson authored Aug 7, 2024
2 parents 16bf89d + 7e3e8a6 commit 5da8ef3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/app/core/substance-form/substance-form.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1422,13 +1422,33 @@ export class SubstanceFormService implements OnDestroy {
if (this.privateSubstance.protein && this.privateSubstance.protein.disulfideLinks
&& this.privateSubstance.protein.disulfideLinks.length > 0) {
for (let i = this.privateSubstance.protein.disulfideLinks.length; i >= 0; i--) {
if (this.privateSubstance.protein.disulfideLinks[i].sitesShorthand) {
delete this.privateSubstance.protein.disulfideLinks[i].sitesShorthand;
}
if (this.privateSubstance.protein.disulfideLinks[i] && this.privateSubstance.protein.disulfideLinks[i].sites &&
this.privateSubstance.protein.disulfideLinks[i].sites[0] && this.privateSubstance.protein.disulfideLinks[i].sites[1] &&
Object.keys(this.privateSubstance.protein.disulfideLinks[i].sites[0]).length === 0 &&
Object.keys(this.privateSubstance.protein.disulfideLinks[i].sites[1]).length === 0) {
this.privateSubstance.protein.disulfideLinks.splice(i, 1);
}
}

if (this.privateSubstance.nucleicAcid) {
if (this.privateSubstance.nucleicAcid.linkages && this.privateSubstance.nucleicAcid.linkages.length > 0) {
for (let i = this.privateSubstance.nucleicAcid.linkages.length; i >= 0; i--) {
if (this.privateSubstance.nucleicAcid.linkages[i].sitesShorthand) {
delete this.privateSubstance.nucleicAcid.linkages[i].sitesShorthand;
}
}
}
if (this.privateSubstance.nucleicAcid.sugars && this.privateSubstance.nucleicAcid.sugars.length > 0) {
for (let i = this.privateSubstance.nucleicAcid.sugars.length; i >= 0; i--) {
if (this.privateSubstance.nucleicAcid.sugars[i].sitesShorthand) {
delete this.privateSubstance.nucleicAcid.sugars[i].sitesShorthand;
}
}
}
}
}
// end view=internal changes

Expand Down

0 comments on commit 5da8ef3

Please sign in to comment.