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
0e01bc0f
Commit
0e01bc0f
authored
Dec 05, 2023
by
Owen Ryan Ang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demo comments implem
parent
1216179c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
98 additions
and
67 deletions
+98
-67
DataInputWidget.css
...ontent/WebGde-Widgets/DataInputWidget/DataInputWidget.css
+14
-3
captureImage.js
...bGde-Widgets/DataInputWidget/ImageCapture/captureImage.js
+7
-1
generateFields.js
...bContent/WebGde-Widgets/DataInputWidget/generateFields.js
+39
-57
ElementListWidget.css
...nt/WebGde-Widgets/ElementListWidget/ElementListWidget.css
+3
-4
XML_Saver.js
...e/WebContent/WebGde-Widgets/Submit/XMLWriter/XML_Saver.js
+14
-2
DocumentControl.css
.../WebGde-Widgets/documentControlWidget/DocumentControl.css
+1
-0
documentControlWidget.js
...de-Widgets/documentControlWidget/documentControlWidget.js
+10
-0
dev_schema.json
...e/WebContent/WebGde-Widgets/sample_schema/dev_schema.json
+10
-0
No files found.
WebGde/WebContent/WebGde-Widgets/DataInputWidget/DataInputWidget.css
View file @
0e01bc0f
...
...
@@ -91,7 +91,7 @@ h3 {
flex-direction
:
column
;
border
:
none
;
outline
:
none
;
padding
:
0px
4px
2
0px
4px
;
padding
:
0px
4px
0px
4px
;
flex-wrap
:
nowrap
;
}
...
...
@@ -177,8 +177,10 @@ h3 {
width
:
100%
;
}
input
[
type
=
"date"
]
::-webkit-inner-spin-button
,
input
[
type
=
"date"
]
::-webkit-calendar-picker-indicator
{
display
:
none
;
-webkit-appearance
:
none
;
}
input
[
type
=
"date"
]
{
...
...
@@ -190,6 +192,7 @@ input[type="date"] {
padding-left
:
44px
!important
;
}
input
[
type
=
"time"
]
::-webkit-inner-spin-button
,
input
[
type
=
"time"
]
::-webkit-calendar-picker-indicator
{
display
:
none
;
}
...
...
@@ -208,6 +211,10 @@ label {
font-weight
:
700
;
}
.asterisk
{
color
:
#ff3333
;
}
.captureButtons
{
display
:
inline-block
;
width
:
100%
;
...
...
@@ -320,7 +327,7 @@ input[type=file]:hover {
}
.image-capture
button
{
width
:
75
%
;
width
:
100
%
;
border-radius
:
8px
;
display
:
flex
;
justify-content
:
center
;
...
...
@@ -384,7 +391,7 @@ input[type=file]:hover {
}
.fingerprint-capture
button
{
width
:
75
%
;
width
:
100
%
;
border-radius
:
8px
;
display
:
flex
;
justify-content
:
center
;
...
...
@@ -423,6 +430,10 @@ select {
color
:
#444
;
}
select
::-ms-expand
{
display
:
none
;
}
.select2-selection--single
{
border-style
:
none
!important
;
...
...
WebGde/WebContent/WebGde-Widgets/DataInputWidget/ImageCapture/captureImage.js
View file @
0e01bc0f
import
{
createConfirmationModal
}
from
"../../genericPopup/genericPopup.js"
;
export
function
processCapture
(
key
,
imgFilename
,
imgFileSize
)
{
const
form
=
document
.
getElementById
(
'fields'
);
const
img
=
document
.
getElementById
(
`
${
key
}
_zz`
);
...
...
@@ -68,7 +70,7 @@ export function processCapture(key, imgFilename, imgFileSize) {
document
.
getElementById
(
`
${
key
}
_container`
).
style
.
display
=
'none'
;
document
.
getElementById
(
`
${
key
}
_x`
).
addEventListener
(
'click'
,
()
=>
{
function
deleteImage
()
{
img
.
src
=
''
;
container
.
innerHTML
=
''
;
container
.
style
.
display
=
'none'
;
...
...
@@ -77,6 +79,10 @@ export function processCapture(key, imgFilename, imgFileSize) {
// Clear the hidden fields
hiddenFnameInput
.
remove
();
hiddenFileContentInput
.
remove
();
}
document
.
getElementById
(
`
${
key
}
_x`
).
addEventListener
(
'click'
,
()
=>
{
createConfirmationModal
(
deleteImage
,
"Delete Image?"
)
});
}
...
...
WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
View file @
0e01bc0f
...
...
@@ -41,20 +41,6 @@ export async function generateFields(inputSchema, containerId) {
// Make sure input fields are clear
clearFields
(
containerId
);
let
header1
=
document
.
createElement
(
"h1"
);
header1
.
textContent
=
" "
;
header1
.
classList
.
add
(
"field-header"
);
let
header2
=
document
.
createElement
(
"h2"
);
header2
.
textContent
=
" "
;
header2
.
classList
.
add
(
"field-header"
);
let
header3
=
document
.
createElement
(
"h3"
);
header3
.
setAttribute
(
'id'
,
'counter'
);
header3
.
textContent
=
" "
;
header3
.
classList
.
add
(
"field-header"
);
divContainer
.
appendChild
(
header1
);
divContainer
.
appendChild
(
header2
);
divContainer
.
appendChild
(
header3
);
let
container
=
document
.
createElement
(
"form"
);
container
.
id
=
"fields"
;
divContainer
.
appendChild
(
container
);
...
...
@@ -218,7 +204,7 @@ export async function generateFields(inputSchema, containerId) {
});
$
(
document
).
ready
(
function
()
{
$
(
'form:first *:input[type!=hidden]:first'
).
focus
();
// Run code
// $('form:first *:input[type!=hidden]:first').focus();
});
}
...
...
@@ -1585,50 +1571,37 @@ const inputGeoTag = (key, validation) => {
*/
const inputDropdown = (key, validation) => {
try {
const {
mandatory,
options
} = validation
const input = document.createElement('
select
')
input.setAttribute('
id
', `${key}`)
input.setAttribute('
name
', `${key}`)
input.classList.add('
dropdown
-
input
')
input.addEventListener('
focusout
', handleInput)
input.addEventListener('
keydown
', function(event) {
if (event.keyCode == 9) {
event.preventDefault();
var elem = document.getElementsByClassName('
select2
-
search__field
');
elem.focus();
}
});
if (options && options.length > 0) {
newOption = document.createElement("option")
newOption.text = '
Choose
an
option
'
newOption.value = null
input.add(newOption)
for (const option of options) {
newOption = document.createElement("option")
newOption.text = option
newOption.value = option
input.add(newOption)
}
} else {
newOption = document.createElement("option")
newOption.text = '
No
option
available
'
newOption.value = null
input.add(newOption)
input.setAttribute('
disabled
', '
false
')
const { mandatory, options } = validation;
const input = document.createElement('
select
');
input.setAttribute('
id
', `${key}`);
input.setAttribute('
name
', `${key}`);
input.classList.add('
dropdown
-
input
');
input.addEventListener('
focusout
', handleInput);
if (options && options.length > 0) {
// Add a placeholder option
const newOption = new Option('
Choose
an
option
', null, false, false);
input.add(newOption);
// Add other options
for (const option of options) {
const newOption = new Option(option, option, false, false);
input.add(newOption);
}
return input
} else {
// Add a disabled option if no options are available
const newOption = new Option('
No
option
available
', null, false, true);
input.add(newOption);
input.setAttribute('
disabled
', '
false
');
}
return input;
} catch (err) {
throw err
throw err;
}
}
};
const inputDbLookup = async (key, validation) => {
try {
...
...
@@ -1755,6 +1728,7 @@ const deconstruct = async (section, container, classAttribute) => {
const validation = getValidation(key, schema)
const { mandatory } = validation;
if (hidden) {
const hiddenField = document.createElement('
div
') // will contain input field and label
...
...
@@ -1798,6 +1772,14 @@ const deconstruct = async (section, container, classAttribute) => {
label.style.color = fieldLabel ? '
#
000000
' : '
#
ff3333
'
labelContainer.appendChild(label)
const mandatoryMarker = document.createElement('
text
');
mandatoryMarker.classList.add('
asterisk
');
mandatoryMarker.textContent = "*";
if(mandatory){
labelContainer.appendChild(mandatoryMarker)
};
const inputContainer = document.createElement('
div
') // input field
inputContainer.setAttribute('
class
', '
inputContainer
' + classAttribute)
newField.appendChild(inputContainer)
...
...
@@ -1862,7 +1844,7 @@ const deconstruct = async (section, container, classAttribute) => {
input = noValidation()
break
}
input.
setAttribute('
class
',
classAttribute)
input.
classList.add(
classAttribute)
inputContainer.appendChild(input)
}
...
...
WebGde/WebContent/WebGde-Widgets/ElementListWidget/ElementListWidget.css
View file @
0e01bc0f
...
...
@@ -34,7 +34,6 @@ body {
height
:
100%
;
overflow-y
:
auto
;
padding-bottom
:
1rem
;
margin-bottom
:
1rem
;
border-bottom
:
1px
solid
#e0e0e0
;
}
...
...
@@ -55,8 +54,8 @@ body {
/* Element Item */
.element-item
{
margin-top
:
1
7
px
;
margin-bottom
:
1
7
px
;
margin-top
:
1
5
px
;
margin-bottom
:
1
5
px
;
margin-left
:
32px
;
font-size
:
20px
;
display
:
flex
;
...
...
@@ -65,7 +64,7 @@ body {
}
.element-item
span
{
font-size
:
20
px
;
font-size
:
18
px
;
font-weight
:
bold
;
}
...
...
WebGde/WebContent/WebGde-Widgets/Submit/XMLWriter/XML_Saver.js
View file @
0e01bc0f
...
...
@@ -82,6 +82,8 @@ export async function WriteForm(e,metrics,doctype,section) {
let
fieldOrder
=
extractAkaValues
(
schema
,
doctype
,
section
);
console
.
log
(
fieldOrder
);
fields
=
removeBlankValues
(
fields
);
let
response
=
await
createOutputXml
(
fields
,
myArray
,
doctype
,
section
,
fieldOrder
);
return
response
;
}
...
...
@@ -221,5 +223,14 @@ async function createBPOXML(fields, metrics, doctype, section, fieldOrder){
}
function
removeBlankValues
(
fields
)
{
for
(
const
key
in
fields
)
{
if
(
fields
.
hasOwnProperty
(
key
))
{
const
value
=
fields
[
key
];
if
(
value
===
''
||
value
===
null
||
value
===
undefined
)
{
delete
fields
[
key
];
}
}
}
return
fields
;
}
\ No newline at end of file
WebGde/WebContent/WebGde-Widgets/documentControlWidget/DocumentControl.css
View file @
0e01bc0f
...
...
@@ -3,6 +3,7 @@
justify-content
:
center
;
height
:
70px
;
background-color
:
white
;
margin-top
:
auto
;
}
.document-control-button
{
...
...
WebGde/WebContent/WebGde-Widgets/documentControlWidget/documentControlWidget.js
View file @
0e01bc0f
...
...
@@ -57,6 +57,16 @@ export class DocumentControlWidget {
addEvenListeners
()
{
window
.
addEventListener
(
"resize"
,
(
e
)
=>
{
const
container
=
this
.
global
.
container
;
if
(
container
.
style
.
display
===
"none"
)
{
container
.
style
.
display
=
"flex"
;
}
else
{
container
.
style
.
display
=
"none"
;
}
})
this
.
global
.
submitBtn
.
onclick
=
async
(
e
)
=>
{
createSubmitWindow
(
e
);
}
...
...
WebGde/WebContent/WebGde-Widgets/sample_schema/dev_schema.json
View file @
0e01bc0f
...
...
@@ -93,6 +93,16 @@
"collection"
:
"image-capture"
,
"mandatory"
:
false
}
},
"Test"
:
{
"fieldLabel"
:
"Test"
,
"aka"
:
"field7"
,
"validation"
:
{
"fieldLength"
:
30
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*_={}[]:;/
\"
|
\\
<>"
,
"mandatory"
:
false
}
}
}
}
...
...
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