Skip to content

Commit

Permalink
#5842-info-button-i-for-some-properties-at-settings (#5912)
Browse files Browse the repository at this point in the history
* 5842-info-button-i-for-some-properties-at-settings

* updated tests

* change layout and update snapshot

* updated test

* updated tests

* merge

* add tooltip for after, updated tests

* changes part 2

* tests update

* update tests

* update tests

* Revert specific files to previous state

* Revert specific files to previous state

* Revert specific files to previous state

* format

---------

Co-authored-by: Andrey Menshikov <andrey.menshikov@bostongene.com>
  • Loading branch information
Drimodaren and Andrey Menshikov authored Nov 12, 2024
1 parent 168e713 commit 0bb3715
Show file tree
Hide file tree
Showing 78 changed files with 45 additions and 6 deletions.
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.
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.
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.
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.
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.
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.
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 @@ -34,7 +34,8 @@ async function applyIgnoreChiralFlag(page: Page) {
await page
.locator('label')
.filter({ hasText: 'Ignore the chiral flag' })
.locator('div span')
.locator('div >> span, span')
.first()
.click();
await pressButton(page, 'Apply');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ test.describe('Right-click menu', () => {
await page
.locator('label')
.filter({ hasText: 'Ignore the chiral flag' })
.locator('div span')
.locator('div >> span, span')
.first()
.click();
await pressButton(page, 'Apply');
await takeEditorScreenshot(page);
Expand Down
38 changes: 34 additions & 4 deletions packages/ketcher-react/src/script/ui/component/form/form/form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import { getSelectOptionsFromSchema } from '../../../utils';
import { updateFormState } from '../../../state/modal/form';
import { useFormContext } from '../../../../../hooks';
import { cloneDeep } from 'lodash';
import { IconButton } from 'components';
import { Icon, IconButton } from 'components';
import { Tooltip } from '@mui/material';

class Form extends Component {
constructor(props) {
Expand Down Expand Up @@ -112,17 +113,46 @@ export default connect(null, (dispatch) => ({

function Label({ labelPos, title, children, ...props }) {
const tooltip = props.tooltip ? props.tooltip : null;

return (
<label {...props}>
{title && labelPos !== 'after' ? (
<span title={tooltip}>{title}</span>
tooltip ? (
<div
className={clsx({
[classes.divWithTooltipAndAboutIcon]: true,
})}
>
<span>{title}</span>
<Tooltip title={tooltip}>
<div>
<Icon name="about"></Icon>
</div>
</Tooltip>
</div>
) : (
<span>{title}</span>
)
) : (
''
)}
{children}
{title && labelPos === 'after' ? (
<span title={tooltip}>{title}</span>
tooltip ? (
<div
className={clsx({
[classes.divWithTooltipAndAboutIcon]: true,
})}
>
<Tooltip title={tooltip}>
<div>
<Icon name="about"></Icon>
</div>
</Tooltip>
<span>{title}</span>
</div>
) : (
<span>{title}</span>
)
) : (
''
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,10 @@
min-height: 16px;
}
}

.divWithTooltipAndAboutIcon{
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}

0 comments on commit 0bb3715

Please sign in to comment.