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
31cb68eb
Commit
31cb68eb
authored
Sep 15, 2023
by
Leonard Ambros II
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'FEATURE-WG-388' into 'development'
resolution on WG-388 See merge request
!60
parents
55e0429a
30350162
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
12 deletions
+70
-12
generateFields.js
...bContent/WebGde-Widgets/DataInputWidget/generateFields.js
+63
-5
XML_Saver.js
...e/WebContent/WebGde-Widgets/Submit/XMLWriter/XML_Saver.js
+2
-2
config.js
WebGde/WebContent/WebGde-Widgets/config.js
+1
-1
NKTI_Schema.json
.../WebContent/WebGde-Widgets/sample_schema/NKTI_Schema.json
+4
-4
No files found.
WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
View file @
31cb68eb
...
...
@@ -484,7 +484,11 @@ 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
);
...
...
@@ -558,6 +562,7 @@ const inputRadiolist = (key, validation) => {
dropdown1
.
classList
.
add
(
'dropdown'
);
var
dropdownContent
=
document
.
createElement
(
'div'
);
dropdownContent
.
classList
.
add
(
'dropdown-content'
);
dropdownContent
.
setAttribute
(
'id'
,
`dropdownContainer_
${
key
}
`
);
dropdown1
.
appendChild
(
dropdownContent
);
var
isOther
=
false
;
...
...
@@ -573,11 +578,20 @@ 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
);
...
...
@@ -615,11 +629,12 @@ const inputRadiolist = (key, validation) => {
inputTextBox
.
style
.
display
=
'none'
;
// Hide the input text box when "other" radio button is unchecked
}
});
inputTextBox
.
addEventListener
(
"input"
,
event
=>
{
inputTextBox
.
addEventListener
(
'change'
,
event
=>
{
if
(
dependentRadio
.
checked
)
{
dependentRadio
.
value
=
event
.
target
.
value
;
}
});
}
...
...
@@ -1178,13 +1193,56 @@ 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
);
fields
[
"field"
+
k
]
=
v
;
var
fieldId
=
schema
[
doctype
][
section
][
key
].
fieldLabel
;
var
currId
=
fieldId
.
replace
(
" "
,
"_"
)
document
.
getElementById
(
currId
).
value
=
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
}
"]`
);
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'
}
}
else
{
document
.
getElementById
(
key
).
value
=
v
;
}
continue
;
}
}
}
...
...
WebGde/WebContent/WebGde-Widgets/Submit/XMLWriter/XML_Saver.js
View file @
31cb68eb
...
...
@@ -33,7 +33,7 @@ export async function WriteForm(e,metrics,doctype,section) {
continue
;
}
// If the first radio button was found
if
(
Nodes
[
i
].
classList
.
contains
(
'radioFirst'
))
{
if
(
Nodes
[
i
].
classList
.
contains
(
'radioFirst'
))
{
var
key
=
fid
;
const
radioButtons
=
document
.
getElementsByName
(
`radioChoices_
${
key
}
`
);
let
selectedValue
;
...
...
@@ -51,7 +51,7 @@ export async function WriteForm(e,metrics,doctype,section) {
}
// If the first checkbox was found
if
(
Nodes
[
i
].
classList
.
contains
(
'checkboxFirst'
))
{
if
(
Nodes
[
i
].
classList
.
contains
(
'checkboxFirst'
))
{
var
key
=
fid
;
const
checkboxButtons
=
document
.
getElementsByName
(
`checkboxChoices_
${
key
}
`
);
let
selectedValue
=
''
;
...
...
WebGde/WebContent/WebGde-Widgets/config.js
View file @
31cb68eb
...
...
@@ -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.
211.251.2
51"
const
IP
=
"54.
175.136.
51"
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 @
31cb68eb
...
...
@@ -35,8 +35,8 @@
"aka"
:
"field5"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"
dropdown
"
,
"
options"
:
[
"M"
,
"F
"
],
"collection"
:
"
radiolist
"
,
"
items"
:
[
"M"
,
"F"
,
"others
"
],
"mandatory"
:
true
}
},
...
...
@@ -73,7 +73,7 @@
"validation"
:
{
"fieldLength"
:
20.0
,
"collection"
:
"radiolist"
,
"items"
:
[
"Emergency Room"
,
"Inpatient"
,
"Outpatient"
,
"other
s
"
],
"items"
:
[
"Emergency Room"
,
"Inpatient"
,
"Outpatient"
,
"other"
],
"mandatory"
:
true
}
},
...
...
@@ -83,7 +83,7 @@
"validation"
:
{
"fieldLength"
:
7.0
,
"collection"
:
"radiolist"
,
"items"
:
[
"Pay"
,
"Service"
],
"items"
:
[
"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