- Use copy dropdown menu on Ketcher editor and NOT ctrl + c to copy structure.
+
+ Use copy dropdown menu on Ketcher editor and NOT ctrl + c to copy structure.
+
Load an image by pasting a copied image into the canvas with ctrl + v, or dragging a local image file.
diff --git a/src/app/core/structure-editor/structure-editor.component.scss b/src/app/core/structure-editor/structure-editor.component.scss
index 8747591dd..768262202 100644
--- a/src/app/core/structure-editor/structure-editor.component.scss
+++ b/src/app/core/structure-editor/structure-editor.component.scss
@@ -62,10 +62,18 @@
}
-.marginright15px {
- margin-left: 15px;
+.marginright10px {
+ margin-left: 10px;
}
.textalignleft {
text-align: left;
+}
+
+.fontbold {
+ font-weight: 700;
+}
+
+.fontsize12px {
+ font-size: 12px;
}
\ No newline at end of file
diff --git a/src/app/core/substance-form/structure/substance-form-structure-card.component.ts b/src/app/core/substance-form/structure/substance-form-structure-card.component.ts
index 5a4358dcf..26caeb15c 100644
--- a/src/app/core/substance-form/structure/substance-form-structure-card.component.ts
+++ b/src/app/core/substance-form/structure/substance-form-structure-card.component.ts
@@ -112,11 +112,11 @@ export class SubstanceFormStructureCardComponent extends SubstanceFormBase imple
if (this.substanceType === 'polymer') {
this.menuLabelUpdate.emit('Idealized Structure');
- // Display this message under the Ketcher Editor when Registering/Updating Polymer
- // if ketcherDisclaimer has string in the config.json file, display the disclaimer under the Ketcher Editor
- if (this.configService && this.configService.configData && this.configService.configData.ketcherDisclaimer) {
- if (this.configService.configData.ketcherDisclaimer) {
- this.disclaimer = this.configService.configData.ketcherDisclaimer;
+ // Display this message under JSDraw/ketcher Editor when Registering/Updating Polymer
+ // if polymerDisclaimer has string in the config.json file, display the disclaimer under the Structure Editor
+ if (this.configService && this.configService.configData && this.configService.configData.polymerDisclaimer) {
+ if (this.configService.configData.polymerDisclaimer) {
+ this.disclaimer = this.configService.configData.polymerDisclaimer;
}
}
diff --git a/src/app/fda/config/config.json b/src/app/fda/config/config.json
index 987df842e..92e30b359 100644
--- a/src/app/fda/config/config.json
+++ b/src/app/fda/config/config.json
@@ -19,7 +19,7 @@
"useDataUrl": false,
"showCrossEntitySearchDropdown": true,
"disableJSDraw": false,
- "ketcherDisclaimer": "",
+ "polymerDisclaimer": "Please do not consider GSRS to be an expert system when registering polymer substances.",
"restApiPrefix": "/ginas/app",
"authenticateAs": {
"apiUsername": null,
From 067ab340fecfb8185420c9db9dc1bffd50fac65c Mon Sep 17 00:00:00 2001
From: Newatia
Date: Mon, 11 Aug 2025 01:36:28 -0400
Subject: [PATCH 033/102] fixed more ketcher issues
---
.../structure-editor.component.ts | 132 ++++---
src/app/core/structure/structure.service.ts | 10 +-
.../advanced-selector-dialog.component.html | 2 +-
.../advanced-selector-dialog.component.ts | 339 +++++++++---------
.../advanced-search.component.ts | 112 +++---
5 files changed, 322 insertions(+), 273 deletions(-)
diff --git a/src/app/core/structure-editor/structure-editor.component.ts b/src/app/core/structure-editor/structure-editor.component.ts
index b55d2d920..b10bcc253 100644
--- a/src/app/core/structure-editor/structure-editor.component.ts
+++ b/src/app/core/structure-editor/structure-editor.component.ts
@@ -54,6 +54,7 @@ export class StructureEditorComponent implements OnInit, AfterViewInit, OnDestro
firstload = true;
calledFromComponent: string;
disclaimerMessage: string;
+ pageKetcherIsOpen: string;
private overlayContainer: HTMLElement;
@ViewChild('structure_canvas', { static: false }) myCanvas: ElementRef;
@@ -89,10 +90,16 @@ export class StructureEditorComponent implements OnInit, AfterViewInit, OnDestro
this.destroyExistingKetcherInstance();
+ this.structureService.updatePageKetcherIsOpen('');
this.structureService.updateReloadKetcher(true);
}
destroyExistingKetcherInstance(): boolean {
+ this.structureService.updatePageKetcherIsOpen('');
+
+ window.removeEventListener('drop', this.preventDrag);
+ window.removeEventListener('dragover', this.preventDrag);
+ window.removeEventListener('paste', this.checkPaste);
// Delete existing Ketcher instance
delete this.ketcher;
delete window['ketcher'];
@@ -190,6 +197,12 @@ export class StructureEditorComponent implements OnInit, AfterViewInit, OnDestro
}
ngOnInit() {
+ this.structureService.pageKetcherIsOpen$.subscribe((pageKetcherIsOpen) => {
+ if (pageKetcherIsOpen) {
+ this.pageKetcherIsOpen = pageKetcherIsOpen;
+ }
+ });
+
this.structureService.reloadKetcher$.subscribe((reloadKetcher) => {
if (reloadKetcher === true) {
if (this.calledFromComponent && this.calledFromComponent === 'registerSubstance') {
@@ -297,21 +310,21 @@ export class StructureEditorComponent implements OnInit, AfterViewInit, OnDestro
if (!childElement) {
const divElement = document.createElement("div");
divElement.setAttribute("id", "root");
-
+
divElement.style.height = '618px';
divElement.style.clear = 'both';
divElement.style.display = 'none';
- divElement.style.padding = '10px';
-
+ divElement.style.padding = '10px';
+
// append child to parent
parentElement.appendChild(divElement);
window.addEventListener('click', this.listener);
this.overlayContainer = this.overlayContainerService.getContainerElement();
this.editorSwitched.emit(this.structureEditor);
-
+
this.ketcherReload();
-
+
}
}
}
@@ -320,7 +333,9 @@ export class StructureEditorComponent implements OnInit, AfterViewInit, OnDestro
ketcherReload() {
this.firstload = true;
- window.addEventListener('click', this.listener);
+ window.addEventListener('dragover', this.preventDrag);
+ window.addEventListener('drop', this.preventDrag);
+ window.addEventListener('paste', this.checkPaste);
this.overlayContainer = this.overlayContainerService.getContainerElement();
if (isPlatformBrowser(this.platformId)) {
@@ -375,7 +390,7 @@ export class StructureEditorComponent implements OnInit, AfterViewInit, OnDestro
document.getElementById("root").style.display = "";
this.waitForKetcherFirstLoad();
this.firstload = false;
-
+
} else if (this.firstload) {
this.firstload = false;
}
@@ -464,12 +479,16 @@ export class StructureEditorComponent implements OnInit, AfterViewInit, OnDestro
}
async waitForKetcherFirstLoad(): Promise {
+ // Update global variable to let other instance know
+ if (this.pageKetcherIsOpen !== this.calledFromComponent) {
+ this.structureService.updatePageKetcherIsOpen(this.calledFromComponent);
+ }
+
await this.executeOnceNotNullOrUndefined(() => window['ketcher'], (obj) => {
setTimeout(() => {
this.ketcher = window['ketcher'];
this.ketcherLoaded = true;
document.getElementById("root").style.display = "";
- // this.editor = new EditorImplementation(this.ketcher, this.jsdraw, 'ketcher');
this.editor = new EditorImplementation(this.ketcher);
this.editorOnLoad.emit(this.editor);
this.editorSwitched.emit(this.structureEditor);
@@ -606,57 +625,66 @@ export class StructureEditorComponent implements OnInit, AfterViewInit, OnDestro
}
catchPaste(event: ClipboardEvent): void {
- const send: any = {};
- let valid = false;
- const items = event.clipboardData.items;
- for (let i = 0; i < items.length; i++) {
- const blob = items[i].getAsFile();
- if (items[i].type.indexOf('image') !== -1) {
- event.preventDefault();
- event.stopPropagation();
- this.canvasMessage = '';
- valid = true;
- send.type = 'image';
- const reader = new FileReader();
- send.file = blob;
- reader.readAsDataURL(blob);
- const that = this;
- reader.onloadend = () => {
- setTimeout(() => {
- const img = reader.result.toString();
- that.createImage(img);
- });
- };
- } else if (items[i].type === 'text/plain') {
- const text = event.clipboardData.getData('text/plain');
- if (text.indexOf('
- Test Agent ID (Company Code) *:
+ Test Agent ID (Company Code):{{invitroTestAgent.testAgentCompanyCode}} Test Agent Name (FDA) *:
- {{invitroTestAgent.testAgent}}
+ {{invitroTestAgent.testAgent}}
+
+
+
+ Required Field
+
+ Test Agent Approval ID/UNII:{{invitroTestAgent.testAgentApprovalId}}
@@ -296,8 +361,14 @@
7. Batch Information
Concepts have no defining information, but are collections of terms, codes and related information. They can be promoted to a defined substance at a later time, when appropriate.
Concepts have no defining information, but are collections of terms, codes and related information. They can be promoted to a defined substance at a later time, when appropriate.
- No drafts were found for these conditions under local storage. Substance drafts are stored in this browser's cache, so using an incognito tab or clearing cache
- will clear or not allow access to drafts. You can save and load stored record drafts using the buttons below.
-
+ No drafts were found for these conditions under local storage. Substance
+ drafts are stored in this browser's cache, so using an incognito tab or
+ clearing cache will clear or not allow access to drafts. You can save and
+ load stored record drafts using the buttons below.
+
The primary goal of the Global Substance Registration System (GSRS) program is the production of software to assist agencies in registering and documenting information about substances found in medicines and other regulated products. GSRS provides common identifiers including FDA UNIIs for all substances used in regulated products. It utilizes definitions of substances globally-consistent with ISO 11238 and DTS 19844 including active substances under clinical investigation.\n\n
\n\n \n\n\n\n
Many organizations contribute to the GSRS project including the Food and Drug Administration (FDA) and the National Center for Advancing Translational Science (NCATS). For more information about GSRS, code and public data, please consult https://gsrs.ncats.nih.gov/.
Your search did not return any results. Please try modifying it or
- click here to clear all your search criteria.
+ click here to clear all
+ your search criteria.
-
0)">
- Your search did not return any results within the default fields. However, this query has some results if you restrict your search to specific fields below.
+
0">
+ Your search did not return any results within the default fields.
+ However, this query has some results if you restrict your search to
+ specific fields below.