-
Notifications
You must be signed in to change notification settings - Fork 187
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
#3824 - Macro: Modify nucleotides from sequence in RNA builder #4335
#3824 - Macro: Modify nucleotides from sequence in RNA builder #4335
Conversation
1812d78
to
a73439f
Compare
80cd987
to
1e622ba
Compare
3b963d7
to
d6d5a45
Compare
...src/components/monomerLibrary/RnaBuilder/RnaEditor/RnaEditorExpanded/helpers/sequenceEdit.ts
Outdated
Show resolved
Hide resolved
if (groupName === MonomerGroups.BASES) { | ||
setIsDisabled(!item?.props?.MonomerCaps?.R1); | ||
} else if (groupName === MonomerGroups.PHOSPHATES) { | ||
setIsDisabled( | ||
!(item?.props?.MonomerCaps?.R1 && item?.props?.MonomerCaps?.R2), | ||
); | ||
} else if (groupName === MonomerGroups.SUGARS) { | ||
if (isSequenceFirstsOnlyNucleotidesSelected) { | ||
setIsDisabled( | ||
!(item?.props?.MonomerCaps?.R3 && item?.props?.MonomerCaps?.R2), | ||
); | ||
} else { | ||
setIsDisabled( | ||
!( | ||
item?.props?.MonomerCaps?.R3 && | ||
item?.props?.MonomerCaps?.R2 && | ||
item?.props?.MonomerCaps?.R1 | ||
), | ||
); | ||
} | ||
} | ||
}, [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we need to move the logic about which monomer item is valid for rna connection to ketcher-core package because probably we can use it in future for different purposes and places. I would propose to create a static method in Phosphate, RnaBase and Sugar classes which receives monomerItem and returns boolean.
packages/ketcher-macromolecules/src/components/contextMenu/SequenceItemContextMenu/helpers.ts
Outdated
Show resolved
Hide resolved
66319d6
to
3c29f3c
Compare
3c29f3c
to
edf94e6
Compare
How the feature works? / How did you fix the issue?
(Screenshots, videos, or GIFs, if applicable)
Check list
#1234 – issue name