forked from ComPlat/chemotion_ELN
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Ketcher2 Common Templates, User Templates & User settings (ComP…
…lat#2061) * User is provided with a list of global/common templates to use in the ketcher2. * Ketcher2 setting are stored for each user as preferences for later effects. * User templates available to be used within Ketcher2. --------- Co-authored-by: PiTrem <[email protected]>
- Loading branch information
Showing
22 changed files
with
1,003 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,5 +20,5 @@ | |
"username": "postgres", | ||
"password": "" | ||
} | ||
], | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Ketcher2 Integration | ||
|
||
This guide will help you integrate Ketcher2 into your project. Follow the steps below to ensure a smooth setup. | ||
|
||
## Prerequisites | ||
|
||
1. Ensure you have `jq` installed on your system: | ||
```bash | ||
sudo apt install jq | ||
``` | ||
|
||
## Installation Steps | ||
|
||
### 1. Add Ketcher2 Files | ||
|
||
- Run the installation script (Choose one script based on release requried): | ||
|
||
1- fetching build assets from github release | ||
|
||
```bash | ||
✅ bin/chem-ket2-install.sh -s epam/[email protected] | ||
``` | ||
|
||
2- building from src at v2.22.0-rc.9 | ||
```bash | ||
✅ bin/chem-ket2-install.sh -b -s epam/[email protected] | ||
``` | ||
|
||
|
||
### 2. Restart Your Server/Container | ||
|
||
- After completing the above steps, restart your server or container to apply the changes. | ||
|
||
### 4. Configure User Access | ||
|
||
- Ensure that Ketcher2 is allowed for the user(s) by the admin. This step is necessary to provide appropriate access permissions. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.ketcher-template-item { | ||
display: flex; | ||
align-items: center; | ||
padding: 5px; | ||
border-radius: 5px; | ||
} | ||
|
||
.ketcher-template-item:hover { | ||
background-color: #ebf5ff; | ||
cursor: pointer; | ||
} | ||
|
||
.ketcher-select-common-template { | ||
background-color: #fff; | ||
border-color: #d9d9d9 #ccc #b3b3b3; | ||
border-radius: 4px; | ||
border: 1px solid #ccc; | ||
color: #333; | ||
cursor: default; | ||
display: table; | ||
height: 36px; | ||
width: 100%; | ||
padding: 7px 0 5px 5px; | ||
position: relative; | ||
} | ||
|
||
.select-template-badge { | ||
position: absolute; | ||
right: 10px; | ||
top: 5px; | ||
} | ||
|
||
.common-template-header { | ||
display: flex; | ||
align-items: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
app/packs/src/components/ketcher-templates/CommonTemplateItem.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
|
||
function CommonTemplateItem(props) { | ||
const { item, onClickItem } = props; | ||
return ( | ||
<div className="ketcher-template-item" onClick={() => onClickItem(item)}> | ||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="css-uwwqev"><path d="M8.75 3.75h-5v5h1.5V6.312L9 10.063l1-1.124L6.312 5.25H8.75v-1.5zM15.25 3.75h5v5h-1.5V6.312L15 10.063l-1-1.124 3.688-3.688H15.25v-1.5zM15.25 20.25h5v-5h-1.5v2.438L15 13.938l-1 1.124 3.688 3.688H15.25v1.5zM8.75 20.25h-5v-5h1.5v2.438L9 13.938l1 1.124-3.688 3.688H8.75v1.5z" fill="currentColor"></path></svg> | ||
<h4 style={{ marginLeft: 15 }}> | ||
{item?.name} | ||
</h4> | ||
</div> | ||
); | ||
} | ||
|
||
export default CommonTemplateItem; | ||
|
||
CommonTemplateItem.propTypes = { | ||
// eslint-disable-next-line react/forbid-prop-types | ||
item: PropTypes.object.isRequired, | ||
onClickItem: PropTypes.func.isRequired | ||
}; |
Oops, something went wrong.