-
Notifications
You must be signed in to change notification settings - Fork 176
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
#4554 - Support variant monomers in Ketcher (flex mode) #5314
Conversation
f0c324b
to
90c15a1
Compare
- added variant monomers to model/view and deserialization
- temporary skipped tests
501a583
to
5887048
Compare
templateId: string; | ||
} | ||
|
||
export interface IKetGroupNode { | ||
type: 'group'; | ||
export interface IKetVariantMonomerNode { |
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 guess it would be nice to have some common interface to encapsulate id
, position
and other common fields and IKetMonomerNode
and IKetVariantMonomerNode
to extend them with a particular type
@@ -160,7 +191,11 @@ export interface IKetMacromoleculesContentRootProperty { | |||
} | |||
|
|||
export interface IKetMacromoleculesContentOtherProperties { | |||
[key: string]: KetNode | IKetMonomerTemplate | IKetMonomerGroupTemplate; | |||
[key: string]: |
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.
Nitpicking, but { [key: string]: something } might be replaced with Record<string, _something>
@@ -23,7 +25,7 @@ export class Sugar extends BaseMonomer { | |||
} | |||
|
|||
private getValidPoint( | |||
otherMonomer: BaseMonomer, | |||
otherMonomer: BaseMonomer & IVariantMonomer, |
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.
This types intersection is used here and other files few times, maybe it makes sense to separate it into some util type?
return _monomer; | ||
} | ||
|
||
const monomer = new VariantMonomer(variantMonomerItem, position); |
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.
Maybe it's worth having some method to create variant monomer without changes in model which I implemented recently? Look for createMonomer
method within this class
- added variant monomers to model/view and serialization/deserialization
How the feature works? / How did you fix the issue?
Check list
#1234 – issue name