-
Notifications
You must be signed in to change notification settings - Fork 174
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
#2246 Multiple bond editing changes bond types to all selected bonds #2352
#2246 Multiple bond editing changes bond types to all selected bonds #2352
Conversation
@@ -155,6 +155,7 @@ export const bond = { | |||
type: { | |||
title: 'Type', | |||
enum: [ | |||
'', |
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.
Looks strange
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.
@AnastasiiaPlyako can you please comment on this
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.
Discussed with Konstantin. This field allows you to have an empty line when selected bonds have different types. The same logic is realized for atoms. https://github.com/epam/ketcher/blob/master/packages/ketcher-react/src/script/ui/data/schema/struct-schema.js#L62
@@ -232,7 +232,7 @@ function fromBondType(type, stereo) { | |||
) | |||
return caption | |||
} | |||
throw Error('No such bond caption') | |||
return '' |
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.
Could you please clarify, why this is needed? :)
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.
When types in bonds are different, we put an empty string. Method fromBondType return the corresponding type from the variable bondCaptionMap. But the empty line doesn't correspond to any of the types bondCaptionMap and throws the error, which stops the execution of the code.
closes #2246