Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
takeEditorScreenshot,
openFileAndAddToCanvas,
pasteFromClipboardAndAddToCanvas,
openPasteFromClipboard,
copyToClipboardByKeyboard,
openFileAndAddToCanvasAsNewProject,
readFileContent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
pasteFromClipboardAndAddToMacromoleculesCanvas,
MacroFileType,
} from '@utils';
import { closeOpenStructure, pageReload } from '@utils/common/helpers';
import { pageReload } from '@utils/common/helpers';
import { verifyHELMExport } from '@utils/files/receiveFileComparisonData';
import { ErrorMessageDialog } from '@tests/pages/common/ErrorMessageDialog';
import { OpenStructureDialog } from '@tests/pages/common/OpenStructureDialog';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
waitForPageInit,
} from '@utils';
import { selectAllStructuresOnCanvas } from '@utils/canvas/selectSelection';
import { closeOpenStructure, pageReload } from '@utils/common/helpers';
import { pageReload } from '@utils/common/helpers';
import {
FileType,
verifyFileExport,
Expand Down
1 change: 0 additions & 1 deletion ketcher-autotests/tests/utils/common/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Page } from '@playwright/test';
import { waitForKetcherInit } from './loaders/waitForKetcherInit/waitForKetcherInit';
import { waitForIndigoToLoad } from './loaders/waitForIndigoToLoad';
import { OpenStructureDialog } from '@tests/pages/common/OpenStructureDialog';

export async function emptyFunction() {
// Intentionally empty callback used as a default async no-op in wait helpers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,24 +177,26 @@ export const getModifyAminoAcidsMenuItems = (
}

modificationTypes.forEach((modificationType) => {
// If modification does not have R1 or R2 attachment points to persist connection
// Check if all monomers in this group already have this modification
if (
monomersWithSameNaturalAnalogCode.some(
(monomer: BaseMonomer) =>
monomer.label !== monomerLibraryItem.label &&
!canModifyAminoAcid(monomer, monomerLibraryItem),
monomersWithSameNaturalAnalogCode.every(
(monomer) => monomer.label === monomerLibraryItem.label,
)
) {
modificationTypesDisabledByAttachmentPoints.add(modificationType);

return;
}

if (
monomersWithSameNaturalAnalogCode.every(
(monomer) => monomer.label === monomerLibraryItem.label,
)
) {
// Check if at least one monomer in this group can be modified
const hasAtLeastOneEligibleMonomer =
monomersWithSameNaturalAnalogCode.some(
(monomer: BaseMonomer) =>
monomer.label !== monomerLibraryItem.label &&
canModifyAminoAcid(monomer, monomerLibraryItem),
);

// If NO monomer is eligible, disable this modification
if (!hasAtLeastOneEligibleMonomer) {
modificationTypesDisabledByAttachmentPoints.add(modificationType);
return;
}

Expand Down
Loading