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
c3340999
Commit
c3340999
authored
Feb 05, 2024
by
Owen Ryan Ang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
geotag start implementation
parent
09e29e7a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
5 deletions
+68
-5
generateFields.js
...bContent/WebGde-Widgets/DataInputWidget/generateFields.js
+47
-2
submit.js
WebGde/WebContent/WebGde-Widgets/Submit/submit.js
+2
-2
config.js
WebGde/WebContent/WebGde-Widgets/config.js
+1
-1
DEV_SCHEMA2.json
.../WebContent/WebGde-Widgets/sample_schema/DEV_SCHEMA2.json
+18
-0
No files found.
WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
View file @
c3340999
...
...
@@ -1603,6 +1603,44 @@ const inputGeoTag = (key, validation) => {
* @returns
* created input field element
*/
const inputGeoTagStart = (key, validation) => {
try {
const {
mandatory,
fieldLength,
collection
} = validation
//Text box to store the longitude and lattitude (for easier submission of data)
const input1 = document.createElement('
input
')
input1.setAttribute('
id
', `${key}`)
input1.setAttribute('
name
', `${key}`)
input1.setAttribute('
class
', `${collection}`)
input1.setAttribute('
type
', '
text
')
input1.setAttribute('
readonly
', '
true
')
if (collection === '
geotagstart
') {
getLocation();
}
// Create a container div to hold both the input and the text node
const container = document.createElement('
div
');
// container.appendChild(input); // Append the input element to the container
container.appendChild(input1); // Append the text container to the container
return container; // Return the combined container
} catch (err) {
throw err;
}
}
/**
*
* @param {*} key
* will serve as id of input field
* @param {*} validation
* validation of field from schema
* @returns
* created input field element
*/
const inputDropdown = (key, validation, readOnly) => {
try {
const { mandatory, options } = validation;
...
...
@@ -1820,7 +1858,11 @@ const deconstruct = async (section, container, classAttribute) => {
hiddenInputGeo.setAttribute('
class
', classAttribute);
inputContainer.appendChild(hiddenInputGeo);
break;
case "geotagstart":
const hiddenInputGeoStart = inputGeoTagStart(key, validation);
hiddenInputGeoStart.setAttribute('
class
', classAttribute);
inputContainer.appendChild(hiddenInputGeoStart);
break;
default:
const hiddenInputDefault = inputHidden(key, validation);
hiddenInputDefault.setAttribute('
class
', classAttribute);
...
...
@@ -1927,6 +1969,9 @@ const deconstruct = async (section, container, classAttribute) => {
case '
geotag
':
input = inputGeoTag(key, validation)
break
case '
geotagstart
':
input = inputGeoTagStart(key, validation)
break
default:
input = noValidation()
break
...
...
@@ -1934,7 +1979,7 @@ const deconstruct = async (section, container, classAttribute) => {
input.classList.add(classAttribute)
inputContainer.appendChild(input)
if (hidden && ["geotag", "altitude", "direction"].includes(collection)){
if (hidden && ["geotag", "
geotagstart", "
altitude", "direction"].includes(collection)){
newField.style.display = '
none
'; // Hide the input
newField.classList.add('
hidden
'); // Add '
hidden
' class
}
...
...
WebGde/WebContent/WebGde-Widgets/Submit/submit.js
View file @
c3340999
...
...
@@ -39,7 +39,7 @@ export const submitForm = async (e) => {
const
errorContainer
=
document
.
getElementById
(
`
${
id
}
_error`
);
// Skip submit, buttons, and files
if
(
element
.
classList
.
contains
(
'radioOther'
)
||
element
.
classList
.
contains
(
'checkboxOther'
))
continue
;
if
(
element
.
classList
.
contains
(
'geotag'
)
||
element
.
classList
.
contains
(
'altitude'
)
||
element
.
classList
.
contains
(
'direction'
))
{
if
(
element
.
classList
.
contains
(
'geotag'
)
||
element
.
classList
.
contains
(
'
geotagstart'
)
||
element
.
classList
.
contains
(
'
altitude'
)
||
element
.
classList
.
contains
(
'direction'
))
{
continue
;
}
if
(
type
===
'submit'
)
continue
...
...
@@ -200,7 +200,7 @@ export const returnForm = async (e) => {
const
errorContainer
=
document
.
getElementById
(
`
${
id
}
_error`
);
// Skip submit, buttons, and files
if
(
element
.
classList
.
contains
(
'radioOther'
)
||
element
.
classList
.
contains
(
'checkboxOther'
))
continue
;
if
(
element
.
classList
.
contains
(
'geotag'
)
||
element
.
classList
.
contains
(
'altitude'
)
||
element
.
classList
.
contains
(
'direction'
))
{
if
(
element
.
classList
.
contains
(
'geotag'
)
||
element
.
classList
.
contains
(
'
geotagstart'
)
||
element
.
classList
.
contains
(
'
altitude'
)
||
element
.
classList
.
contains
(
'direction'
))
{
continue
;
}
if
(
type
===
'submit'
)
continue
...
...
WebGde/WebContent/WebGde-Widgets/config.js
View file @
c3340999
...
...
@@ -32,7 +32,7 @@ export const NEXT_NODE = "Completed"
export
const
EXCEPTION_NODE
=
"Exception"
export
const
SHOW_ELEMENT_LIST_VIEWER
=
"Y"
export
const
ADD_NEW_OPTION
=
"N"
export
const
DISPLAYED_DETAILS
=
"
Extra1|Extra2|E
xtra3"
//pipe-delimited
export
const
DISPLAYED_DETAILS
=
"
extra1|extra2|e
xtra3"
//pipe-delimited
export
const
PDF_EXTENSION
=
".pdf"
export
const
JPG_EXTENSION
=
".jpg"
...
...
WebGde/WebContent/WebGde-Widgets/sample_schema/DEV_SCHEMA2.json
View file @
c3340999
...
...
@@ -99,6 +99,24 @@
"mandatory"
:
false
},
"readOnly"
:
false
},
"EndLocation"
:
{
"fieldLabel"
:
"End Location"
,
"aka"
:
"field11"
,
"validation"
:
{
"fieldLength"
:
20.0
,
"collection"
:
"geotag"
,
"mandatory"
:
false
}
},
"StartLocation"
:
{
"fieldLabel"
:
"Start Location"
,
"aka"
:
"field12"
,
"validation"
:
{
"fieldLength"
:
20.0
,
"collection"
:
"geotagstart"
,
"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