Skip to content
Merged
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 @@ -838,8 +838,8 @@ test.describe('Bugs: ketcher-3.11.0 — first trio', () => {
);
await CommonLeftToolbar(page).areaSelectionTool();
await selectMonomersAndBonds(page, {
monomerIds: [68, 69, 82, 83, 73, 76, 71, 72, 80, 79, 81, 84],
bondIds: [97, 112, 115, 101, 102, 113, 114, 100, 111, 108, 104, 109],
monomerIds: [68, 69, 82, 83, 73, 71, 72, 80, 79, 84],
bondIds: [97, 112, 115, 101, 102, 113, 114, 100, 111, 108],
});
await ContextMenu(page, getMonomerLocator(page, { monomerId: 80 })).click(
MonomerOption.ArrangeAsARing,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ketcher-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ketcher-core",
"version": "3.14.0-rc.1",
"version": "3.15.0-rc.1",
"description": "Web-based molecule sketcher",
"license": "Apache-2.0",
"homepage": "http://lifescience.opensource.epam.com/ketcher",
Expand Down
2 changes: 1 addition & 1 deletion packages/ketcher-macromolecules/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ketcher-macromolecules",
"version": "3.14.0-rc.1",
"version": "3.15.0-rc.1",
"description": "Web-based molecule sketcher",
"license": "Apache-2.0",
"homepage": "http://lifescience.opensource.epam.com/ketcher",
Expand Down
2 changes: 1 addition & 1 deletion packages/ketcher-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ketcher-react",
"version": "3.14.0-rc.1",
"version": "3.15.0-rc.1",
"description": "Web-based molecule sketcher",
"license": "Apache-2.0",
"homepage": "http://lifescience.opensource.epam.com/ketcher",
Expand Down
22 changes: 13 additions & 9 deletions packages/ketcher-react/src/script/ui/dialog/toolbox/labeledit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

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

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

const LABEL_REGEX = /^(\d+)?([a-z*]{1,3})(\.|:|\^\^)?(\d+[-+]|[-+])?$/i;
const VALID_GENERIC_LABELS = ['A', 'Q', 'X', 'M'];
const VALID_GENERIC_LABELS = new Set(['A', 'Q', 'X', 'M']);

const isValidLabel = (value: string): boolean => deserialize(value) !== null;

function parseCharge(chargeStr: string): number {
let charge = parseInt(chargeStr);
if (isNaN(charge)) {
let charge = Number.parseInt(chargeStr, 10);
if (Number.isNaN(charge)) {
charge = 1;
}
if (chargeStr.endsWith('-')) {
Expand All @@ -78,11 +80,13 @@ export function deserialize(value: string): AtomLabelData | null {
}

const label = match[2] === '*' ? 'A' : capitalize(match[2]);
const isotope: number | null = match[1] ? parseInt(match[1]) : null;
const isotope: number | null = match[1]
? Number.parseInt(match[1], 10)
: null;
const radical = match[3] ? { ':': 1, '.': 2, '^^': 3 }[match[3]] ?? 0 : 0;
const charge: number | null = match[4] ? parseCharge(match[4]) : null;

if (VALID_GENERIC_LABELS.includes(label) || Elements.get(label)) {
if (VALID_GENERIC_LABELS.has(label) || Elements.get(label)) {
return { label, charge, isotope, radical };
}

Expand All @@ -109,16 +113,16 @@ function LabelEdit(props: Readonly<LabelEditProps>) {
>
<Form
schema={labelEditSchema}
customValid={{ label: (l: string) => deserialize(l) }}
customValid={{ label: isValidLabel }}
init={init}
{...formState}
>
<Field
name="label"
maxLength={20}
// @ts-expect-error FieldProps missing size and autoFocus (defined in FieldWithModalProps)
// @ts-expect-error FieldProps missing size and isFocused (passed through to Input)
size="10"
autoFocus
isFocused
className={styles.labelEditInputField}
/>
</Form>
Expand Down
4 changes: 2 additions & 2 deletions packages/ketcher-standalone/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ketcher-standalone",
"version": "3.14.0-rc.1",
"version": "3.15.0-rc.1",
"description": "Web-based molecule sketcher",
"license": "Apache-2.0",
"homepage": "http://lifescience.opensource.epam.com/ketcher",
Expand Down Expand Up @@ -42,7 +42,7 @@
},
"dependencies": {
"@babel/runtime": "^7.26.10",
"indigo-ketcher": "1.43.0-dev.2",
"indigo-ketcher": "1.43.0-rc.1",
"ketcher-core": "*"
},
"devDependencies": {
Expand Down
Loading