Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#5152 - Add new settings for ACS style #5356

Merged
merged 5 commits into from
Aug 26, 2024
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 @@ -518,7 +518,7 @@ test.describe('Enhanced Stereochemistry Tool', () => {
Description: “IUPAC style” in Label display at stereogenic centers is selected by default.
*/
const deltaX = 0;
const deltaY = 50;
const deltaY = 100;
await selectTopPanelButton(TopPanelButton.Settings, page);
await page.getByText('Stereochemistry', { exact: true }).click();
await page.mouse.wheel(deltaX, deltaY);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ async function setAtomAndBondSettings(page: Page) {
.locator('fieldset')
.filter({ hasText: 'Aromatic Bonds as' })
.getByRole('textbox')
.nth(1)
.nth(2)
.click();
await page
.locator('fieldset')
.filter({ hasText: 'Aromatic Bonds as' })
.getByRole('textbox')
.nth(1)
.nth(2)
.fill('05');
await page.getByTestId('OK').click();
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ import {

async function generalDefaultSettings(page: Page) {
await selectTopPanelButton(TopPanelButton.Settings, page);
const deltaX = 0;
const deltaY = 150;
const anyX = 638;
const anyY = 524;
await page.mouse.move(anyX, anyY);
await page.mouse.wheel(deltaX, deltaY);
await page.getByTestId('General-accordion').click();
}

async function resetSelectToolOff(page: Page) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions packages/ketcher-react/src/script/ui/data/schema/options-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export enum MeasurementUnits {
Inch = 'inch',
}

export enum ImageResolution {
high = '600',
low = '72',
}

const editor: {
resetToSelect: ExtendedSchema;
rotationStep: ExtendedSchema;
Expand Down Expand Up @@ -85,6 +90,13 @@ const render: {
bondThicknessUnit: ExtendedSchema;
stereoBondWidth: ExtendedSchema;
stereoBondWidthUnit: ExtendedSchema;
bondLength: ExtendedSchema;
bondLengthUnit: ExtendedSchema;
reactionComponentMarginSize: ExtendedSchema;
reactionComponentMarginSizeUnit: ExtendedSchema;
hashSpacing: ExtendedSchema;
hashSpacingUnit: ExtendedSchema;
imageResolution: ExtendedSchema;
} = {
showValenceWarnings: {
title: 'Show valence warnings',
Expand Down Expand Up @@ -275,6 +287,51 @@ const render: {
enumNames: Object.values(MeasurementUnits),
default: MeasurementUnits.Px,
},
bondLength: {
title: 'Bond length',
type: 'number',
default: 2.1,
minimum: 1,
maximum: 96,
},
bondLengthUnit: {
title: 'Bond length unit',
enum: Object.values(MeasurementUnits),
enumNames: Object.values(MeasurementUnits),
default: MeasurementUnits.Px,
},
reactionComponentMarginSize: {
title: 'Reaction component margin size',
type: 'number',
default: 2.3,
minimum: 1,
maximum: 96,
},
reactionComponentMarginSizeUnit: {
title: 'Reaction component margin size unit',
enum: Object.values(MeasurementUnits),
enumNames: Object.values(MeasurementUnits),
default: MeasurementUnits.Px,
},
hashSpacing: {
title: 'Hash spacing',
type: 'number',
default: 2.2,
minimum: 1,
maximum: 96,
},
hashSpacingUnit: {
title: 'Hash spacing unit',
enum: Object.values(MeasurementUnits),
enumNames: Object.values(MeasurementUnits),
default: MeasurementUnits.Px,
},
imageResolution: {
title: 'Image resolution',
enum: Object.values(ImageResolution),
enumNames: Object.keys(ImageResolution),
default: ImageResolution.low,
},
};

const server: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const Accordion = ({ tabs, className, changedGroups }): React.ReactElement => {
<div
onClick={handleAccordionChange(label)}
className={classes.accordionSummaryWrapper}
data-testid={`${label}-accordion`}
>
<div className={classes.accordionSummary}>
<Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,17 @@ const SettingsDialog = (props: Props) => {
labelPos={false}
extraName="fontszsubUnit"
/>
<Field
name="reactionComponentMarginSize"
component={MeasureInput}
labelPos={false}
extraName="reactionComponentMarginSizeUnit"
/>
<Field
name="imageResolution"
component={Select}
options={getSelectOptionsFromSchema(settingsProps?.imageResolution)}
/>
</fieldset>
),
};
Expand Down Expand Up @@ -228,6 +239,12 @@ const SettingsDialog = (props: Props) => {
content: (
<fieldset>
<Field name="aromaticCircle" />
<Field
name="bondLength"
component={MeasureInput}
labelPos={false}
extraName="bondLengthUnit"
/>
<Field
name="doubleBondWidth"
component={MeasureInput}
Expand All @@ -246,6 +263,12 @@ const SettingsDialog = (props: Props) => {
labelPos={false}
extraName="stereoBondWidthUnit"
/>
<Field
name="hashSpacing"
component={MeasureInput}
labelPos={false}
extraName="hashSpacingUnit"
/>
</fieldset>
),
};
Expand Down
Loading