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

#2246 Multiple bond editing changes bond types to all selected bonds #2352

Conversation

AnastasiiaPlyako
Copy link
Collaborator

closes #2246

@@ -155,6 +155,7 @@ export const bond = {
type: {
title: 'Type',
enum: [
'',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks strange

Copy link
Collaborator

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

Copy link
Collaborator Author

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 ''
Copy link
Collaborator

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? :)

Copy link
Collaborator Author

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.

@KonstantinEpam23 KonstantinEpam23 merged commit 3ea3c6b into master Apr 4, 2023
@KonstantinEpam23 KonstantinEpam23 deleted the #2246-multiple-bond-editing-changes-bond-types-to-all-selected-bonds branch April 4, 2023 08:43
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.

Multiple bond editing changes bond types to all selected bonds
4 participants