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
beb57d7d
Commit
beb57d7d
authored
Feb 07, 2023
by
Daniel Bawag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WG-161 - Modified program to handle schema values dynamically
parent
049513e5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
19 deletions
+10
-19
captureMetrics.js
WebGde/WebContent/src/captureMetrics/captureMetrics.js
+5
-5
getFields.js
WebGde/WebContent/src/getFields/getFields.js
+0
-0
highlight.js
WebGde/WebContent/src/highlight/highlight.js
+0
-2
validateInput.js
WebGde/WebContent/src/validateInput/validateInput.js
+3
-10
validateSchema.js
WebGde/WebContent/src/validateSchema/validateSchema.js
+2
-2
No files found.
WebGde/WebContent/src/captureMetrics/captureMetrics.js
View file @
beb57d7d
...
...
@@ -69,12 +69,12 @@ const startMetricCapture = () => {
console
.
log
(
`key:
${
key
.
key
}
; key_strokes:
${
key_strokes
}
; time_spent:
${((
Date
.
now
()
-
time_start
)
/
1000
)
-
time_pause_spent
}
`
)
// for demonstration purposes
}
window
.
onclick
=
(
event
)
=>
{
if
(
event
.
path
[
0
].
id
==
'pause'
)
{
pauseMetricCapture
();
document
.
getElementById
(
"pause"
).
addEventListener
(
'click'
,
function
(
)
{
pauseMetricCapture
();
disableTiffButtons
();
}
}
}
);
showMetricCapture
();
}
...
...
WebGde/WebContent/src/getFields/getFields.js
View file @
beb57d7d
This diff is collapsed.
Click to expand it.
WebGde/WebContent/src/highlight/highlight.js
View file @
beb57d7d
...
...
@@ -182,8 +182,6 @@ function initHighlight() {
//waits until TIFF image is loaded, since its size is based on the displayed TIFF image
const
observer
=
new
MutationObserver
(
function
(
mutations
,
mutationInstance
)
{
console
.
log
(
sessionStorage
.
getItem
(
"TiffViewer_current"
));
var
TIFFimg
=
document
.
getElementById
(
sessionStorage
.
getItem
(
"TiffViewer_current"
));
if
(
TIFFimg
!=
null
)
{
//waits until width and height has been assigned
...
...
WebGde/WebContent/src/validateInput/validateInput.js
View file @
beb57d7d
...
...
@@ -22,7 +22,7 @@
* errors - list of errors found during validation
*/
// const validateInput = (fieldName, value, schema) => {
const
validateInput
=
(
fieldID
,
value
,
section
)
=>
{
const
validateInput
=
(
fieldID
,
value
)
=>
{
try
{
const
{
valid
,
error
}
=
validateSchema
()
...
...
@@ -66,17 +66,10 @@ const validateInput = (fieldID, value, section) => {
const
getValidation
=
(
fieldID
)
=>
{
// const { SECTION } = schema
const
{
ACCOUNTING_DOCUMENTS
}
=
schema
const
{
SECTION1
}
=
ACCOUNTING_DOCUMENTS
const
{
BANK_APPLICATION_FORMS
}
=
schema
const
{
SECTION2
}
=
BANK_APPLICATION_FORMS
const
{
HR_FILES
}
=
schema
const
{
SECTION3
}
=
HR_FILES
let
section
=
schema
[
sessionStorage
.
getItem
(
"currentDoctype"
)][
sessionStorage
.
getItem
(
"currentSection"
)];
try
{
if
(
Object
.
keys
(
SECTION1
).
includes
(
fieldID
))
return
SECTION1
[
fieldID
].
validation
;
if
(
Object
.
keys
(
SECTION2
).
includes
(
fieldID
))
return
SECTION2
[
fieldID
].
validation
;
if
(
Object
.
keys
(
SECTION3
).
includes
(
fieldID
))
return
SECTION3
[
fieldID
].
validation
;
if
(
Object
.
keys
(
section
).
includes
(
fieldID
))
return
section
[
fieldID
].
validation
;
return
null
;
}
catch
(
err
)
{
...
...
WebGde/WebContent/src/validateSchema/validateSchema.js
View file @
beb57d7d
const
validateSchema
=
(
doctype
)
=>
{
const
validate
=
schema
[
doctype
]
const
validateSchema
=
()
=>
{
const
validate
=
schema
[
sessionStorage
.
getItem
(
"currentDoctype"
)
]
if
(
!
validate
)
return
{
valid
:
false
,
error
:
'SECTION is missing!'
}
return
{
valid
:
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