Commit 95796502 by Owen Ryan Ang

reject bug fix

parent 57fdbd7e
import { createLoadingScreen, resetGDE } from "../../script.js"; import { createLoadingScreen, removeLoadingScreen, resetGDE } from "../../script.js";
import { SCHEMA_FILE_PATH } from "../DataInputWidget/config.js"; import { SCHEMA_FILE_PATH } from "../DataInputWidget/config.js";
import { validateInput } from "../DataInputWidget/validateInput.js"; import { validateInput } from "../DataInputWidget/validateInput.js";
import { goBackToElementListViewer } from "../ElementListWidget/ElementListWidget.js";
import { PROJECT_CODE } from "../Submit/config.js"; import { PROJECT_CODE } from "../Submit/config.js";
import { ENCODING_PASS, REASON_LIST } from "../config.js"; import { ENCODING_PASS, REASON_LIST } from "../config.js";
import { createInfoModal, createModal } from "../genericPopup/genericPopup.js"; import { createInfoModal, createModal } from "../genericPopup/genericPopup.js";
...@@ -37,11 +38,11 @@ async function rejectElement() { ...@@ -37,11 +38,11 @@ async function rejectElement() {
async function successfulReturn() { async function successfulReturn() {
document.getElementById("backdropContainer").remove(); document.getElementById("backdropContainer").remove();
createLoadingScreen(); createLoadingScreen();
if(await BPO_OBJECT.getRandomWaitingElement()){ if(goBackToElementListViewer()){
resetGDE(); resetGDE();
}; };
} }
createInfoModal(await successfulReturn, 'OK', "Element rejected"); createInfoModal(successfulReturn, 'OK', "Element rejected");
...@@ -333,11 +334,11 @@ function saveExceptionToXml(){ ...@@ -333,11 +334,11 @@ function saveExceptionToXml(){
"userId": sessionStorage.getItem("user_id"), "userId": sessionStorage.getItem("user_id"),
"elementId": elementId, "elementId": elementId,
"schema": SCHEMA_FILE_PATH, "schema": SCHEMA_FILE_PATH,
"totalRec":"0", "totalRec": 0,
"maxRec": "1", "maxRec": "1",
"totalKeystroke": "", "totalKeystroke": 0,
"procTime": "", "procTime": "",
"procDuration": "", "procDuration": 0,
"eob": "", "eob": "",
"exceptionRemark": selected, "exceptionRemark": selected,
"recordNo": "0", "recordNo": "0",
......
import { createWebGdeInterface } from '../../script.js'; import { createWebGdeInterface, removeLoadingScreen } from '../../script.js';
import { ADD_NEW_OPTION, DOMAIN } from '../config.js'; import { ADD_NEW_OPTION, CURRENT_NODE, DOMAIN } from '../config.js';
import { DocumentControlWidget } from "../documentControlWidget/documentControlWidget.js"; import { DocumentControlWidget } from "../documentControlWidget/documentControlWidget.js";
import { INDEXED_DB_STORAGE, HIGHLIGHT_OBJECT, IMAGE_VIEWER_OBJECT, INDEXED_DB_NAME, INDEXED_DB_TBL_NAME, setIndexedDBStorage, setHighlightObject, setImageViewerObject, setBPOObject, BPO_OBJECT, DISPLAY_FIELD_OBJECT, setDisplayFieldObject, activateGDE, setDocumentControlObject, DOCUMENT_CONTROL_OBJECT, IS_GDE_ACTIVATED } from "../globalVariable.js"; import { INDEXED_DB_STORAGE, HIGHLIGHT_OBJECT, IMAGE_VIEWER_OBJECT, INDEXED_DB_NAME, INDEXED_DB_TBL_NAME, setIndexedDBStorage, setHighlightObject, setImageViewerObject, setBPOObject, BPO_OBJECT, DISPLAY_FIELD_OBJECT, setDisplayFieldObject, activateGDE, setDocumentControlObject, DOCUMENT_CONTROL_OBJECT, IS_GDE_ACTIVATED } from "../globalVariable.js";
const API_ROOT = `${DOMAIN}/bpo/req`; const API_ROOT = `${DOMAIN}bpo/req`;
export class ElementListWidget { export class ElementListWidget {
global = { global = {
...@@ -202,6 +202,7 @@ export class ElementListWidget { ...@@ -202,6 +202,7 @@ export class ElementListWidget {
if (this.global.selectedElement) { if (this.global.selectedElement) {
sessionStorage.setItem('selectedElementId', this.global.selectedElement.elementId); sessionStorage.setItem('selectedElementId', this.global.selectedElement.elementId);
sessionStorage.setItem('selectedElementExtraDetails', JSON.stringify(this.global.selectedElement.extraDetails)); sessionStorage.setItem('selectedElementExtraDetails', JSON.stringify(this.global.selectedElement.extraDetails));
sessionStorage.setItem('element_file_loc', this.global.selectedElement.fileLocation)
} }
// Remove the current container from the DOM // Remove the current container from the DOM
...@@ -269,10 +270,13 @@ export function goBackToElementListViewer() { ...@@ -269,10 +270,13 @@ export function goBackToElementListViewer() {
webGdeElement.remove(); // This will remove the element and its children webGdeElement.remove(); // This will remove the element and its children
} else { } else {
console.warn("Element with class 'web-gde-container' not found."); console.warn("Element with class 'web-gde-container' not found.");
return false;
} }
// Reinstantiate and reinitialize the ElementListWidget // Reinstantiate and reinitialize the ElementListWidget
new ElementListWidget('Web_GDE_DEV', 'containerId'); new ElementListWidget(CURRENT_NODE, 'containerId');
removeLoadingScreen();
return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment