Skip to content

Commit a1ac4ee

Browse files
authored
#9645 - Migrate to Indigo v1.43.0-rc.1 in-browser module (#9646)
* #9645 - Migrate to Indigo v1.43.0-rc.1 in-browser module * - fixed build * - fixed tests
1 parent e2bf06f commit a1ac4ee

File tree

8 files changed

+28
-24
lines changed

8 files changed

+28
-24
lines changed

ketcher-autotests/tests/specs/Chromium-popup/Bugs/ketcher-3.11.0-bugs.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,8 +838,8 @@ test.describe('Bugs: ketcher-3.11.0 — first trio', () => {
838838
);
839839
await CommonLeftToolbar(page).areaSelectionTool();
840840
await selectMonomersAndBonds(page, {
841-
monomerIds: [68, 69, 82, 83, 73, 76, 71, 72, 80, 79, 81, 84],
842-
bondIds: [97, 112, 115, 101, 102, 113, 114, 100, 111, 108, 104, 109],
841+
monomerIds: [68, 69, 82, 83, 73, 71, 72, 80, 79, 84],
842+
bondIds: [97, 112, 115, 101, 102, 113, 114, 100, 111, 108],
843843
});
844844
await ContextMenu(page, getMonomerLocator(page, { monomerId: 80 })).click(
845845
MonomerOption.ArrangeAsARing,

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ketcher-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ketcher-core",
3-
"version": "3.14.0-rc.1",
3+
"version": "3.15.0-rc.1",
44
"description": "Web-based molecule sketcher",
55
"license": "Apache-2.0",
66
"homepage": "http://lifescience.opensource.epam.com/ketcher",

packages/ketcher-macromolecules/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ketcher-macromolecules",
3-
"version": "3.14.0-rc.1",
3+
"version": "3.15.0-rc.1",
44
"description": "Web-based molecule sketcher",
55
"license": "Apache-2.0",
66
"homepage": "http://lifescience.opensource.epam.com/ketcher",

packages/ketcher-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ketcher-react",
3-
"version": "3.14.0-rc.1",
3+
"version": "3.15.0-rc.1",
44
"description": "Web-based molecule sketcher",
55
"license": "Apache-2.0",
66
"homepage": "http://lifescience.opensource.epam.com/ketcher",

packages/ketcher-react/src/script/ui/dialog/toolbox/labeledit.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import Form, { Field } from '../../component/form/form/form';
1818

19-
import { Dialog } from '../../views/components';
19+
import { Dialog } from 'components';
2020
import { Elements } from 'ketcher-core';
2121
import { capitalize } from 'lodash/fp';
2222
import { connect } from 'react-redux';
@@ -58,11 +58,13 @@ export function serialize(lc: AtomLabelData): string {
5858
}
5959

6060
const LABEL_REGEX = /^(\d+)?([a-z*]{1,3})(\.|:|\^\^)?(\d+[-+]|[-+])?$/i;
61-
const VALID_GENERIC_LABELS = ['A', 'Q', 'X', 'M'];
61+
const VALID_GENERIC_LABELS = new Set(['A', 'Q', 'X', 'M']);
62+
63+
const isValidLabel = (value: string): boolean => deserialize(value) !== null;
6264

6365
function parseCharge(chargeStr: string): number {
64-
let charge = parseInt(chargeStr);
65-
if (isNaN(charge)) {
66+
let charge = Number.parseInt(chargeStr, 10);
67+
if (Number.isNaN(charge)) {
6668
charge = 1;
6769
}
6870
if (chargeStr.endsWith('-')) {
@@ -78,11 +80,13 @@ export function deserialize(value: string): AtomLabelData | null {
7880
}
7981

8082
const label = match[2] === '*' ? 'A' : capitalize(match[2]);
81-
const isotope: number | null = match[1] ? parseInt(match[1]) : null;
83+
const isotope: number | null = match[1]
84+
? Number.parseInt(match[1], 10)
85+
: null;
8286
const radical = match[3] ? { ':': 1, '.': 2, '^^': 3 }[match[3]] ?? 0 : 0;
8387
const charge: number | null = match[4] ? parseCharge(match[4]) : null;
8488

85-
if (VALID_GENERIC_LABELS.includes(label) || Elements.get(label)) {
89+
if (VALID_GENERIC_LABELS.has(label) || Elements.get(label)) {
8690
return { label, charge, isotope, radical };
8791
}
8892

@@ -109,16 +113,16 @@ function LabelEdit(props: Readonly<LabelEditProps>) {
109113
>
110114
<Form
111115
schema={labelEditSchema}
112-
customValid={{ label: (l: string) => deserialize(l) }}
116+
customValid={{ label: isValidLabel }}
113117
init={init}
114118
{...formState}
115119
>
116120
<Field
117121
name="label"
118122
maxLength={20}
119-
// @ts-expect-error FieldProps missing size and autoFocus (defined in FieldWithModalProps)
123+
// @ts-expect-error FieldProps missing size and isFocused (passed through to Input)
120124
size="10"
121-
autoFocus
125+
isFocused
122126
className={styles.labelEditInputField}
123127
/>
124128
</Form>

packages/ketcher-standalone/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ketcher-standalone",
3-
"version": "3.14.0-rc.1",
3+
"version": "3.15.0-rc.1",
44
"description": "Web-based molecule sketcher",
55
"license": "Apache-2.0",
66
"homepage": "http://lifescience.opensource.epam.com/ketcher",
@@ -42,7 +42,7 @@
4242
},
4343
"dependencies": {
4444
"@babel/runtime": "^7.26.10",
45-
"indigo-ketcher": "1.43.0-dev.2",
45+
"indigo-ketcher": "1.43.0-rc.1",
4646
"ketcher-core": "*"
4747
},
4848
"devDependencies": {

0 commit comments

Comments
 (0)