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
fa8b52ea
Commit
fa8b52ea
authored
Oct 09, 2023
by
Jhunel Adam Calub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finalize functionality of encode button commit
parent
d6146918
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
310 additions
and
282 deletions
+310
-282
ElementListWidget.js
...ent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
+31
-9
config.js
WebGde/WebContent/WebGde-Widgets/config.js
+22
-21
documentControlWidget.js
...de-Widgets/documentControlWidget/documentControlWidget.js
+112
-104
genericPopup.js
...de/WebContent/WebGde-Widgets/genericPopup/genericPopup.js
+128
-125
script.js
WebGde/WebContent/script.js
+17
-23
No files found.
WebGde/WebContent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
View file @
fa8b52ea
...
...
@@ -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"
);
...
...
@@ -209,6 +212,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 +234,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
);
if
(
!
assignResponse
.
successful
)
{
console
.
error
(
'Failed to assign element to worker:'
,
assignResponse
);
return
;
}
}
}
async
function
fetchWorkersForNode
(
nodeId
)
{
...
...
@@ -246,9 +254,23 @@ 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
)
{
const
response
=
await
fetch
(
`
${
API_ROOT
}
/workers/
${
workerId
}
/nodes/
${
nodeId
}
/elements/
${
queueIndex
}
`
);
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."
);
}
// Reinstantiate and reinitialize the ElementListWidget
new
ElementListWidget
(
'Web_GDE_DEV'
,
'containerId'
);
}
...
...
WebGde/WebContent/WebGde-Widgets/config.js
View file @
fa8b52ea
...
...
@@ -4,36 +4,37 @@ export const INPUT_FOLDER = "./input/"
export
const
OUTPUT_FILES
=
"../../output/"
export
const
METRIC_FILES
=
"../../metrics/"
export
const
METRIC_FILES
=
"../../metrics/"
export
const
HIGH_LIGHT_SCHEMA
=
"./WebGde-Widgets/sample_schema/dbSchema_anno.xlsx"
export
const
HIGH_LIGHT_SCHEMA
=
"./WebGde-Widgets/sample_schema/dbSchema_anno.xlsx"
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
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
const
IS_RETRIEVE_FROM_GFS
=
"N"
export
const
DOMAIN
=
"http://52.207.220.74:8080"
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
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"
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
const
ENCODING_PASS
=
"PASS1"
export
const
NEXT_NODE
=
"Complete"
export
const
EXCEPTION_NODE
=
"Exception"
export
const
PDF_EXTENSION
=
".pdf"
export
const
JPG_EXTENSION
=
".jpg"
export
const
PNG_EXTENSION
=
".png"
export
const
REASON_LIST
=
"Reason1,Reason2,Reason3,Reason4"
export
const
BPO_URL
=
DOMAIN
+
"/bpo/"
;
export
const
CURRENT_NODE
=
"Web_GDE_DEV"
export
const
ENCODING_PASS
=
"PASS1"
export
const
NEXT_NODE
=
"Complete"
export
const
EXCEPTION_NODE
=
"Exception"
export
const
SHOW_ELEMENT_LIST_VIEWER
=
"Y"
export
const
PDF_EXTENSION
=
".pdf"
export
const
JPG_EXTENSION
=
".jpg"
export
const
PNG_EXTENSION
=
".png"
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'
;
WebGde/WebContent/WebGde-Widgets/documentControlWidget/documentControlWidget.js
View file @
fa8b52ea
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'
;
export
class
DocumentControlWidget
{
global
=
{
container
:
null
,
submitBtn
:
null
,
returnBtn
:
null
,
rejectBtn
:
null
}
constructor
()
{
this
.
init
();
}
init
()
{
this
.
global
.
container
=
document
.
createElement
(
"div"
);
this
.
global
.
container
.
id
=
"TiffButtonRight"
;
this
.
global
.
container
.
classList
.
add
(
"ctrl-buttons"
)
this
.
global
.
submitBtn
=
document
.
createElement
(
"div"
);
this
.
global
.
submitBtn
.
title
=
"Submit"
;
this
.
global
.
submitBtn
.
classList
.
add
(
"buttonRightClass"
);
const
submitIcon
=
document
.
createElement
(
"img"
);
submitIcon
.
classList
.
add
(
"tiffViewerIcons"
);
submitIcon
.
src
=
"."
+
ROOT_FOLDER
+
"/documentControlWidget/assets/submit.png"
;
submitIcon
.
alt
=
"Submit"
;
submitIcon
.
height
=
"32"
;
submitIcon
.
width
=
"32"
;
this
.
global
.
returnBtn
=
document
.
createElement
(
"div"
);
this
.
global
.
returnBtn
.
title
=
"Return"
;
this
.
global
.
returnBtn
.
classList
.
add
(
"buttonRightClass"
);
const
returnIcon
=
document
.
createElement
(
"img"
);
returnIcon
.
classList
.
add
(
"tiffViewerIcons"
);
returnIcon
.
src
=
"."
+
ROOT_FOLDER
+
"/documentControlWidget/assets/return_icon.png"
;
returnIcon
.
alt
=
"Return"
;
returnIcon
.
height
=
"32"
;
returnIcon
.
width
=
"32"
;
this
.
global
.
rejectBtn
=
document
.
createElement
(
"div"
);
this
.
global
.
rejectBtn
.
title
=
"Reject"
;
this
.
global
.
rejectBtn
.
classList
.
add
(
"buttonRightClass"
);
const
rejectIcon
=
document
.
createElement
(
"img"
);
rejectIcon
.
classList
.
add
(
"tiffViewerIcons"
);
rejectIcon
.
src
=
"."
+
ROOT_FOLDER
+
"/documentControlWidget/assets/reject_icon.png"
;
rejectIcon
.
alt
=
"Reject"
;
rejectIcon
.
height
=
"32"
;
rejectIcon
.
width
=
"32"
;
this
.
global
.
submitBtn
.
append
(
submitIcon
);
this
.
global
.
returnBtn
.
append
(
returnIcon
);
this
.
global
.
rejectBtn
.
append
(
rejectIcon
);
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
);
}
else
{
this
.
global
.
container
.
appendChild
(
this
.
global
.
submitBtn
);
}
this
.
addEvenListeners
();
}
addEvenListeners
()
{
this
.
global
.
submitBtn
.
onclick
=
async
(
e
)
=>
{
let
isSuccessful
=
await
submitForm
(
e
);
if
(
isSuccessful
)
{
DISPLAY_FIELD_OBJECT
.
clearForm
();
createInfoModal
(
null
,
'ok'
,
'Form Submitted.'
);
if
(
IS_RETRIEVE_FROM_BPO
===
"Y"
){
let
response
=
await
completeToNextNode
(
sessionStorage
.
getItem
(
"element_id"
));
}
}
}
this
.
global
.
returnBtn
.
onclick
=
(
e
)
=>
{
createReturnWindow
();
}
this
.
global
.
rejectBtn
.
onclick
=
(
e
)
=>
{
createRejectWindow
();
}
}
getWidget
()
{
return
this
.
global
.
container
;
}
getSubmitBtn
(){
return
this
.
global
.
submitBtn
;
}
getReturnBtn
()
{
return
this
.
global
.
returnBtn
;
}
getRejectBtn
()
{
return
this
.
global
.
rejectBtn
;
}
global
=
{
container
:
null
,
submitBtn
:
null
,
returnBtn
:
null
,
rejectBtn
:
null
}
constructor
()
{
this
.
init
();
}
init
()
{
this
.
global
.
container
=
document
.
createElement
(
"div"
);
this
.
global
.
container
.
id
=
"TiffButtonRight"
;
this
.
global
.
container
.
classList
.
add
(
"ctrl-buttons"
)
this
.
global
.
submitBtn
=
document
.
createElement
(
"div"
);
this
.
global
.
submitBtn
.
title
=
"Submit"
;
this
.
global
.
submitBtn
.
classList
.
add
(
"buttonRightClass"
);
const
submitIcon
=
document
.
createElement
(
"img"
);
submitIcon
.
classList
.
add
(
"tiffViewerIcons"
);
submitIcon
.
src
=
"."
+
ROOT_FOLDER
+
"/documentControlWidget/assets/submit.png"
;
submitIcon
.
alt
=
"Submit"
;
submitIcon
.
height
=
"32"
;
submitIcon
.
width
=
"32"
;
this
.
global
.
returnBtn
=
document
.
createElement
(
"div"
);
this
.
global
.
returnBtn
.
title
=
"Return"
;
this
.
global
.
returnBtn
.
classList
.
add
(
"buttonRightClass"
);
const
returnIcon
=
document
.
createElement
(
"img"
);
returnIcon
.
classList
.
add
(
"tiffViewerIcons"
);
returnIcon
.
src
=
"."
+
ROOT_FOLDER
+
"/documentControlWidget/assets/return_icon.png"
;
returnIcon
.
alt
=
"Return"
;
returnIcon
.
height
=
"32"
;
returnIcon
.
width
=
"32"
;
this
.
global
.
rejectBtn
=
document
.
createElement
(
"div"
);
this
.
global
.
rejectBtn
.
title
=
"Reject"
;
this
.
global
.
rejectBtn
.
classList
.
add
(
"buttonRightClass"
);
const
rejectIcon
=
document
.
createElement
(
"img"
);
rejectIcon
.
classList
.
add
(
"tiffViewerIcons"
);
rejectIcon
.
src
=
"."
+
ROOT_FOLDER
+
"/documentControlWidget/assets/reject_icon.png"
;
rejectIcon
.
alt
=
"Reject"
;
rejectIcon
.
height
=
"32"
;
rejectIcon
.
width
=
"32"
;
this
.
global
.
submitBtn
.
append
(
submitIcon
);
this
.
global
.
returnBtn
.
append
(
returnIcon
);
this
.
global
.
rejectBtn
.
append
(
rejectIcon
);
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
);
}
else
{
this
.
global
.
container
.
appendChild
(
this
.
global
.
submitBtn
);
}
this
.
addEvenListeners
();
}
addEvenListeners
()
{
this
.
global
.
submitBtn
.
onclick
=
async
(
e
)
=>
{
let
isSuccessful
=
await
submitForm
(
e
);
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"
)
{
let
response
=
await
completeToNextNode
(
sessionStorage
.
getItem
(
"element_id"
));
}
}
}
this
.
global
.
returnBtn
.
onclick
=
(
e
)
=>
{
createReturnWindow
();
}
this
.
global
.
rejectBtn
.
onclick
=
(
e
)
=>
{
createRejectWindow
();
}
}
getWidget
()
{
return
this
.
global
.
container
;
}
getSubmitBtn
()
{
return
this
.
global
.
submitBtn
;
}
getReturnBtn
()
{
return
this
.
global
.
returnBtn
;
}
getRejectBtn
()
{
return
this
.
global
.
rejectBtn
;
}
}
WebGde/WebContent/WebGde-Widgets/genericPopup/genericPopup.js
View file @
fa8b52ea
This diff is collapsed.
Click to expand it.
WebGde/WebContent/script.js
View file @
fa8b52ea
...
...
@@ -44,24 +44,26 @@ async function initializeWebGDE() {
// UNCOMMENTED BY ADAM 9/25/2023
sessionStorage
.
setItem
(
"element_id"
,
"element1"
);
<<<<<<<
WebGde
/
WebContent
/
script
.
js
/* await createWebGdeInterface(null);*/
setDocumentControlObject
(
new
DocumentControlWidget
());
/* document.getElementById("input-field-container").appendChild(DOCUMENT_CONTROL_OBJECT.getWidget());*/
=======
await
createWebGdeInterface
(
null
);
setDocumentControlObject
(
new
DocumentControlWidget
());
document
.
getElementById
(
"input-field-container"
).
appendChild
(
DOCUMENT_CONTROL_OBJECT
.
getWidget
());
>>>>>>>
WebGde
/
WebContent
/
script
.
js
if
(
SHOW_ELEMENT_LIST_VIEWER
===
"Y"
)
{
/* await createWebGdeInterface(null);*/
setDocumentControlObject
(
new
DocumentControlWidget
());
/* document.getElementById("input-field-container").appendChild(DOCUMENT_CONTROL_OBJECT.getWidget());*/
var
mainLogInScreenContainer
=
document
.
getElementById
(
"logInMainContainer"
);
mainLogInScreenContainer
.
remove
();
removeLoadingScreen
();
var
mainLogInScreenContainer
=
document
.
getElementById
(
"logInMainContainer"
);
mainLogInScreenContainer
.
remove
();
removeLoadingScreen
();
// new ElementListWidget('Web_GDE_DEV', 'containerId');
new
ElementListWidget
(
'Web_GDE_DEV'
,
'containerId'
);
}
else
{
await
createWebGdeInterface
(
null
);
setDocumentControlObject
(
new
DocumentControlWidget
());
document
.
getElementById
(
"input-field-container"
).
appendChild
(
DOCUMENT_CONTROL_OBJECT
.
getWidget
());
var
mainLogInScreenContainer
=
document
.
getElementById
(
"logInMainContainer"
);
mainLogInScreenContainer
.
remove
();
removeLoadingScreen
();
}
}
export
async
function
createWebGdeInterface
(
GDEContainer
)
{
...
...
@@ -142,21 +144,13 @@ 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
}
...
...
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