diff --git a/packages/ketcher-core/src/application/editor/tools/Bond.ts b/packages/ketcher-core/src/application/editor/tools/Bond.ts index 93a7982115..2f95eff83d 100644 --- a/packages/ketcher-core/src/application/editor/tools/Bond.ts +++ b/packages/ketcher-core/src/application/editor/tools/Bond.ts @@ -28,6 +28,7 @@ import { Coordinates } from '../shared/coordinates'; import { AttachmentPointName } from 'domain/types'; import { AttachmentPoint } from 'domain/AttachmentPoint'; import { Command } from 'domain/entities/Command'; +import { UnresolvedMonomer } from "domain/entities"; class PolymerBond implements BaseTool { private bondRenderer?: PolymerBondRenderer; @@ -493,6 +494,14 @@ class PolymerBond implements BaseTool { return true; } + // Modal: Any or both monomers are unresolved + if ( + firstMonomer instanceof UnresolvedMonomer || + secondMonomer instanceof UnresolvedMonomer + ) { + return true; + } + // Modal: One monomer is Peptide and another is RNA monomer const rnaMonomerClasses = [Sugar, RNABase, Phosphate]; const firstMonomerIsRNA = rnaMonomerClasses.find( diff --git a/packages/ketcher-core/src/domain/entities/UnresolvedMonomer.ts b/packages/ketcher-core/src/domain/entities/UnresolvedMonomer.ts index b6b6611f11..c3314fc02f 100644 --- a/packages/ketcher-core/src/domain/entities/UnresolvedMonomer.ts +++ b/packages/ketcher-core/src/domain/entities/UnresolvedMonomer.ts @@ -2,14 +2,15 @@ import { BaseMonomer } from './BaseMonomer'; import { ChemSubChain } from 'domain/entities/monomer-chains/ChemSubChain'; import { PeptideSubChain } from 'domain/entities/monomer-chains/PeptideSubChain'; import { SubChainNode } from 'domain/entities/monomer-chains/types'; +import { Peptide } from 'domain/entities/Peptide'; export class UnresolvedMonomer extends BaseMonomer { - public getValidSourcePoint(_monomer?: BaseMonomer) { - return undefined; + public getValidSourcePoint(monomer?: BaseMonomer) { + return Peptide.prototype.getValidSourcePoint.call(this, monomer); } - public getValidTargetPoint(_monomer: BaseMonomer) { - return undefined; + public getValidTargetPoint(monomer: BaseMonomer) { + return Peptide.prototype.getValidTargetPoint.call(this, monomer); } public get SubChainConstructor() {