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

feat: Ket2 solid phase support #2230

Draft
wants to merge 154 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
0727248
draft: ketcher editor subscription
haditariq Aug 29, 2024
c780937
image drop position captured
haditariq Aug 29, 2024
d4b3eb8
chore: show alias for atom R#
haditariq Aug 30, 2024
e4128c0
ketcher editor events
haditariq Sep 18, 2024
de89346
draft: ketcher editor subscription
haditariq Aug 29, 2024
7bf6131
image drop position captured
haditariq Aug 29, 2024
028db03
chore: show alias for atom R#
haditariq Aug 30, 2024
716ca78
ketcher editor events
haditariq Sep 18, 2024
5077e6c
Merge branch 'ketcher-surface-chemistry' of https://github.com/ComPla…
haditariq Sep 18, 2024
86b79ae
chore: static combo drag ratom with image/template
haditariq Sep 19, 2024
bcc1fc6
chore: atom, image binding with global store
haditariq Sep 19, 2024
8adb841
chore: multiple shapes with extra rgoup case
haditariq Sep 19, 2024
6eb8bda
code restructured
haditariq Sep 20, 2024
986b563
chore: on add image remove bonds to avoid alias modal issue
haditariq Sep 20, 2024
ce3fa8e
refac: atom location update with selected image without loop
haditariq Sep 20, 2024
563cbf8
chore: editor selection atttibute used for identification
haditariq Sep 20, 2024
5f06181
fix: remove bonds on atom add with image
haditariq Sep 20, 2024
94a232f
fix: remove bonds on atom add with image
haditariq Sep 20, 2024
100301d
fix: revert to loop approach for moving a connection
haditariq Sep 20, 2024
3f34ba4
feat: alias-atom position on image resize
haditariq Sep 20, 2024
e32ef4b
chore: template resize
haditariq Sep 23, 2024
d48eccf
implementation with stack FILO approach
haditariq Sep 23, 2024
f903579
feat: atom place with image on correct coordinates done
haditariq Sep 25, 2024
139658f
chore: multi template binded movement
haditariq Sep 25, 2024
486dfb6
feat: compatible with other atoms on canvas
haditariq Sep 25, 2024
80b720e
feat: dynamic atom location synced with atom with alias
haditariq Sep 26, 2024
771eb08
fix: template place on add atom
haditariq Sep 26, 2024
1b05ed4
feat: image resize sync with template
haditariq Sep 26, 2024
7dd8968
feat: on atom move stick to template
haditariq Sep 26, 2024
0cd84fa
feat: if canvas has no image dont reset
haditariq Sep 26, 2024
e8ec4f8
chore: on direct attachment counter and image randmon place fixed
haditariq Sep 27, 2024
09622ae
multi templates movement; post_atom is running is step behind
haditariq Sep 27, 2024
512be7d
fix: add template on direct add
haditariq Sep 30, 2024
24b331d
fix: direction add template to atom with correct image
haditariq Sep 30, 2024
645fb80
fix: image count with direct atom mol
haditariq Sep 30, 2024
cf03d7c
fix: location for image to atom muted
haditariq Sep 30, 2024
9916b08
fix: atoms R check
haditariq Sep 30, 2024
9bee2a3
fix: move temaplte to center after atom add
haditariq Oct 1, 2024
e706909
feat: new template bond and atom slice as clean up
haditariq Oct 1, 2024
fea6b8e
feat: canvas should not update on other atom movements unless its a s…
haditariq Oct 1, 2024
c52365c
code clean
haditariq Oct 1, 2024
db76489
feat: movetemplate on cleanup usin DOM manipulation
haditariq Oct 1, 2024
3e84e80
feat: mutation observers for cleanup and clear canvas added
haditariq Oct 2, 2024
d6b6a42
chore: DOM events refactored
haditariq Oct 2, 2024
0e74616
chore: image delete not possible
haditariq Oct 2, 2024
d5be04f
feat: delete template working for single bonds
haditariq Oct 7, 2024
59f86e0
feat: delete with single and multi bonds
haditariq Oct 8, 2024
0ffa90d
feat: delete with bonds and only atom, with user_inage_couter sync
haditariq Oct 9, 2024
7c43234
fix: image used counter fixed based on remove atoms count
haditariq Oct 9, 2024
0edb6e7
feat: refresh canvas on layout
haditariq Oct 9, 2024
e52b730
draft: image replacement function added
haditariq Oct 10, 2024
344c49f
feat: delete template
haditariq Oct 10, 2024
3532537
feat: hide template text and add re-layer images
haditariq Oct 10, 2024
a3904df
chore: flags for hidding feature
haditariq Oct 10, 2024
352b311
chore: templates replace with Br -> A(R#)
haditariq Oct 11, 2024
43b8a95
chore: serialized svg, mofile prepared
haditariq Oct 11, 2024
7ec1f67
feat: import molfile wit K2SC data
haditariq Oct 14, 2024
c5a6c25
refactor: mofile import/export compatibility
haditariq Oct 15, 2024
dad8c75
chore: tail-data prepared from ketcherrails formate to ketcher2 molfiel
haditariq Oct 15, 2024
e9774a9
draft: ketcher rails switch opening showing shapes
haditariq Oct 16, 2024
e64d48e
feat: reading molfile to show image with correct alias sources from k…
haditariq Oct 16, 2024
abe31da
feat: shapes synced with ketcher rails
haditariq Oct 16, 2024
c6d5e4b
feat: ketcherrails to ketcher2 shape+bonds
haditariq Oct 17, 2024
730c1d9
chore: standard size defined for shapes
haditariq Oct 17, 2024
f1d6c62
draft: adding polymer images to svg
haditariq Oct 17, 2024
9ddb33a
chore: svg svg with editor save
haditariq Oct 17, 2024
3ad1192
fix: loofah image tag allowed for sanitization, shapes display rails-…
haditariq Oct 18, 2024
105a0c8
feat: custom-user-template compatible with k2SC shapes
haditariq Oct 21, 2024
86bc986
on add atom alias fixed for 3 places
haditariq Oct 21, 2024
6d9770a
fix: 2 part_part with/withour molecule
haditariq Oct 22, 2024
d134813
fix: usage of user template with image templates
haditariq Oct 23, 2024
ccea590
fix: first template image case
haditariq Oct 23, 2024
05c8d5f
refac
haditariq Oct 23, 2024
97cde86
temp: redo, undo and erase button disabled
haditariq Oct 23, 2024
5cfc619
refactor: molfile pre-processors, flags, helper function for handleAd…
haditariq Oct 24, 2024
9a1eb3a
refactor: templates source
haditariq Oct 24, 2024
b1151d5
refactor: delete template and restore image-counters
haditariq Oct 24, 2024
d1b210b
refactor: DOM > images update flags setter & getters
haditariq Oct 24, 2024
f71b71d
refactor: tags polymer identifiers
haditariq Oct 24, 2024
64cae9f
refactor: event-handler and event-fire for ketcher2 changes
haditariq Oct 24, 2024
134db42
refactor: ketcher button events
haditariq Oct 24, 2024
7ba463b
molecule file reset
haditariq Oct 24, 2024
62348ee
refactor: template list for local storage
haditariq Oct 24, 2024
9f9ffaf
fix: file with no polyer main cb
haditariq Oct 24, 2024
607a90d
fix: clean canvas use-cases
haditariq Oct 24, 2024
1c7ff1d
draft: counter issue with canvas is new
haditariq Oct 24, 2024
a6bb4d6
fix: addHandleAtom with seen_third_parts, avoiding duplicates for ima…
haditariq Oct 25, 2024
2a17dca
chore: template force alias modification removed
haditariq Oct 25, 2024
7add071
fix: used_image_counter updated with already_processed item -> before…
haditariq Oct 25, 2024
c7b3d17
refactor: add handle atom
haditariq Oct 25, 2024
ad86f71
code clean
haditariq Oct 28, 2024
53d0f26
code clean
haditariq Oct 28, 2024
a4c9294
surface shape size changed && image selection action overide
haditariq Oct 28, 2024
cd1d488
Merge branch 'ketcher-surface-chemistry' of https://github.com/ComPla…
haditariq Oct 28, 2024
b1311c2
chore: hide extra attributes for user templates list
haditariq Oct 28, 2024
807bb44
fix: image delete overide, t_02 template size changed
haditariq Oct 28, 2024
3825249
fix: delete linked image on delete atom
haditariq Oct 28, 2024
cd3dcbd
fix: addAtomHandle > add image with its a three_part and already pro…
haditariq Oct 29, 2024
e0a62ea
draft: removal of linked atom with image on image delete
haditariq Oct 29, 2024
cde1e55
fix: on delete image re-sync counters and delete atom
haditariq Oct 30, 2024
d9ba846
update: movetemaplte on H add/remove button
haditariq Oct 30, 2024
3be02ac
fix: contant image size on layout and on all actions
haditariq Oct 30, 2024
806764b
feat: redo & undo features
haditariq Oct 30, 2024
2d5686a
feat: redo and undo
haditariq Oct 30, 2024
588df91
fix: resetsore on reset canvas action
haditariq Oct 30, 2024
97ace02
fix: multiple move atoms makes add atom disable
haditariq Oct 31, 2024
0e27919
fix: add image-template to a mol
haditariq Oct 31, 2024
82b6e97
fix: multi template delete, remove atom with image delete and vice versa
haditariq Oct 31, 2024
598cb87
update: delete working with multi images, single atom with alias, or …
haditariq Nov 4, 2024
68e2891
clear usertemplate extra snippets
haditariq Nov 4, 2024
394a5a3
fix:event: delete image
haditariq Nov 6, 2024
bc6390c
fix: delete with image or delete with selection or delete with atom
haditariq Nov 6, 2024
f4fdc96
fix: image movement after delete
haditariq Nov 6, 2024
d73955f
clear store on delet atom
haditariq Nov 6, 2024
866f86c
draft:refactor
haditariq Nov 7, 2024
97985b0
fix: delete image && delete atom working together
haditariq Nov 8, 2024
df85072
code clean
haditariq Nov 8, 2024
a25abc7
refac: savemolfile
haditariq Nov 8, 2024
f87c2a1
fix: atom movement sync
haditariq Nov 11, 2024
ab612c0
draft: sb/schema.rb rebase
haditariq Nov 11, 2024
71f17cd
refac: scrubber, svf-processor
haditariq Nov 11, 2024
e18e344
Test+Refactoring: reading molfile with/without polymers; test for has…
haditariq Nov 12, 2024
f52fa07
test: setKetcherdata
haditariq Nov 12, 2024
7a4d3f5
test: hasKetcherdata, setKetcherdata
haditariq Nov 13, 2024
ee7024c
refactoring: onTemplateMove
haditariq Nov 13, 2024
19a697a
refactoring+test: movetemplate & placeImageOnAtom
haditariq Nov 14, 2024
dbf1d79
Refac+test: on add atom
haditariq Nov 14, 2024
29dceea
test: on atom add image counter checker
haditariq Nov 14, 2024
1aeae03
refactor+tests: on image delete, mockup files for test
haditariq Nov 15, 2024
a868d37
test: on delete image delete atom with connected alias; with single o…
haditariq Nov 15, 2024
166b788
test+refac: on delete atom
haditariq Nov 18, 2024
1e429e6
fixes: minors
haditariq Nov 18, 2024
1557652
point: movetemplate logic removed
haditariq Nov 18, 2024
297ab29
clean+refac: add atom logic divied
haditariq Nov 18, 2024
d2ca1c0
chore: code doc, template-list shape alignment
haditariq Nov 18, 2024
13178b3
fix: delete atom when a mol is dropped on other mol; delete mol1 and …
haditariq Nov 18, 2024
5eaec22
specs fix ketcher Editor
haditariq Nov 18, 2024
1fd2f64
refactoring: delete image, read mofile, delete atom(single/group)
haditariq Nov 19, 2024
b33c64b
refactoring+fixes: delete atom by image, delete image by atom, saving…
haditariq Nov 20, 2024
93214b6
draft: on atom delete
haditariq Nov 20, 2024
6731b21
fix: delete image when single atom behind is deleted
haditariq Nov 22, 2024
f7c7223
fix: delete atom case when dragged index is smaller then others
haditariq Nov 22, 2024
967ee17
chore: template names updated bead, surface
haditariq Nov 22, 2024
51b43bb
cleanup + minor fixes
haditariq Nov 22, 2024
cd255f9
test: delete atom to reset aliases, molfile save
haditariq Nov 22, 2024
9a42828
Refactoring, comments, templates-source parsing
haditariq Nov 25, 2024
f242837
Ketcher2 Surface Chemistry feature documentation:v1
haditariq Nov 25, 2024
a8b32aa
fix: reading molfile for saving
haditariq Nov 25, 2024
8508a2d
fix: polymers index
haditariq Nov 25, 2024
3994029
chore: image tag filter applied
haditariq Nov 26, 2024
20418f1
Chore: Ket2 Surface Chemistry feature docs
haditariq Nov 28, 2024
f947a2e
test: template list processing
haditariq Nov 28, 2024
29c33b5
fix: delete atom with select, behind atom, template, calculate pi eve…
haditariq Nov 29, 2024
59a3cd2
fix: fetch data before image delete
haditariq Nov 29, 2024
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
60 changes: 30 additions & 30 deletions app/packs/src/apps/mydb/elements/details/samples/SampleDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ export default class SampleDetails extends React.Component {
UNSAFE_componentWillReceiveProps(nextProps) {
if (
(nextProps.sample.isNew
&& (typeof (nextProps.sample.molfile) === 'undefined'
|| (nextProps.sample.molfile || '').length === 0)
&& (typeof (nextProps.sample.molfile) === 'undefined'
|| (nextProps.sample.molfile || '').length === 0)
)
|| (typeof (nextProps.sample.molfile) !== 'undefined' && nextProps.sample.molecule.inchikey === 'DUMMY')
) {
Expand Down Expand Up @@ -299,7 +299,7 @@ export default class SampleDetails extends React.Component {
const { sample } = this.state;
sample.molfile = molfile;
const smiles = (config && sample.molecule) ? config.smiles : null;
sample.contains_residues = molfile.indexOf(' R# ') > -1;
sample.contains_residues = molfile?.indexOf(' R# ') > -1;
sample.formulaChanged = true;
this.setState({ loadingMolecule: true });

Expand Down Expand Up @@ -798,9 +798,9 @@ export default class SampleDetails extends React.Component {
<b>Chemical identifiers</b>
{sample.decoupled
&& (
<span className="text-danger">
&nbsp;[decoupled]
</span>
<span className="text-danger">
&nbsp;[decoupled]
</span>
)}
</Col>
<div className="col-md-6">
Expand Down Expand Up @@ -1022,8 +1022,8 @@ export default class SampleDetails extends React.Component {
return (
<div>
<ConfirmClose el={sample} />
{ isChemicalTab ? null : saveAndClose }
{ isChemicalTab ? saveForChemical : save}
{isChemicalTab ? null : saveAndClose}
{isChemicalTab ? saveForChemical : save}
</div>
);
}
Expand Down Expand Up @@ -1070,9 +1070,9 @@ export default class SampleDetails extends React.Component {
<OverlayTrigger placement="bottom" overlay={<Tooltip id="sampleDates">{titleTooltip}</Tooltip>}>
<span>
<i className="icon-sample" />
&nbsp;&nbsp;
&nbsp;&nbsp;
{sample.title()}
&nbsp;&nbsp;
&nbsp;&nbsp;
</span>
</OverlayTrigger>
<ShowUserLabels element={sample} />
Expand Down Expand Up @@ -1350,7 +1350,7 @@ export default class SampleDetails extends React.Component {
ElementActions.updateSample(sample);
Utils.downloadFile({
contents: `/api/v1/code_logs/print_analyses_codes?sample_id=${sample.id}`
+ `&analyses_ids[]=${analysis.id}&type=nmr_analysis&size=small`
+ `&analyses_ids[]=${analysis.id}&type=nmr_analysis&size=small`
});
break;
case chmoConversions.nmr_13c.termId:
Expand All @@ -1359,15 +1359,15 @@ export default class SampleDetails extends React.Component {
ElementActions.updateSample(sample);
Utils.downloadFile({
contents: `/api/v1/code_logs/print_analyses_codes?sample_id=${sample.id}`
+ `&analyses_ids[]=${analysis.id}&type=nmr_analysis&size=small`
+ `&analyses_ids[]=${analysis.id}&type=nmr_analysis&size=small`
});
break;
case 'Others':
sample.addAnalysis(a1);
ElementActions.updateSample(sample);
Utils.downloadFile({
contents: `/api/v1/code_logs/print_analyses_codes?sample_id=${sample.id}`
+ `&analyses_ids[]=${a1.id}&type=analysis&size=small`
+ `&analyses_ids[]=${a1.id}&type=analysis&size=small`
});
break;
case 'Others2x':
Expand All @@ -1376,7 +1376,7 @@ export default class SampleDetails extends React.Component {
ElementActions.updateSample(sample);
Utils.downloadFile({
contents: `/api/v1/code_logs/print_analyses_codes?sample_id=${sample.id}`
+ `&analyses_ids[]=${a1.id}&analyses_ids[]=${a2.id}&type=analysis&size=small`
+ `&analyses_ids[]=${a1.id}&analyses_ids[]=${a2.id}&type=analysis&size=small`
});
break;
case 'Others3x':
Expand All @@ -1386,7 +1386,7 @@ export default class SampleDetails extends React.Component {
ElementActions.updateSample(sample);
Utils.downloadFile({
contents: `/api/v1/code_logs/print_analyses_codes?sample_id=${sample.id}`
+ `&analyses_ids[]=${a1.id}&analyses_ids[]=${a2.id}&analyses_ids[]=${a3.id}&type=analysis&size=small`
+ `&analyses_ids[]=${a1.id}&analyses_ids[]=${a2.id}&analyses_ids[]=${a3.id}&type=analysis&size=small`
});
break;
default:
Expand Down Expand Up @@ -1629,29 +1629,29 @@ export default class SampleDetails extends React.Component {
const { pageMessage } = this.state;
const messageBlock = (pageMessage
&& (pageMessage.error.length > 0 || pageMessage.warning.length > 0)) ? (
<Alert bsStyle="warning" style={{ marginBottom: 'unset', padding: '5px', marginTop: '10px' }}>
<strong>Structure Alert</strong>
&nbsp;
<Button
bsSize="xsmall"
bsStyle="warning"
onClick={() => this.setState({ pageMessage: null })}
>
Close Alert
</Button>
<br />
{
<Alert bsStyle="warning" style={{ marginBottom: 'unset', padding: '5px', marginTop: '10px' }}>
<strong>Structure Alert</strong>
&nbsp;
<Button
bsSize="xsmall"
bsStyle="warning"
onClick={() => this.setState({ pageMessage: null })}
>
Close Alert
</Button>
<br />
{
pageMessage.error.map((m) => (
<div key={uuid.v1()}>{m}</div>
))
}
{
{
pageMessage.warning.map((m) => (
<div key={uuid.v1()}>{m}</div>
))
}
</Alert>
) : null;
</Alert>
) : null;

const activeTab = (this.state.activeTab !== 0 && stb.indexOf(this.state.activeTab) > -1
&& this.state.activeTab) || visible.get(0);
Expand Down
Loading