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
5e66b7cb
Commit
5e66b7cb
authored
Jul 11, 2023
by
Lynette Lizardo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
ace4beeb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
59 deletions
+74
-59
getElement.js
WebGde/WebContent/WebGde-Widgets/BPO/getElement.js
+18
-9
generateFields.js
...bContent/WebGde-Widgets/DataInputWidget/generateFields.js
+24
-23
XML_Saver.js
...e/WebContent/WebGde-Widgets/Submit/XMLWriter/XML_Saver.js
+12
-12
config.js
WebGde/WebContent/WebGde-Widgets/config.js
+3
-3
documentControlWidget.js
...de-Widgets/documentControlWidget/documentControlWidget.js
+17
-12
script.js
WebGde/WebContent/script.js
+0
-0
No files found.
WebGde/WebContent/WebGde-Widgets/BPO/getElement.js
View file @
5e66b7cb
...
@@ -18,8 +18,8 @@ export class BPO {
...
@@ -18,8 +18,8 @@ export class BPO {
if
(
xml
.
isExisting
)
{
if
(
xml
.
isExisting
)
{
const
xmlString
=
await
xml
.
data
.
join
(
''
).
replace
(
'
\
t'
,
''
);
const
xmlString
=
await
xml
.
data
.
join
(
''
).
replace
(
'
\
t'
,
''
);
//const lastImage =
getXmlLastImage(xmlString);
const
lastImage
=
this
.
getXmlLastImage
(
xmlString
);
console
.
log
(
"lastImage "
+
lastImage
);
/*sessionStorage.setItem('section', getXmlSection(xmlString));
/*sessionStorage.setItem('section', getXmlSection(xmlString));
sessionStorage.setItem('doctype', getXmlDocType(xmlString));*/
sessionStorage.setItem('doctype', getXmlDocType(xmlString));*/
...
@@ -164,6 +164,15 @@ export class BPO {
...
@@ -164,6 +164,15 @@ export class BPO {
return
null
;
return
null
;
}
}
}
}
getXmlLastImage
(
xmlString
)
{
const
parser
=
new
DOMParser
();
const
xmlDoc
=
parser
.
parseFromString
(
xmlString
,
"text/xml"
);
let
lastRecordIndex
=
xmlDoc
.
getElementsByTagName
(
"record"
).
length
-
1
;
let
lastRecord
=
xmlDoc
.
getElementsByTagName
(
"record"
)[
lastRecordIndex
];
return
lastRecord
.
getElementsByTagName
(
"imagename"
)[
0
].
childNodes
[
0
].
nodeValue
;
}
}
}
...
@@ -187,14 +196,14 @@ function formatDirectory(dir) {
...
@@ -187,14 +196,14 @@ function formatDirectory(dir) {
}
}
function getXmlLastImage(xmlString) {
//
function getXmlLastImage(xmlString) {
const parser = new DOMParser();
//
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(xmlString, "
text
/
xml
");
//
const xmlDoc = parser.parseFromString(xmlString, "
text
/
xml
");
let lastRecordIndex = xmlDoc.getElementsByTagName("
record
").length - 1;
//
let lastRecordIndex = xmlDoc.getElementsByTagName("
record
").length - 1;
let lastRecord = xmlDoc.getElementsByTagName("
record
")[lastRecordIndex];
//
let lastRecord = xmlDoc.getElementsByTagName("
record
")[lastRecordIndex];
return lastRecord.getElementsByTagName("
imagename
")[0].childNodes[0].nodeValue;
//
return lastRecord.getElementsByTagName("
imagename
")[0].childNodes[0].nodeValue;
}
//
}
function getXmlSection(xmlString) {
function getXmlSection(xmlString) {
const parser = new DOMParser();
const parser = new DOMParser();
...
...
WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
View file @
5e66b7cb
...
@@ -45,7 +45,7 @@ export async function generateFields(inputSchema, containerId) {
...
@@ -45,7 +45,7 @@ export async function generateFields(inputSchema, containerId) {
container
.
id
=
"fields"
;
container
.
id
=
"fields"
;
divContainer
.
appendChild
(
container
);
divContainer
.
appendChild
(
container
);
container
.
addEventListener
(
"submit"
,
(
e
)
=>
submitForm
(
e
));
//
container.addEventListener("submit", (e) => submitForm(e));
let
doctype
=
sessionStorage
.
getItem
(
'doctype'
);
let
doctype
=
sessionStorage
.
getItem
(
'doctype'
);
let
section
=
sessionStorage
.
getItem
(
'section'
);
let
section
=
sessionStorage
.
getItem
(
'section'
);
...
@@ -73,13 +73,13 @@ export async function generateFields(inputSchema, containerId) {
...
@@ -73,13 +73,13 @@ export async function generateFields(inputSchema, containerId) {
createSection
(
'Section'
,
container
,
doctypes
,
underscoredKey
);
createSection
(
'Section'
,
container
,
doctypes
,
underscoredKey
);
const
promise
=
deconstruct
(
doctypes
[
sec
],
container
,
underscoredSec
);
const
promise
=
deconstruct
(
doctypes
[
sec
],
container
,
underscoredSec
);
sectionPromises
.
push
(
promise
);
sectionPromises
.
push
(
promise
);
const
submit
=
document
.
createElement
(
'input'
);
//
const submit = document.createElement('input');
submit
.
setAttribute
(
'id'
,
'submitButton'
);
//
submit.setAttribute('id', 'submitButton');
submit
.
classList
.
add
(
"submitButtons"
);
//
submit.classList.add("submitButtons");
submit
.
classList
.
add
(
underscoredSec
);
//
submit.classList.add(underscoredSec);
submit
.
type
=
'submit'
;
//
submit.type = 'submit';
console
.
log
(
container
);
//
console.log(container);
container
.
appendChild
(
submit
);
//
container.appendChild(submit);
return
false
return
false
}
}
});
});
...
@@ -100,11 +100,11 @@ export async function generateFields(inputSchema, containerId) {
...
@@ -100,11 +100,11 @@ export async function generateFields(inputSchema, containerId) {
createDocTypeDropdown
(
'DocType'
,
container
,
schema
,
doctype
);
createDocTypeDropdown
(
'DocType'
,
container
,
schema
,
doctype
);
createSection
(
'Section'
,
container
,
doctypes
,
underscoredDoctype
,
section
);
createSection
(
'Section'
,
container
,
doctypes
,
underscoredDoctype
,
section
);
container
=
await
deconstruct
(
doctypes
[
section
],
container
,
underscoredSection
)
container
=
await
deconstruct
(
doctypes
[
section
],
container
,
underscoredSection
)
const
submit
=
document
.
createElement
(
'input'
)
//
const submit = document.createElement('input')
submit
.
classList
.
add
(
"submitButtons"
);
//
submit.classList.add("submitButtons");
submit
.
classList
.
add
(
underscoredSection
);
//
submit.classList.add(underscoredSection);
submit
.
type
=
'submit'
//
submit.type = 'submit'
container
.
appendChild
(
submit
)
//
container.appendChild(submit)
const
fields
=
sessionStorage
.
getItem
(
"fields"
);
const
fields
=
sessionStorage
.
getItem
(
"fields"
);
if
(
fields
)
{
if
(
fields
)
{
...
@@ -149,11 +149,11 @@ export async function generateFields(inputSchema, containerId) {
...
@@ -149,11 +149,11 @@ export async function generateFields(inputSchema, containerId) {
createSection
(
'Section'
,
container
,
doctypes
,
underscoredValue
);
createSection
(
'Section'
,
container
,
doctypes
,
underscoredValue
);
container
=
await
deconstruct
(
doctypes
[
key
],
container
,
underscoredKey
)
container
=
await
deconstruct
(
doctypes
[
key
],
container
,
underscoredKey
)
const
submit
=
document
.
createElement
(
'input'
)
//
const submit = document.createElement('input')
submit
.
classList
.
add
(
"submitButtons"
);
//
submit.classList.add("submitButtons");
submit
.
classList
.
add
(
underscoredKey
);
//
submit.classList.add(underscoredKey);
submit
.
type
=
'submit'
//
submit.type = 'submit'
container
.
appendChild
(
submit
)
//
container.appendChild(submit)
break
;
break
;
}
}
});
});
...
@@ -169,11 +169,11 @@ export async function generateFields(inputSchema, containerId) {
...
@@ -169,11 +169,11 @@ export async function generateFields(inputSchema, containerId) {
sessionStorage
.
setItem
(
"currentSection"
,
underscoredKey
);
sessionStorage
.
setItem
(
"currentSection"
,
underscoredKey
);
container
=
await
deconstruct
(
schema
[
sessionStorage
.
getItem
(
"currentDoctype"
).
replaceAll
(
"_"
,
" "
)][
this
.
value
],
container
,
underscoredKey
)
container
=
await
deconstruct
(
schema
[
sessionStorage
.
getItem
(
"currentDoctype"
).
replaceAll
(
"_"
,
" "
)][
this
.
value
],
container
,
underscoredKey
)
const
submit
=
document
.
createElement
(
'input'
)
//
const submit = document.createElement('input')
submit
.
classList
.
add
(
"submitButtons"
);
//
submit.classList.add("submitButtons");
submit
.
classList
.
add
(
underscoredKey
);
//
submit.classList.add(underscoredKey);
submit
.
type
=
'submit'
//
submit.type = 'submit'
container
.
appendChild
(
submit
)
//
container.appendChild(submit)
});
});
...
@@ -843,6 +843,7 @@ export async function populateFields(imagePath) {
...
@@ -843,6 +843,7 @@ export async function populateFields(imagePath) {
for
(
let
i
=
0
;
i
<
document
.
getElementById
(
"Section"
).
options
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
document
.
getElementById
(
"Section"
).
options
.
length
;
i
++
)
{
if
(
document
.
getElementById
(
"Section"
).
options
[
i
].
value
==
section
)
{
if
(
document
.
getElementById
(
"Section"
).
options
[
i
].
value
==
section
)
{
document
.
getElementById
(
"Section"
).
options
[
i
].
selected
=
"selected"
document
.
getElementById
(
"Section"
).
options
[
i
].
selected
=
"selected"
section
.
trigger
(
'change'
);
}
}
}
}
...
...
WebGde/WebContent/WebGde-Widgets/Submit/XMLWriter/XML_Saver.js
View file @
5e66b7cb
...
@@ -69,17 +69,17 @@ async function createOutputXml(fields, metrics, doctype, section) {
...
@@ -69,17 +69,17 @@ async function createOutputXml(fields, metrics, doctype, section) {
body
:
JSON
.
stringify
(
xmlData
)
body
:
JSON
.
stringify
(
xmlData
)
});
});
if
(
localStorage
.
getItem
(
"complete"
)
==
1
)
{
if
(
completenessCheck
(
await
response
.
text
()))
{
if
(
completenessCheck
(
await
response
.
text
()))
{
let
response
=
await
fetch
(
urlUpdateEob
,
{
let
response
=
await
fetch
(
urlUpdateEob
,
{
method
:
"POST"
,
method
:
"POST"
,
headers
:
{
headers
:
{
'Content-Type'
:
'application/json'
'Content-Type'
:
'application/json'
},
},
body
:
JSON
.
stringify
(
xmlData
)
body
:
JSON
.
stringify
(
xmlData
)
});
});
await
completeToNextNode
(
elementId
);
await
completeToNextNode
(
elementId
);
sessionStorage
.
setItem
(
"isElementComplete"
,
true
);
}
}
}
}
}
WebGde/WebContent/WebGde-Widgets/config.js
View file @
5e66b7cb
...
@@ -38,9 +38,9 @@ export const HIGH_LIGHT_SCHEMA = "./WebGde-Widgets/sample_schema/dbSchema_anno.
...
@@ -38,9 +38,9 @@ export const HIGH_LIGHT_SCHEMA = "./WebGde-Widgets/sample_schema/dbSchema_anno.
export
const
ROOT_FOLDER
=
"/WebGde-Widgets"
;
export
const
ROOT_FOLDER
=
"/WebGde-Widgets"
;
//this determines if the images will be retrieved from the gfs
//this determines if the images will be retrieved from the gfs
export
const
DOMAIN
=
"http://
3.86.87.78
:8080"
export
const
DOMAIN
=
"http://
44.211.171.103
:8080"
export
const
CONTEXTROOT
=
"gfs-explorer-ws"
export
const
CONTEXTROOT
=
"gfs-explorer-ws"
export
const
GFS_URL
=
"http://
3.86.87.78
:8080"
+
"/WebGde/svc/gfs-rest"
export
const
GFS_URL
=
"http://
44.211.171.103
:8080"
+
"/WebGde/svc/gfs-rest"
export
const
FOLDER_URL
=
DOMAIN
+
"/"
+
CONTEXTROOT
+
"/svc/gfs-rest/get-folder?parentPath=/Users/"
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
DOWNLOAD_URL
=
DOMAIN
+
"/"
+
CONTEXTROOT
+
"/svc/gfs-rest/get-download-link"
export
const
IS_RETRIEVE_FROM_GFS
=
"N"
export
const
IS_RETRIEVE_FROM_GFS
=
"N"
...
@@ -51,7 +51,7 @@ export const INVALID_KEYS = "F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,PrintScreen
...
@@ -51,7 +51,7 @@ export const INVALID_KEYS = "F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,PrintScreen
export
const
IS_RETRIEVE_FROM_BPO
=
"Y"
export
const
IS_RETRIEVE_FROM_BPO
=
"Y"
// export const BPO_URL = "http://35.171.20.94:8080/bpo-sqa/"
// export const BPO_URL = "http://35.171.20.94:8080/bpo-sqa/"
// export const CURRENT_NODE = "Web GDE"
// export const CURRENT_NODE = "Web GDE"
export
const
BPO_URL
=
"http://
3.86.87.78
:8080/bpo/"
export
const
BPO_URL
=
"http://
44.211.171.103
:8080/bpo/"
export
const
CURRENT_NODE
=
"Web_GDE_DEV"
export
const
CURRENT_NODE
=
"Web_GDE_DEV"
export
const
ENCODING_PASS
=
"PASS1"
export
const
ENCODING_PASS
=
"PASS1"
export
const
NEXT_NODE
=
"Complete"
export
const
NEXT_NODE
=
"Complete"
...
...
WebGde/WebContent/WebGde-Widgets/documentControlWidget/documentControlWidget.js
View file @
5e66b7cb
import
{
createLoadingScreen
,
removeLoadingScreen
,
resetGDE
}
from
'../../script.js'
;
import
{
createLoadingScreen
,
displayNextRecord
,
removeLoadingScreen
,
resetGDE
}
from
'../../script.js'
;
import
{
createRejectWindow
}
from
'../BPO/rejectElement.js'
;
import
{
createRejectWindow
}
from
'../BPO/rejectElement.js'
;
import
{
createReturnWindow
,
returnElementBPO
}
from
'../BPO/returnElement.js'
;
import
{
createReturnWindow
,
returnElementBPO
}
from
'../BPO/returnElement.js'
;
import
{
completeToNextNode
,
submitForm
}
from
'../Submit/submit.js'
;
import
{
completeToNextNode
,
submitForm
}
from
'../Submit/submit.js'
;
...
@@ -126,14 +126,17 @@ export class DocumentControlWidget {
...
@@ -126,14 +126,17 @@ export class DocumentControlWidget {
let
currentDisplay
=
parseInt
(
sessionStorage
.
getItem
(
"display_counter"
));
let
currentDisplay
=
parseInt
(
sessionStorage
.
getItem
(
"display_counter"
));
let
totalRecord
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"dir_files"
)).
length
;
let
totalRecord
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"dir_files"
)).
length
;
if
(
currentDisplay
+
1
===
totalRecord
)
{
//if (currentDisplay + 1 === totalRecord) {
if
(
sessionStorage
.
getItem
(
"isElementComplete"
)){
//move element then fetch new element
//move element then fetch new element
let
response
=
await
completeToNextNode
(
sessionStorage
.
getItem
(
"element_id"
));
//
let response = await completeToNextNode(sessionStorage.getItem("element_id"));
createLoadingScreen
();
createLoadingScreen
();
const
metrics
=
stopMetricCapture
();
let
eoe_ts
=
new
Date
().
toLocaleString
();
await
saveMetrics
(
metrics
,
eoe_ts
);
if
(
response
.
status
==
200
)
{
if
(
response
.
status
==
200
)
{
if
(
await
BPO_OBJECT
.
getRandomWaitingElement
())
{
if
(
await
BPO_OBJECT
.
getRandomWaitingElement
())
{
const
metrics
=
stopMetricCapture
();
await
saveMetrics
(
metrics
,
eoe_ts
);
document
.
getElementById
(
"counter"
).
innerHTML
=
""
;
document
.
getElementById
(
"counter"
).
innerHTML
=
""
;
clearTimeout
(
interval
);
clearTimeout
(
interval
);
resetGDE
();
resetGDE
();
...
@@ -144,13 +147,15 @@ export class DocumentControlWidget {
...
@@ -144,13 +147,15 @@ export class DocumentControlWidget {
}
}
}
else
{
}
else
{
document
.
getElementById
(
"nextRecordImage"
).
click
();
// document.getElementById("nextRecordImage").click();
DISPLAY_FIELD_OBJECT
.
generateFields
();
//DISPLAY_FIELD_OBJECT.generateFields();
document
.
getElementById
(
"input-field-container"
).
appendChild
(
DOCUMENT_CONTROL_OBJECT
.
getWidget
());
DISPLAY_FIELD_OBJECT
.
clearForm
();
displayNextRecord
();
DISPLAY_FIELD_OBJECT
.
updateHeaderText
(
0
,
"User: "
+
sessionStorage
.
getItem
(
"user_id"
));
//document.getElementById("input-field-container").appendChild(DOCUMENT_CONTROL_OBJECT.getWidget());
DISPLAY_FIELD_OBJECT
.
updateHeaderText
(
1
,
"Element ID: "
+
sessionStorage
.
getItem
(
"element_id"
));
DISPLAY_FIELD_OBJECT
.
updateHeaderText
(
2
,
""
);
// DISPLAY_FIELD_OBJECT.updateHeaderText(0, "User: " + sessionStorage.getItem("user_id"));
// DISPLAY_FIELD_OBJECT.updateHeaderText(1, "Element ID: " + sessionStorage.getItem("element_id"));
// DISPLAY_FIELD_OBJECT.updateHeaderText(2, "");
}
}
}
}
...
...
WebGde/WebContent/script.js
View file @
5e66b7cb
This diff is collapsed.
Click to expand it.
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