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
92b796ba
Commit
92b796ba
authored
Sep 21, 2023
by
Leonard Ambros II
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Feature-WG-392' into 'development'
Feature wg 392 See merge request
!64
parents
31cb68eb
ba6f07c0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
51 deletions
+75
-51
generateFields.js
...bContent/WebGde-Widgets/DataInputWidget/generateFields.js
+63
-39
XML_Saver.js
...e/WebContent/WebGde-Widgets/Submit/XMLWriter/XML_Saver.js
+2
-2
submit.js
WebGde/WebContent/WebGde-Widgets/Submit/submit.js
+3
-3
config.js
WebGde/WebContent/WebGde-Widgets/config.js
+1
-1
NKTI_Schema.json
.../WebContent/WebGde-Widgets/sample_schema/NKTI_Schema.json
+6
-6
No files found.
WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
View file @
92b796ba
...
...
@@ -465,6 +465,7 @@ const inputChecklist = (key, validation) => {
dropdown1
.
classList
.
add
(
'dropdown'
);
var
dropdownContent
=
document
.
createElement
(
'div'
);
dropdownContent
.
classList
.
add
(
'dropdown-content'
);
dropdownContent
.
setAttribute
(
'id'
,
`checklistContainer_
${
key
}
`
);
dropdown1
.
appendChild
(
dropdownContent
);
var
isOther
=
false
;
...
...
@@ -484,12 +485,8 @@ const inputChecklist = (key, validation) => {
if
(
index
==
0
)
{
checkbox
.
classList
.
add
(
"checkboxFirst"
);
checkbox
.
setAttribute
(
'id'
,
`
${
key
}
`
);
<<<<<<<
WebGde
/
WebContent
/
WebGde
-
Widgets
/
DataInputWidget
/
generateFields
.
js
}
=======
}
>>>>>>>
WebGde
/
WebContent
/
WebGde
-
Widgets
/
DataInputWidget
/
generateFields
.
js
}
div
.
appendChild
(
checkbox
);
var
label
=
document
.
createTextNode
(
item
);
div
.
appendChild
(
label
);
...
...
@@ -578,20 +575,12 @@ const inputRadiolist = (key, validation) => {
radio
.
type
=
'radio'
;
radio
.
name
=
`radioChoices_
${
key
}
`
;
radio
.
classList
.
add
(
"radioOption"
);
<<<<<<<
WebGde
/
WebContent
/
WebGde
-
Widgets
/
DataInputWidget
/
generateFields
.
js
radio
.
name
=
`radioChoices_
${
key
}
`
;
=======
>>>>>>>
WebGde
/
WebContent
/
WebGde
-
Widgets
/
DataInputWidget
/
generateFields
.
js
radio
.
value
=
item
;
if
(
index
==
0
)
{
radio
.
classList
.
add
(
'radioFirst'
);
radio
.
setAttribute
(
'id'
,
`
${
key
}
`
);
}
<<<<<<<
WebGde
/
WebContent
/
WebGde
-
Widgets
/
DataInputWidget
/
generateFields
.
js
=======
>>>>>>>
WebGde
/
WebContent
/
WebGde
-
Widgets
/
DataInputWidget
/
generateFields
.
js
var
label
=
document
.
createTextNode
(
item
);
radioDiv
.
appendChild
(
radio
);
radioDiv
.
appendChild
(
label
);
...
...
@@ -669,8 +658,10 @@ const inputDropdown = (key, validation) => {
input
.
addEventListener
(
'keydown'
,
function
(
event
)
{
if
(
event
.
keyCode
==
9
)
{
event
.
preventDefault
();
var
elem
=
document
.
getElementsByClassName
(
'select2-search__field'
);
elem
.
focus
();
//var elem = document.getElementsByClassName('select2-search__field');
//elem.focus();
const
dropdownField
=
document
.
getElementById
(
`
${
key
}
`
);
dropdownField
.
blur
();
}
});
...
...
@@ -713,8 +704,10 @@ const inputDbLookup = async (key, validation) => {
input
.
addEventListener
(
'keydown'
,
function
(
event
)
{
if
(
event
.
keyCode
==
9
)
{
event
.
preventDefault
();
var
elem
=
document
.
getElementsByClassName
(
'select2-search__field'
);
elem
.
focus
();
//var elem = document.getElementsByClassName('select2-search__field');
//elem.focus();
const
dropdownDbLookup
=
document
.
getElementById
(
`
${
key
}
`
);
dropdownDbLookup
.
blur
();
}
});
...
...
@@ -1162,7 +1155,7 @@ export async function populateFields(imagePath) {
const
sectionElem
=
$
(
"Section"
);
for
(
let
i
=
0
;
i
<
document
.
getElementById
(
"Section"
).
options
.
length
;
i
++
)
{
if
(
document
.
getElementById
(
"Section"
).
options
[
i
].
value
==
section
)
{
document
.
getElementById
(
"Section"
).
options
[
i
].
selected
=
"selected"
document
.
getElementById
(
"Section"
).
options
[
i
].
selected
=
"selected"
;
if
(
sectionElem
[
0
]){
sectionElem
.
trigger
(
'change'
);
}
...
...
@@ -1176,7 +1169,7 @@ export async function populateFields(imagePath) {
sessionStorage
.
setItem
(
"doctype"
,
doctype
);
for
(
let
i
=
0
;
i
<
document
.
getElementById
(
"DocType"
).
options
.
length
;
i
++
)
{
if
(
document
.
getElementById
(
"DocType"
).
options
[
i
].
value
==
doctype
)
{
document
.
getElementById
(
"DocType"
).
options
[
i
].
selected
=
"selected"
document
.
getElementById
(
"DocType"
).
options
[
i
].
selected
=
"selected"
;
}
}
...
...
@@ -1193,55 +1186,79 @@ export async function populateFields(imagePath) {
if
(
field
==
"fields"
)
{
let
fieldsobj
=
currForm
[
field
];
//console.log(fieldsobj);
for
(
let
[
k
,
v
]
of
Object
.
entries
(
fieldsobj
))
{
for
(
let
key
of
Object
.
keys
(
schema
[
doctype
][
section
]))
{
if
(
schema
[
doctype
][
section
][
key
].
aka
==
"field"
+
k
)
{
console
.
log
(
"key = "
+
key
);
console
.
log
(
"validation: "
+
schema
[
doctype
][
section
][
key
].
validation
.
collection
);
//
console.log("key = " + key);
//
console.log("validation: " + schema[doctype][section][key].validation.collection);
fields
[
"field"
+
k
]
=
v
;
//var fieldId = schema[doctype][section][key].fieldLabel;
//var currId = fieldId.replaceAll(" ", "_");
//console.log(fieldId);
//console.log(currId);
console
.
log
(
v
);
//document.getElementById(currId).value = v;
if
(
schema
[
doctype
][
section
][
key
].
validation
.
collection
===
'radiolist'
){
console
.
log
(
"RADIOLIST"
);
//retrieve the radio button value from the XML
const
radioButton
=
document
.
querySelector
(
`input[value="
${
v
}
"]`
);
const
radioButton
=
document
.
querySelector
(
`
#dropdownContainer_
${
key
}
input[value="
${
v
}
"]`
);
if
(
radioButton
){
radioButton
.
checked
=
true
;
}
else
{
//const radOther1 = document.querySelector(`#radiochoices_${key} input[value="other"]`);
const
radOther1
=
document
.
querySelector
(
`#dropdownContainer_
${
key
}
input[value="other"]`
);
if
(
radOther1
){
radOther1
.
checked
=
true
;
}
//const radOther2 = document.querySelector(`#radiochoices_${key} input[value="others"]`);
const
radOther2
=
document
.
querySelector
(
`#dropdownContainer_
${
key
}
input[value="others"]`
);
if
(
radOther2
){
radOther2
.
checked
=
true
;
}
document
.
getElementById
(
`dependentTB_
${
key
}
`
).
value
=
v
;
document
.
getElementById
(
`dependentTB_
${
key
}
`
).
style
.
display
=
'inline-block'
document
.
getElementById
(
`dependentTB_
${
key
}
`
).
style
.
display
=
'inline-block'
;
}
}
else
if
(
schema
[
doctype
][
section
][
key
].
validation
.
collection
===
'checklist'
)
{
const
checklistArrayValues
=
v
.
split
(
","
);
let
otherValues
=
""
;
let
isFirstCheckboxOtherValue
=
true
;
let
checkboxOtherValue
=
""
;
for
(
let
checklistValue
of
checklistArrayValues
){
console
.
log
(
"Array Values: "
+
checklistValue
);
const
checklistbox
=
document
.
querySelector
(
`#checklistContainer_
${
key
}
input[value="
${
checklistValue
}
"]`
);
if
(
checklistbox
){
checklistbox
.
checked
=
true
;
if
(
checklistValue
===
"other"
||
checklistValue
===
"others"
){
checkboxOtherValue
=
checklistValue
;
document
.
getElementById
(
`dependentTB_
${
key
}
`
).
value
=
checkboxOtherValue
;
document
.
getElementById
(
`dependentTB_
${
key
}
`
).
style
.
display
=
'inline-block'
;
isFirstCheckboxOtherValue
=
false
;
}
}
else
{
if
(
isFirstCheckboxOtherValue
){
checkboxOtherValue
=
checklistValue
;
isFirstCheckboxOtherValue
=
false
;
}
else
{
document
.
getElementById
(
key
).
value
=
v
;
checkboxOtherValue
=
checkboxOtherValue
+
","
+
checklistValue
;
}
const
checkOther1
=
document
.
querySelector
(
`#checklistContainer_
${
key
}
input[value="other"]`
);
if
(
checkOther1
){
console
.
log
(
"checkOther1 checked"
);
checkOther1
.
checked
=
true
;
}
const
checkOther2
=
document
.
querySelector
(
`#checklistContainer_
${
key
}
input[value="others"]`
);
if
(
checkOther2
){
console
.
log
(
"checkOther2 checked"
);
checkOther2
.
checked
=
true
;
}
document
.
getElementById
(
`dependentTB_
${
key
}
`
).
value
=
checkboxOtherValue
;
document
.
getElementById
(
`dependentTB_
${
key
}
`
).
style
.
display
=
'inline-block'
;
}
}
}
else
{
document
.
getElementById
(
key
).
value
=
v
;
}
continue
;
}
}
...
...
@@ -1254,6 +1271,13 @@ export async function populateFields(imagePath) {
// displayFields("fields");
}
export
function
clearForm
()
{
// Check if the form element exists
const
formElement
=
document
.
getElementById
(
"fields"
);
...
...
WebGde/WebContent/WebGde-Widgets/Submit/XMLWriter/XML_Saver.js
View file @
92b796ba
...
...
@@ -46,7 +46,7 @@ export async function WriteForm(e,metrics,doctype,section) {
});
fields
[
Object
.
keys
(
lookup
[
fid
]).
includes
(
'aka'
)
?
lookup
[
fid
].
aka
.
replace
(
"field"
,
""
)
:
fid
]
=
selectedValue
;
i
+=
radioButtons
.
length
;
//increment the number of radio buttons to skip the other radio button inputs.
i
+=
radioButtons
.
length
-
1
;
//increment the number of radio buttons to skip the other radio button inputs.
continue
;
}
...
...
@@ -69,7 +69,7 @@ export async function WriteForm(e,metrics,doctype,section) {
});
fields
[
Object
.
keys
(
lookup
[
fid
]).
includes
(
'aka'
)
?
lookup
[
fid
].
aka
.
replace
(
"field"
,
""
)
:
fid
]
=
selectedValue
;
i
+=
checkboxButtons
.
length
;
//increment the number of checkboxes to skip the checkboxes input
i
+=
checkboxButtons
.
length
-
1
;
//increment the number of checkboxes to skip the checkboxes input
continue
;
}
fields
[
Object
.
keys
(
lookup
[
fid
]).
includes
(
'aka'
)
?
lookup
[
fid
].
aka
.
replace
(
"field"
,
""
)
:
fid
]
=
Nodes
[
i
].
value
;
...
...
WebGde/WebContent/WebGde-Widgets/Submit/submit.js
View file @
92b796ba
...
...
@@ -84,7 +84,7 @@ export const submitForm = async (e) => {
}
else
{
createInfoModal
(
null
,
'OK'
,
'Invalid or Missing data on highlighted fields!'
);
}
return
false
return
false
;
}
else
{
const
metrics
=
stopMetricCapture
();
...
...
@@ -93,8 +93,8 @@ export const submitForm = async (e) => {
}
return
true
}
catch
(
err
)
{
console
.
log
(
err
)
return
false
console
.
log
(
err
)
;
return
false
;
}
}
...
...
WebGde/WebContent/WebGde-Widgets/config.js
View file @
92b796ba
...
...
@@ -8,7 +8,7 @@ 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
const
IP
=
"
54.175.136.51
"
const
IP
=
"
44.202.63.115
"
const
GDE_CONTEXTROOT
=
"WebGde-v121-b1"
export
const
DOMAIN
=
`http://
${
IP
}
:8080`
export
const
CONTEXTROOT
=
"gfs-explorer-ws"
...
...
WebGde/WebContent/WebGde-Widgets/sample_schema/NKTI_Schema.json
View file @
92b796ba
...
...
@@ -35,8 +35,8 @@
"aka"
:
"field5"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"
radiolist
"
,
"
items"
:
[
"M"
,
"F"
,
"others
"
],
"collection"
:
"
dropdown
"
,
"
options"
:
[
"M"
,
"F
"
],
"mandatory"
:
true
}
},
...
...
@@ -72,8 +72,8 @@
"aka"
:
"field9"
,
"validation"
:
{
"fieldLength"
:
20.0
,
"collection"
:
"
radiolist
"
,
"
items"
:
[
"Emergency Room"
,
"Inpatient"
,
"Outpatient"
,
"other
"
],
"collection"
:
"
dropdown
"
,
"
options"
:
[
"Emergency Room"
,
"Inpatient"
,
"Outpatient
"
],
"mandatory"
:
true
}
},
...
...
@@ -82,8 +82,8 @@
"aka"
:
"field10"
,
"validation"
:
{
"fieldLength"
:
7.0
,
"collection"
:
"
radiolist
"
,
"
item
s"
:
[
"Pay"
,
"Service"
,
"other"
],
"collection"
:
"
dropdown
"
,
"
option
s"
:
[
"Pay"
,
"Service"
,
"other"
],
"mandatory"
:
true
}
},
...
...
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