Skip to content

Commit

Permalink
added scheme view code in submit
Browse files Browse the repository at this point in the history
  • Loading branch information
Newatia authored and Newatia committed Sep 24, 2024
1 parent 84f33b5 commit bdcd1ba
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/app/core/substance-ssg4m/substance-ssg4m-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1004,10 +1004,35 @@ export class SubstanceSsg4ManufactureFormComponent implements OnInit, AfterViewI
// 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
this.ssg4mSyntheticPathway.sbmsnImage = document.querySelector("#scheme-viz-view").innerHTML;

Expand Down

0 comments on commit bdcd1ba

Please sign in to comment.