Skip to content

Commit a6ee7e0

Browse files
authored
Address edit all review feedback
1 parent ba4bc6e commit a6ee7e0

3 files changed

Lines changed: 17 additions & 15 deletions

File tree

packages/ketcher-react/src/script/editor/Editor.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,19 @@ export type FinishNewMonomersCreationOptions = {
194194
phosphatePosition?: '3' | '5';
195195
};
196196

197+
type EditableSGroupMonomer = {
198+
monomer?: {
199+
monomerItem?: {
200+
label?: string;
201+
props?: {
202+
MonomerClass?: KetMonomerClass;
203+
MonomerCode?: string;
204+
MonomerName?: string;
205+
};
206+
};
207+
};
208+
};
209+
197210
class Editor implements KetcherEditor {
198211
ketcherId: string;
199212
#origin?: any;
@@ -1846,18 +1859,7 @@ class Editor implements KetcherEditor {
18461859
const newMonomer = monomersData[0].monomer;
18471860

18481861
finalStruct.sgroups.forEach((sgroup) => {
1849-
const sgroupWithMonomer = sgroup as {
1850-
monomer?: {
1851-
monomerItem?: {
1852-
label?: string;
1853-
props?: {
1854-
MonomerClass?: KetMonomerClass;
1855-
MonomerCode?: string;
1856-
MonomerName?: string;
1857-
};
1858-
};
1859-
};
1860-
};
1862+
const sgroupWithMonomer = sgroup as EditableSGroupMonomer;
18611863
const sgroupMonomer = sgroupWithMonomer.monomer;
18621864
const { props, label } = sgroupMonomer?.monomerItem ?? {};
18631865
const symbol = props?.MonomerCode ?? label;

packages/ketcher-react/src/script/ui/views/components/MonomerCreationWizard/MonomerCreationWizard.constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export const NotificationMessages: WizardNotificationMessageMap = {
8989
invalidPhosphatePositionAttachmentPoints:
9090
'3′ position requires phosphate R1 and sugar R2, 5′ position requires phosphate R2 and sugar R1.',
9191
phosphatePositionNotSelected:
92-
"You must chose the position of the phosphate (5' or 3').",
92+
"You must choose the position of the phosphate (5' or 3').",
9393
editAllPresetWarning: '',
9494
editAllPresetError: '',
9595
};

packages/ketcher-react/src/script/ui/views/components/MonomerCreationWizard/MonomerCreationWizard.utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const isNaturalAnalogueSupported = (
2121

2222
const getInitialValues = (
2323
monomer: BaseMonomer,
24-
shouldCopyValues: boolean,
24+
shouldAppendCopySuffix: boolean,
2525
): MonomerCreationInitialValues => {
2626
const { label, props } = monomer.monomerItem;
2727
const type = props.MonomerClass ?? KetMonomerClass.CHEM;
@@ -30,7 +30,7 @@ const getInitialValues = (
3030
const naturalAnalogue = isNaturalAnalogueSupported(type)
3131
? props.MonomerNaturalAnalogCode
3232
: '';
33-
const getValue = shouldCopyValues
33+
const getValue = shouldAppendCopySuffix
3434
? getCopiedValue
3535
: (value?: string) => value ?? '';
3636

0 commit comments

Comments
 (0)