Skip to content

Commit

Permalink
updated ssg4m
Browse files Browse the repository at this point in the history
  • Loading branch information
Newatia authored and Newatia committed Sep 24, 2024
1 parent bdcd1ba commit 43e1d0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 29 deletions.
38 changes: 9 additions & 29 deletions src/app/core/substance-ssg4m/substance-ssg4m-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -999,41 +999,13 @@ export class SubstanceSsg4ManufactureFormComponent implements OnInit, AfterViewI
// if New Record, initialize object
if (this.ssg4mSyntheticPathway == null) {
this.ssg4mSyntheticPathway = {};

// Generate GUID SynthPathwayId
// this.ssg4mSyntheticPathway.synthPathwayId = '2ead5343-6471-88ae-b0b0-88370d44786e';
// this.ssg4mSyntheticPathway = { "appType": "IND", "synthPathwayId": "2ead5343-6471-88ae-b0b0-88370d44574e", "sbmsnDataText": jsonValue };
}


// Existing Record
// get the JSON from the SSG4m Form and store as a Clob into the database
this.ssg4mSyntheticPathway.sbmsnDataText = jsonValue;

/*********** BEGIN SCHEME VIEW CODE ****************/
// Added this scheme view block here. If we do not click on the "Scheme View" tab before saving, it adds
// extra space on the top during printing.

//document.querySelector("#scheme-viz-view").className = "";

console.log("About to load the scheme view in submit() function during saving");

if (window['schemeUtil']) {
if (window['schemeUtil'].debug) {
window['schemeUtil'].executeWhenLoaded = (() => {
console.log("About to render the scheme view in submit() after executeWhenLoaded");
window['schemeUtil'].renderScheme(window['schemeUtil'].makeDisplayGraph(JSON.parse(ssgjs)), "#scheme-viz-view");
window['schemeUtil'].executeWhenLoaded = null;
});
} else {
console.log("About to render the scheme view in submit() in else block");
window['schemeUtil'].renderScheme(window['schemeUtil'].makeDisplayGraph(JSON.parse(ssgjs)), "#scheme-viz-view");
}
}

/************ END SCHEME VIEW *********************/

// Save SVG as blob
// Save SVG as Clob
this.ssg4mSyntheticPathway.sbmsnImage = document.querySelector("#scheme-viz-view").innerHTML;

// After submitting Save button, the UI waits for 5 seconds to see if it gets a response.
Expand Down Expand Up @@ -1105,7 +1077,15 @@ export class SubstanceSsg4ManufactureFormComponent implements OnInit, AfterViewI

}; //window

let tempCallback = window["schemeUtil"].onFinishedLayout;
window["schemeUtil"].onFinishedLayout = (s)=>{
window["schemeUtil"].onFinishedLayout =(ss)=>{};

setTimeout(tempCallback(s),3000);
};

window['schemeUtil'].renderScheme(window['schemeUtil'].makeDisplayGraph(JSON.parse(ssgjs)), "#scheme-viz-view");

}

cancelSubmit() {
Expand Down
Binary file modified substance_dictionary/dictionary_current_all_entities.xlsx
Binary file not shown.

0 comments on commit 43e1d0a

Please sign in to comment.