Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
web-ui
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WEBGDE-Components
web-ui
Commits
37cbdd37
Commit
37cbdd37
authored
Oct 11, 2023
by
Owen Ryan Ang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-Sprint-WebGDEII-Tres' into 'development-mobile'
Feature sprint web gdeii tres See merge request
!73
parents
d6146918
95796502
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
218 additions
and
121 deletions
+218
-121
rejectElement.js
WebGde/WebContent/WebGde-Widgets/BPO/rejectElement.js
+7
-6
returnElement.js
WebGde/WebContent/WebGde-Widgets/BPO/returnElement.js
+48
-64
ElementListWidget.js
...ent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
+42
-13
LoginJavaInterface.js
...bContent/WebGde-Widgets/LogInWidget/LoginJavaInterface.js
+43
-0
config.js
WebGde/WebContent/WebGde-Widgets/config.js
+20
-7
documentControlWidget.js
...de-Widgets/documentControlWidget/documentControlWidget.js
+12
-4
genericPopup.js
...de/WebContent/WebGde-Widgets/genericPopup/genericPopup.js
+5
-3
index.html
WebGde/WebContent/index.html
+1
-1
script.js
WebGde/WebContent/script.js
+18
-20
startup.js
WebGde/WebContent/startup.js
+17
-0
style.css
WebGde/WebContent/style.css
+5
-3
No files found.
WebGde/WebContent/WebGde-Widgets/BPO/rejectElement.js
View file @
37cbdd37
import
{
createLoadingScreen
,
resetGDE
}
from
"../../script.js"
;
import
{
createLoadingScreen
,
re
moveLoadingScreen
,
re
setGDE
}
from
"../../script.js"
;
import
{
SCHEMA_FILE_PATH
}
from
"../DataInputWidget/config.js"
;
import
{
validateInput
}
from
"../DataInputWidget/validateInput.js"
;
import
{
goBackToElementListViewer
}
from
"../ElementListWidget/ElementListWidget.js"
;
import
{
PROJECT_CODE
}
from
"../Submit/config.js"
;
import
{
ENCODING_PASS
,
REASON_LIST
}
from
"../config.js"
;
import
{
createInfoModal
,
createModal
}
from
"../genericPopup/genericPopup.js"
;
...
...
@@ -37,11 +38,11 @@ async function rejectElement() {
async
function
successfulReturn
()
{
document
.
getElementById
(
"backdropContainer"
).
remove
();
createLoadingScreen
();
if
(
await
BPO_OBJECT
.
getRandomWaitingElement
()){
if
(
goBackToElementListViewer
()){
resetGDE
();
};
}
createInfoModal
(
await
successfulReturn
,
'OK'
,
"Element rejected"
);
createInfoModal
(
successfulReturn
,
'OK'
,
"Element rejected"
);
...
...
@@ -333,11 +334,11 @@ function saveExceptionToXml(){
"userId"
:
sessionStorage
.
getItem
(
"user_id"
),
"elementId"
:
elementId
,
"schema"
:
SCHEMA_FILE_PATH
,
"totalRec"
:
"0"
,
"totalRec"
:
0
,
"maxRec"
:
"1"
,
"totalKeystroke"
:
""
,
"totalKeystroke"
:
0
,
"procTime"
:
""
,
"procDuration"
:
""
,
"procDuration"
:
0
,
"eob"
:
""
,
"exceptionRemark"
:
selected
,
"recordNo"
:
"0"
,
...
...
WebGde/WebContent/WebGde-Widgets/BPO/returnElement.js
View file @
37cbdd37
import
{
createLoadingScreen
,
removeLoadingScreen
,
resetGDE
}
from
"../../script.js"
;
import
{
SCHEMA_FILE_PATH
}
from
"../DataInputWidget/config.js"
;
import
{
validateInput
}
from
"../DataInputWidget/validateInput.js"
;
import
{
goBackToElementListViewer
}
from
"../ElementListWidget/ElementListWidget.js"
;
import
{
removePrompt
,
showPrompt
}
from
"../LogInWidget/LogInPrompt.js"
;
import
{
PROJECT_CODE
}
from
"../Submit/config.js"
;
import
{
interval
}
from
"../captureMetrics/captureMetrics.js"
;
import
{
createInfoModal
,
createModal
}
from
"../genericPopup/genericPopup.js"
;
...
...
@@ -84,81 +86,62 @@ function returnSaveXML(){
}
export
function
createReturnWindow
()
{
let
overlay
=
document
.
createElement
(
"div"
);
overlay
.
classList
.
add
(
"genericPopup"
);
let
endWindow
=
document
.
createElement
(
'div'
);
endWindow
.
id
=
'end_window'
;
endWindow
.
classList
.
add
(
"parent_Window"
)
let
endBodyDiv
=
document
.
createElement
(
'div'
);
endBodyDiv
.
id
=
'endBodyDiv'
;
let
endLabel
=
document
.
createElement
(
'p'
);
endLabel
.
innerText
=
"Current Element will be Returned."
;
let
endContinue
=
document
.
createElement
(
'p'
);
endContinue
.
innerText
=
"Continue Y/N?"
;
let
endOkCnclDiv
=
document
.
createElement
(
'div'
);
endOkCnclDiv
.
id
=
'endOkCnclCont'
;
let
okEnd
=
document
.
createElement
(
'button'
);
okEnd
.
classList
.
add
(
"emphasizeButton"
);
okEnd
.
innerHTML
=
'ok'
;
okEnd
.
id
=
'okEndButtn'
;
okEnd
.
onclick
=
async
function
()
{
createLoadingScreen
();
let
popUpDisplay
=
document
.
createElement
(
"div"
);
popUpDisplay
.
id
=
"returnWindow"
;
popUpDisplay
.
classList
.
add
(
"modal-container"
)
let
screenMain
=
document
.
createElement
(
'div'
);
screenMain
.
id
=
'parent_Window'
;
screenMain
.
classList
.
add
(
'return-modal'
);
document
.
body
.
appendChild
(
screenMain
);
let
returnLabel
=
document
.
createElement
(
"div"
);
returnLabel
.
textContent
=
"Return Element?"
;
returnLabel
.
classList
.
add
(
"headerLabel"
);
screenMain
.
appendChild
(
returnLabel
);
let
buttonPanel
=
document
.
createElement
(
"div"
);
buttonPanel
.
classList
.
add
(
"floatingButtonPanel"
);
let
cancelButton
=
createButtonElem
(
"normalButton"
,
"Cancel"
);
let
okButton
=
createButtonElem
(
"emphasizeButton"
,
"Ok"
);
buttonPanel
.
append
(
cancelButton
);
buttonPanel
.
append
(
okButton
);
screenMain
.
appendChild
(
buttonPanel
);
okButton
.
onclick
=
async
function
()
{
showPrompt
(
"Returning Element"
,
"Please wait..."
,
null
,
null
,
null
);
let
response
=
await
returnElementBPO
(
sessionStorage
.
getItem
(
"element_id"
));
if
(
response
.
status
==
200
)
{
document
.
getElementById
(
"counter"
).
innerHTML
=
""
;
clearTimeout
(
interval
);
sessionStorage
.
removeItem
(
"section"
);
sessionStorage
.
removeItem
(
"doctype"
);
localStorage
.
clear
();
function
successfulReturn
()
{
document
.
getElementById
(
"backdropContainer"
).
remove
();
}
createInfoModal
(
successfulReturn
,
'OK'
,
"Element Returned"
);
if
(
await
BPO_OBJECT
.
getRandomWaitingElement
()){
resetGDE
();
};
removePrompt
();
document
.
getElementById
(
"returnWindow"
).
remove
();
goBackToElementListViewer
();
}
else
{
//PROMPT.createInfoPrompt(`Error ${response.status}: Returning element`);
function
successfulReturn
()
{
logoutKeycloak
();
function
errorReturn
(){
removePrompt
();
}
removeLoadingScreen
();
createInfoModal
(
successfulReturn
,
'Log out'
,
"Error ${response.status}: Returning element"
);
createInfoModal
(
errorReturn
,
'Error'
,
"Error ${response.status}: Returning element"
);
}
overlay
.
remove
();
}
let
cancelEnd
=
document
.
createElement
(
'button'
);
cancelEnd
.
classList
.
add
(
"normalButton"
);
cancelEnd
.
innerHTML
=
'cancel'
;
cancelEnd
.
id
=
'cnclEndButton'
;
endOkCnclDiv
.
appendChild
(
okEnd
);
endOkCnclDiv
.
appendChild
(
cancelEnd
);
endBodyDiv
.
appendChild
(
endLabel
);
endBodyDiv
.
appendChild
(
endContinue
);
endBodyDiv
.
appendChild
(
endOkCnclDiv
);
endWindow
.
appendChild
(
endBodyDiv
);
cancelEnd
.
addEventListener
(
"click"
,
function
()
{
overlay
.
remove
();
cancelButton
.
addEventListener
(
"click"
,
function
()
{
document
.
getElementById
(
"returnWindow"
).
remove
();
});
popUpDisplay
.
append
(
screenMain
);
popUpDisplay
.
style
.
display
=
"block"
;
document
.
body
.
append
(
popUpDisplay
);
}
overlay
.
append
(
endWindow
);
document
.
body
.
append
(
overlay
);
function
createButtonElem
(
className
,
buttonName
,
icon
)
{
/* let buttonElem = document.createElement("button"); */
let
buttonElem
;
buttonElem
=
document
.
createElement
(
"button"
);
buttonElem
.
classList
.
add
(
className
);
buttonElem
.
textContent
=
buttonName
;
return
buttonElem
;
}
\ No newline at end of file
WebGde/WebContent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
View file @
37cbdd37
import
{
createWebGdeInterface
}
from
'../../script.js'
;
import
{
createWebGdeInterface
,
removeLoadingScreen
}
from
'../../script.js'
;
import
{
ADD_NEW_OPTION
,
CURRENT_NODE
,
DOMAIN
}
from
'../config.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"
;
const
API_ROOT
=
"http://52.207.220.74:8080/bpo/req"
;
const
API_ROOT
=
`
${
DOMAIN
}
bpo/req`
;
export
class
ElementListWidget
{
global
=
{
...
...
@@ -11,7 +11,9 @@ export class ElementListWidget {
newButton
:
null
,
encodeButton
:
null
,
selectedElement
:
null
,
workers
:
[]
workers
:
[],
queueIndex
:
null
,
workerId
:
null
};
constructor
(
nodeId
,
containerId
)
{
...
...
@@ -24,8 +26,8 @@ export class ElementListWidget {
document
.
body
.
appendChild
(
this
.
global
.
container
);
}
this
.
workerId
=
sessionStorage
.
getItem
(
"user_id"
);
this
.
init
(
nodeId
,
this
.
workerId
);
this
.
global
.
workerId
=
sessionStorage
.
getItem
(
"user_id"
);
this
.
init
(
nodeId
,
this
.
global
.
workerId
);
}
async
init
(
nodeId
,
workerId
)
{
...
...
@@ -110,6 +112,7 @@ export class ElementListWidget {
deselectAll
();
elementContainer
.
classList
.
add
(
"selected"
);
this
.
global
.
selectedElement
=
element
;
this
.
global
.
queueIndex
=
element
.
queueIndex
;
// <-- Update the queueIndex here
this
.
showExtraDetails
(
element
,
elementContainer
);
this
.
global
.
encodeButton
.
disabled
=
false
;
this
.
global
.
encodeButton
.
classList
.
remove
(
"disabled"
);
...
...
@@ -136,16 +139,20 @@ export class ElementListWidget {
buttonContainer
.
appendChild
(
this
.
global
.
encodeButton
);
if
(
ADD_NEW_OPTION
===
'Y'
){
const
newButton
=
document
.
createElement
(
"button"
);
newButton
.
id
=
"new-btn"
;
newButton
.
textContent
=
"NEW"
;
newButton
.
addEventListener
(
"click"
,
()
=>
this
.
handleNewClick
());
buttonContainer
.
appendChild
(
newButton
);
this
.
global
.
container
.
appendChild
(
buttonContainer
);
this
.
global
.
newButton
=
newButton
;
}
this
.
global
.
container
.
appendChild
(
buttonContainer
);
}
getContainer
()
{
return
this
.
global
.
container
;
...
...
@@ -195,6 +202,7 @@ export class ElementListWidget {
if
(
this
.
global
.
selectedElement
)
{
sessionStorage
.
setItem
(
'selectedElementId'
,
this
.
global
.
selectedElement
.
elementId
);
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
...
...
@@ -209,6 +217,7 @@ export class ElementListWidget {
// Retrieve and display the selected element's ID
const
elementId
=
sessionStorage
.
getItem
(
'selectedElementId'
);
sessionStorage
.
setItem
(
"element_id"
,
elementId
);
const
elementIdDiv
=
document
.
createElement
(
'div'
);
elementIdDiv
.
textContent
=
`Element ID:
${
elementId
}
`
;
elementIdDiv
.
classList
.
add
(
'element-id'
);
...
...
@@ -230,10 +239,14 @@ export class ElementListWidget {
// Append the DocumentControlWidget
setDocumentControlObject
(
new
DocumentControlWidget
());
inputContainer
.
appendChild
(
DOCUMENT_CONTROL_OBJECT
.
getWidget
());
}
// Call assignElementToWorker to assign the selected element to the current worker
const
assignResponse
=
await
assignElementToWorker
(
this
.
global
.
workerId
,
this
.
nodeId
,
this
.
global
.
queueIndex
,
elementId
);
if
(
!
assignResponse
.
successful
)
{
console
.
error
(
'Failed to assign element to worker:'
,
assignResponse
);
return
;
}
}
}
async
function
fetchWorkersForNode
(
nodeId
)
{
...
...
@@ -246,9 +259,25 @@ async function fetchElementsForNode(nodeId) {
return
await
response
.
json
();
}
/*await createWebGdeInterface(null);
setDocumentControlObject(new DocumentControlWidget());
document.getElementById("input-field-container").appendChild(DOCUMENT_CONTROL_OBJECT.getWidget());*/
async
function
assignElementToWorker
(
workerId
,
nodeId
,
queueIndex
,
elementId
)
{
const
response
=
await
fetch
(
`
${
API_ROOT
}
/workers/
${
workerId
}
/nodes/
${
nodeId
}
/elements/
${
queueIndex
}
/
${
elementId
}
`
);
return
await
response
.
json
();
}
export
function
goBackToElementListViewer
()
{
const
webGdeElement
=
document
.
querySelector
(
'.web-gde-container'
);
if
(
webGdeElement
)
{
webGdeElement
.
remove
();
// This will remove the element and its children
}
else
{
console
.
warn
(
"Element with class 'web-gde-container' not found."
);
return
false
;
}
// Reinstantiate and reinitialize the ElementListWidget
new
ElementListWidget
(
CURRENT_NODE
,
'containerId'
);
removeLoadingScreen
();
return
true
;
}
...
...
WebGde/WebContent/WebGde-Widgets/LogInWidget/LoginJavaInterface.js
0 → 100644
View file @
37cbdd37
import
{
initializeWebpage
}
from
"../../startup.js"
;
import
{
initializeConfig
}
from
"../config.js"
;
export
function
loginGde
(
token
){
sessionStorage
.
setItem
(
"token"
,
token
);
var
decodedToken
=
parseJwt
(
token
);
// Check if the decodedToken contains the desired properties
if
(
decodedToken
)
{
const
{
preferred_username
,
domain
,
node
}
=
decodedToken
;
// Now you can use these variables as needed
console
.
log
(
"Preferred Username:"
,
preferred_username
);
sessionStorage
.
setItem
(
"user_id"
,
preferred_username
);
console
.
log
(
"Domain:"
,
domain
);
console
.
log
(
"Node:"
,
node
);
initializeConfig
(
domain
,
node
);
initializeWebpage
();
// You can return these values or perform any other actions with them here
}
else
{
// Handle the case where the token couldn't be decoded or doesn't contain the expected properties
console
.
error
(
"Invalid token or missing properties."
);
}
}
export
function
fallbackLogin
(
user_id
,
domain
,
node
){
sessionStorage
.
setItem
(
"user_id"
,
user_id
);
initializeConfig
(
domain
,
node
);
initializeWebpage
();
}
function
parseJwt
(
token
)
{
var
base64Url
=
token
.
split
(
'.'
)[
1
];
var
base64
=
base64Url
.
replace
(
/-/g
,
'+'
).
replace
(
/_/g
,
'/'
);
var
jsonPayload
=
decodeURIComponent
(
window
.
atob
(
base64
).
split
(
''
).
map
(
function
(
c
)
{
return
'%'
+
(
'00'
+
c
.
charCodeAt
(
0
).
toString
(
16
)).
slice
(
-
2
);
}).
join
(
''
));
return
JSON
.
parse
(
jsonPayload
);
}
\ No newline at end of file
WebGde/WebContent/WebGde-Widgets/config.js
View file @
37cbdd37
...
...
@@ -10,24 +10,28 @@ export const HIGH_LIGHT_SCHEMA = "./WebGde-Widgets/sample_schema/dbSchema_anno.
export
const
ROOT_FOLDER
=
"/WebGde-Widgets"
;
//this determines if the images will be retrieved from the gfs
export
const
DOMAIN
=
"http://52.207.220.74:8080"
// export const DOMAIN = "http://3.83.246.74:8080"
export
var
DOMAIN
=
""
export
const
CONTEXTROOT
=
"gfs-explorer-ws"
export
const
GDE_URL
=
DOMAIN
+
"/MobileGdeDev/svc/gfs-rest"
export
const
FOLDER_URL
=
DOMAIN
+
"/"
+
CONTEXTROOT
+
"/svc/gfs-rest/get-folder?parentPath=/Users/"
export
const
DOWNLOAD_URL
=
DOMAIN
+
"/"
+
CONTEXTROOT
+
"/svc/gfs-rest/get-download-link"
export
let
GDE_URL
=
DOMAIN
+
"/MobileGdeDev/svc/gfs-rest"
export
let
FOLDER_URL
=
DOMAIN
+
"/"
+
CONTEXTROOT
+
"/svc/gfs-rest/get-folder?parentPath=/Users/"
export
let
DOWNLOAD_URL
=
DOMAIN
+
"/"
+
CONTEXTROOT
+
"/svc/gfs-rest/get-download-link"
export
const
IS_RETRIEVE_FROM_GFS
=
"N"
export
const
INVALID_KEYS
=
"F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,PrintScreen,ScrollLock,Pause,PageUp,PageDown,Insert,Delete,Control"
//BPO CONFIG
export
const
IS_RETRIEVE_FROM_BPO
=
"N
"
export
const
IS_RETRIEVE_FROM_BPO
=
"Y
"
// export const BPO_URL = "http://35.171.20.94:8080/bpo-sqa/"
// export const CURRENT_NODE = "Web GDE"
export
const
BPO_URL
=
DOMAIN
+
"/bpo/"
;
export
const
CURRENT_NODE
=
"Mobile_GDE_DEV"
export
let
BPO_URL
=
DOMAIN
+
"bpo/"
;
// export const CURRENT_NODE = "Web_GDE_DEV"
export
let
CURRENT_NODE
=
""
export
const
ENCODING_PASS
=
"PASS1"
export
const
NEXT_NODE
=
"Complete"
export
const
EXCEPTION_NODE
=
"Exception"
export
const
SHOW_ELEMENT_LIST_VIEWER
=
"Y"
export
const
ADD_NEW_OPTION
=
"Y"
export
const
PDF_EXTENSION
=
".pdf"
export
const
JPG_EXTENSION
=
".jpg"
...
...
@@ -37,3 +41,12 @@ export const REASON_LIST = "Reason1,Reason2,Reason3,Reason4"
//KEYCLOAK CONFIG
window
.
REDIRECT_URL
=
'http://auth-server/auth/realms/GFS/protocol/openid-connect/logout?redirect_uri=encodedRedirectUri'
;
export
function
initializeConfig
(
domain
,
node
){
DOMAIN
=
domain
;
CURRENT_NODE
=
node
;
GDE_URL
=
DOMAIN
+
"MobileGdeDev/svc/gfs-rest"
FOLDER_URL
=
DOMAIN
+
CONTEXTROOT
+
"/svc/gfs-rest/get-folder?parentPath=/Users/"
DOWNLOAD_URL
=
DOMAIN
+
CONTEXTROOT
+
"/svc/gfs-rest/get-download-link"
BPO_URL
=
DOMAIN
+
"bpo/"
;
}
WebGde/WebContent/WebGde-Widgets/documentControlWidget/documentControlWidget.js
View file @
37cbdd37
import
{
createRejectWindow
}
from
'../BPO/rejectElement.js'
;
import
{
createReturnWindow
}
from
'../BPO/returnElement.js'
;
import
{
goBackToElementListViewer
}
from
'../ElementListWidget/ElementListWidget.js'
;
import
{
completeToNextNode
,
submitForm
}
from
'../Submit/submit.js'
;
import
{
IS_RETRIEVE_FROM_BPO
,
ROOT_FOLDER
}
from
'../config.js'
;
import
{
IS_RETRIEVE_FROM_BPO
,
ROOT_FOLDER
,
SHOW_ELEMENT_LIST_VIEWER
}
from
'../config.js'
;
import
{
createInfoModal
}
from
'../genericPopup/genericPopup.js'
;
import
{
BPO_OBJECT
,
DISPLAY_FIELD_OBJECT
,
DOCUMENT_CONTROL_OBJECT
,
IMAGE_VIEWER_OBJECT
,
INDEXED_DB_STORAGE
}
from
'../globalVariable.js'
;
...
...
@@ -60,7 +61,7 @@ export class DocumentControlWidget {
this
.
global
.
returnBtn
.
append
(
returnIcon
);
this
.
global
.
rejectBtn
.
append
(
rejectIcon
);
if
(
IS_RETRIEVE_FROM_BPO
===
"Y"
)
{
if
(
IS_RETRIEVE_FROM_BPO
===
"Y"
)
{
this
.
global
.
container
.
appendChild
(
this
.
global
.
submitBtn
);
this
.
global
.
container
.
appendChild
(
this
.
global
.
returnBtn
);
this
.
global
.
container
.
appendChild
(
this
.
global
.
rejectBtn
);
...
...
@@ -78,8 +79,15 @@ export class DocumentControlWidget {
if
(
isSuccessful
)
{
DISPLAY_FIELD_OBJECT
.
clearForm
();
if
(
SHOW_ELEMENT_LIST_VIEWER
===
"Y"
)
{
console
.
log
(
"PUMASOK DITO"
);
createInfoModal
(
goBackToElementListViewer
,
'ok'
,
'Form Submitted.'
);
}
else
{
createInfoModal
(
null
,
'ok'
,
'Form Submitted.'
);
if
(
IS_RETRIEVE_FROM_BPO
===
"Y"
){
}
if
(
IS_RETRIEVE_FROM_BPO
===
"Y"
)
{
let
response
=
await
completeToNextNode
(
sessionStorage
.
getItem
(
"element_id"
));
}
}
...
...
@@ -99,7 +107,7 @@ export class DocumentControlWidget {
return
this
.
global
.
container
;
}
getSubmitBtn
()
{
getSubmitBtn
()
{
return
this
.
global
.
submitBtn
;
}
...
...
WebGde/WebContent/WebGde-Widgets/genericPopup/genericPopup.js
View file @
37cbdd37
...
...
@@ -54,13 +54,13 @@ export function createModal(okButtonAction, popupTitleText) {
backdropContainer
.
appendChild
(
popupContainer
);
document
.
body
.
appendChild
(
backdropContainer
);
document
.
getElementById
(
"popupContainer"
).
style
.
display
=
"block"
;
document
.
getElementById
(
"okButton"
).
addEventListener
(
"click"
,
function
()
{
document
.
getElementById
(
"okButton"
).
addEventListener
(
"click"
,
function
()
{
document
.
getElementById
(
"backdropContainer"
).
style
.
display
=
"none"
;
if
(
typeof
okButtonAction
===
"function"
)
{
okButtonAction
();
}
});
document
.
getElementById
(
"cancelButton"
).
addEventListener
(
"click"
,
function
()
{
document
.
getElementById
(
"cancelButton"
).
addEventListener
(
"click"
,
function
()
{
document
.
getElementById
(
"backdropContainer"
).
remove
();
});
}
...
...
@@ -126,9 +126,11 @@ export function createInfoModal(okButtonAction, buttonTxt, popupTitleText) {
backdropContainer
.
appendChild
(
popupContainer
);
document
.
body
.
appendChild
(
backdropContainer
);
document
.
getElementById
(
"popupContainer"
).
style
.
display
=
"block"
;
document
.
getElementById
(
"okButton"
).
addEventListener
(
"click"
,
function
()
{
document
.
getElementById
(
"okButton"
).
addEventListener
(
"click"
,
function
()
{
console
.
log
(
"OK Button clicked!"
);
// This will let you know the button was clicked
document
.
getElementById
(
"backdropContainer"
).
style
.
display
=
"none"
;
if
(
typeof
okButtonAction
===
"function"
)
{
console
.
log
(
"YES"
);
okButtonAction
();
}
});
...
...
WebGde/WebContent/index.html
View file @
37cbdd37
...
...
@@ -10,7 +10,7 @@
<link
rel=
"stylesheet"
href=
"./WebGde-Widgets/ImageViewerWidget/modules/imageViewer/imageViewer.css"
>
<link
rel=
"stylesheet"
href=
"./WebGde-Widgets/ElementListWidget/ElementListWidget.css"
>
<link
id=
"loginStylesheet"
rel=
"stylesheet"
href=
"./WebGde-Widgets/LogInWidget/LoginStyle.css"
>
<script
type=
"module"
src=
"./s
cript
.js"
></script>
<script
type=
"module"
src=
"./s
tartup
.js"
></script>
<script
src=
"https://code.jquery.com/jquery-3.6.0.min.js"
integrity=
"sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin=
"anonymous"
></script>
<link
href=
"https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css"
rel=
"stylesheet"
/>
...
...
WebGde/WebContent/script.js
View file @
37cbdd37
...
...
@@ -6,12 +6,15 @@ import { DocumentControlWidget } from "./WebGde-Widgets/documentControlWidget/do
import
{
ElementListWidget
}
from
"./WebGde-Widgets/ElementListWidget/ElementListWidget.js"
;
// import { DocumentControlWidget } from "./WebGde-Widgets/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
"./WebGde-Widgets/globalVariable.js"
;
import
{
SHOW_ELEMENT_LIST_VIEWER
,
CURRENT_NODE
}
from
"./WebGde-Widgets/config.js"
;
import
{
fallbackLogin
}
from
"./WebGde-Widgets/LogInWidget/LoginJavaInterface.js"
;
document
.
addEventListener
(
"DOMContentLoaded"
,
function
()
{
const
LOG_IN_COMPONENT
=
new
LogInClass
(
startApplication
);
LOG_IN_COMPONENT
.
establishEventListeners
();
startApplication
();
});
startApplication
();
export
async
function
startApplication
()
{
createLoadingScreen
();
await
initializeWebGDE
();
...
...
@@ -44,24 +47,28 @@ async function initializeWebGDE() {
// UNCOMMENTED BY ADAM 9/25/2023
sessionStorage
.
setItem
(
"element_id"
,
"element1"
);
<<<<<<<
WebGde
/
WebContent
/
script
.
js
/* await createWebGdeInterface(null);*/
if
(
SHOW_ELEMENT_LIST_VIEWER
===
"Y"
)
{
setDocumentControlObject
(
new
DocumentControlWidget
());
/* document.getElementById("input-field-container").appendChild(DOCUMENT_CONTROL_OBJECT.getWidget());*/
=======
var
mainLogInScreenContainer
=
document
.
getElementById
(
"logInMainContainer"
);
if
(
mainLogInScreenContainer
){
mainLogInScreenContainer
.
remove
();
}
removeLoadingScreen
();
new
ElementListWidget
(
CURRENT_NODE
,
'containerId'
);
}
else
{
await
createWebGdeInterface
(
null
);
setDocumentControlObject
(
new
DocumentControlWidget
());
document
.
getElementById
(
"input-field-container"
).
appendChild
(
DOCUMENT_CONTROL_OBJECT
.
getWidget
());
>>>>>>>
WebGde
/
WebContent
/
script
.
js
var
mainLogInScreenContainer
=
document
.
getElementById
(
"logInMainContainer"
);
if
(
mainLogInScreenContainer
){
mainLogInScreenContainer
.
remove
();
}
removeLoadingScreen
();
// new ElementListWidget('Web_GDE_DEV', 'containerId');
}
}
export
async
function
createWebGdeInterface
(
GDEContainer
)
{
...
...
@@ -142,21 +149,12 @@ export function removeLoadingScreen() {
}
<<<<<<<
WebGde
/
WebContent
/
script
.
js
export
async
function
resetGDE
()
{
// TO-DO
}
function
init
()
{
console
.
log
(
"Application Started"
);
=======
export
async
function
resetGDE
(){
// TO-DO
}
function
init
(){
console
.
log
(
"Application Started"
);
>>>>>>>
WebGde
/
WebContent
/
script
.
js
}
...
...
WebGde/WebContent/startup.js
0 → 100644
View file @
37cbdd37
import
{
fallbackLogin
,
loginGde
}
from
"./WebGde-Widgets/LogInWidget/LoginJavaInterface.js"
;
const
scriptElement
=
document
.
createElement
(
"script"
);
scriptElement
.
type
=
"module"
;
scriptElement
.
src
=
"script.js"
;
document
.
addEventListener
(
"DOMContentLoaded"
,
function
()
{
window
.
fallbackLogin
=
fallbackLogin
;
window
.
loginGde
=
loginGde
;
// const LOG_IN_COMPONENT = new LogInClass(startApplication);
// LOG_IN_COMPONENT.establishEventListeners();
});
export
function
initializeWebpage
(){
document
.
head
.
appendChild
(
scriptElement
);
}
\ No newline at end of file
WebGde/WebContent/style.css
View file @
37cbdd37
...
...
@@ -290,7 +290,8 @@ input[type=radio] {
}
.image-capture
,
.fingerprint-capture
{
.fingerprint-capture
,
.file-upload
{
display
:
flex
;
flex-direction
:
column
;
width
:
100%
;
...
...
@@ -714,7 +715,8 @@ span#filename {
}
.image-capture
,
.fingerprint-capture
{
.fingerprint-capture
,
.file-upload
{
display
:
flex
;
flex-direction
:
column
;
width
:
100%
;
...
...
@@ -978,7 +980,7 @@ span#filename {
margin
:
2px
;
}
.reject-modal
{
.reject-modal
,
.return-modal
{
overflow
:
auto
;
background-color
:
#fff
;
position
:
absolute
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment