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
8f42e223
Commit
8f42e223
authored
Feb 06, 2023
by
Jorem Magcawas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save form update on next and previous amd change of schema
parent
049513e5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
61 deletions
+30
-61
accessFile.js
WebGde/WebContent/src/accessFile/accessFile.js
+0
-7
getFields.js
WebGde/WebContent/src/getFields/getFields.js
+26
-47
highlight.js
WebGde/WebContent/src/highlight/highlight.js
+0
-2
validateSchema.js
WebGde/WebContent/src/validateSchema/validateSchema.js
+4
-5
No files found.
WebGde/WebContent/src/accessFile/accessFile.js
View file @
8f42e223
...
...
@@ -3,23 +3,16 @@ var File_Path;
var
gfsFileName
;
async
function
accessFile
()
{
var
button
=
0
;
var
size
=
0
;
let
file_url
=
[];
const
elStatus
=
document
.
getElementById
(
'status'
);
function
status
(
text
)
{
elStatus
.
innerHTML
=
text
;
}
const
progressBar
=
document
.
getElementById
(
'progressBar'
);
const
elProgress
=
document
.
getElementById
(
'progress'
);
function
progress
({
loaded
,
total
})
{
// elProgress.innerHTML = Math.round(loaded * .000001) + " mb of " + Math.round(total * .000001);
progressBar
.
value
=
Math
.
round
(
loaded
/
total
*
100
);
}
const
indexedDB
=
window
.
indexedDB
||
window
.
mozIndexedDB
||
...
...
WebGde/WebContent/src/getFields/getFields.js
View file @
8f42e223
...
...
@@ -34,8 +34,7 @@ const displayFields = async (parentID) => {
createSection
(
'Section'
,
div
)
Object
.
keys
(
schema
).
forEach
(
function
(
key
)
{
console
.
log
(
key
+
": "
+
schema
[
key
]);
//doctypes in schema
/* Object.keys(schema).forEach(function(key) {
let doctypes = schema[key];
const { valid, error } = validateSchema(key)
if(!valid){
...
...
@@ -51,11 +50,9 @@ const displayFields = async (parentID) => {
}
}
});
});*/
/*
const { ACCOUNTING_DOCUMENTS } = schema
const
{
ACCOUNTING_DOCUMENTS
}
=
schema
//getDocType = DOC_TYPE1 ;
...
...
@@ -72,9 +69,8 @@ const displayFields = async (parentID) => {
const
{
HR_FILES
}
=
schema
const
{
SECTION3
}
=
HR_FILES
div = deconstruct(SECTION3, div, 'SECTION3')
*/
div
=
deconstruct
(
SECTION3
,
div
,
'SECTION3'
)
const
submit
=
document
.
createElement
(
'input'
)
submit
.
type
=
'submit'
...
...
@@ -240,6 +236,7 @@ const inputString = (key, validation) => {
let
input
=
document
.
createElement
(
'input'
)
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
setAttribute
(
'type'
,
'text'
)
input
.
setAttribute
(
'autocomplete'
,
'off'
)
input
.
addEventListener
(
'focusout'
,
handleInput
)
...
...
@@ -302,6 +299,7 @@ const inputNumeric = (key, validation) => {
const
input
=
document
.
createElement
(
'input'
)
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
setAttribute
(
'type'
,
'text'
)
input
.
setAttribute
(
'autocomplete'
,
'off'
)
input
.
setAttribute
(
'pattern'
,
'[0-9/-]+'
)
...
...
@@ -332,6 +330,7 @@ const inputDate = (key, validation) => {
const
input
=
document
.
createElement
(
'input'
)
input
.
setAttribute
(
'id'
,
`
${
key
}
`
)
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
setAttribute
(
'type'
,
'date'
)
input
.
addEventListener
(
'focusout'
,
handleInput
)
...
...
@@ -358,6 +357,7 @@ const inputDropdown = (key, validation) => {
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
)
...
...
@@ -626,22 +626,23 @@ const createSection = (fieldLabel, div) => {
}
function
saveForm
(
index
){
const
form
=
document
.
querySelector
(
"#fields"
);
const
inputs
=
form
.
querySelectorAll
(
"input,textarea"
);
const
values
=
{};
inputs
.
forEach
(
input
=>
{
if
(
input
.
value
!=
''
){
values
[
input
.
name
]
=
input
.
value
;
}
});
let
formValues
=
{
name
:
document
.
getElementById
(
"Name"
).
value
,
subject
:
document
.
getElementById
(
"Subject"
).
value
,
docNo
:
document
.
getElementById
(
"Document_No"
).
value
,
date
:
document
.
getElementById
(
"Date"
).
value
,
accountNo
:
document
.
getElementById
(
"Account_No"
).
value
,
empNo
:
document
.
getElementById
(
"Employee_No"
).
value
,
}
index
--
;
var
formArray
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'formArray'
));
//formArray.push(formValues);
if
(
typeof
formArray
[
index
]
!==
'undefined'
)
{
formArray
.
splice
(
index
,
1
,
formV
alues
)
formArray
.
splice
(
index
,
1
,
v
alues
)
}
else
{
formArray
.
splice
(
index
,
0
,
formV
alues
)
formArray
.
splice
(
index
,
0
,
v
alues
)
}
sessionStorage
.
setItem
(
'formArray'
,
JSON
.
stringify
(
formArray
));
...
...
@@ -656,36 +657,13 @@ function populateForm(index){
var
formArray
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'formArray'
));
var
name
=
document
.
getElementById
(
"Name"
);
var
subject
=
document
.
getElementById
(
"Subject"
);
var
docNo
=
document
.
getElementById
(
"Document_No"
);
var
date
=
document
.
getElementById
(
"Date"
);
var
accountNo
=
document
.
getElementById
(
"Account_No"
);
var
empNo
=
document
.
getElementById
(
"Employee_No"
);
if
(
formArray
[
index
].
name
!=
null
)
{
name
.
value
=
formArray
[
index
].
name
;
}
if
(
formArray
[
index
].
subject
!=
null
)
{
subject
.
value
=
formArray
[
index
].
subject
;
}
if
(
formArray
[
index
].
docNo
!=
null
)
{
docNo
.
value
=
formArray
[
index
].
docNo
;
}
if
(
formArray
[
index
].
date
!=
null
)
{
date
.
value
=
formArray
[
index
].
date
;
}
if
(
formArray
[
index
].
accountNo
!=
null
)
{
accountNo
.
value
=
formArray
[
index
].
accountNo
;
}
if
(
formArray
[
index
].
empNo
!=
null
)
{
empNo
.
value
=
formArray
[
index
].
empNo
;
if
(
formArray
[
index
]
!=
null
)
{
var
currForm
=
formArray
[
index
];
for
(
let
field
in
currForm
)
{
document
.
getElementById
(
field
).
value
=
currForm
[
field
];
}
}
}
\ No newline at end of file
WebGde/WebContent/src/highlight/highlight.js
View file @
8f42e223
...
...
@@ -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/validateSchema/validateSchema.js
View file @
8f42e223
const
validateSchema
=
(
doctype
)
=>
{
const
validate
=
schema
[
doctype
]
const
validateSchema
=
()
=>
{
const
{
ACCOUNTING_DOCUMENTS
}
=
schema
if
(
!
validate
)
return
{
valid
:
false
,
error
:
'SECTION is missing!'
}
if
(
!
ACCOUNTING_DOCUMENTS
)
return
{
valid
:
false
,
error
:
'SECTION is missing!'
}
return
{
valid
:
true
}
}
\ No newline at end of file
}
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