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
e5814719
Commit
e5814719
authored
Oct 05, 2023
by
Owen Ryan Ang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-WG-402' into 'development-mobile'
feat: bpo integration See merge request
!67
parents
aa4e9def
b32256c3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
171 additions
and
53 deletions
+171
-53
rejectElement.js
WebGde/WebContent/WebGde-Widgets/BPO/rejectElement.js
+10
-4
LogInPrompt.js
WebGde/WebContent/WebGde-Widgets/LogInWidget/LogInPrompt.js
+1
-1
submit.js
WebGde/WebContent/WebGde-Widgets/Submit/submit.js
+45
-18
config.js
WebGde/WebContent/WebGde-Widgets/config.js
+2
-2
documentControlWidget.js
...de-Widgets/documentControlWidget/documentControlWidget.js
+54
-4
script.js
WebGde/WebContent/script.js
+9
-0
style.css
WebGde/WebContent/style.css
+50
-24
No files found.
WebGde/WebContent/WebGde-Widgets/BPO/rejectElement.js
View file @
e5814719
...
...
@@ -124,11 +124,12 @@ async function rejectElement() {
export
function
createRejectWindow
(){
let
popUpDisplay
=
document
.
createElement
(
"div"
);
popUpDisplay
.
id
=
"rejectWindow"
;
popUpDisplay
.
classList
.
add
(
"
genericPopup
"
)
popUpDisplay
.
classList
.
add
(
"
modal-container
"
)
let
screenMain
=
document
.
createElement
(
'div'
);
screenMain
.
id
=
'parent_Window'
;
screenMain
.
classList
.
add
(
'parent_Window'
);
// screenMain.classList.add('modal');
screenMain
.
classList
.
add
(
'reject-modal'
);
document
.
body
.
appendChild
(
screenMain
);
var
resList
=
REASON_LIST
.
split
(
","
);
...
...
@@ -184,8 +185,10 @@ export function createRejectWindow(){
cancelButton
.
onclick
=
function
()
{
document
.
getElementById
(
"rejectWindow"
).
remove
();
rejectButton
.
disabled
=
false
;
}
}
popUpDisplay
.
append
(
screenMain
);
popUpDisplay
.
style
.
display
=
"block"
;
document
.
body
.
append
(
popUpDisplay
);
}
...
...
@@ -223,11 +226,13 @@ function setRadioHandler(id){
function
checkLabelComponent
(
textLabel
,
inputval
,
checkboxId
){
let
checkBoxCont
=
document
.
createElement
(
'div'
);
checkBoxCont
.
id
=
'checkBoxCont'
;
checkBoxCont
.
classList
.
add
(
"radio-like-checkbox"
);
let
inp
=
document
.
createElement
(
"input"
);
inp
.
id
=
checkboxId
;
inp
.
setAttribute
(
'type'
,
'radio'
);
inp
.
name
=
"rejectRadio"
;
inp
.
classList
.
add
(
"radioOption"
);
inp
.
value
=
inputval
;
inp
.
style
.
order
=
1
;
inp
.
style
.
marginTop
=
0
;
...
...
@@ -298,7 +303,8 @@ function createButtonElem(className, buttonName, icon) {
function
saveExceptionToXml
(){
var
selected
=
document
.
querySelector
(
'input[name="rejectRadio"]:checked'
).
value
;
var
elementId
=
sessionStorage
.
getItem
(
"element_id"
);
let
urls
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"dir_files"
));
let
urls
=
{};
// let urls = JSON.parse(sessionStorage.getItem("dir_files")); TO_DO
let
doctype
;
let
section
;
...
...
WebGde/WebContent/WebGde-Widgets/LogInWidget/LogInPrompt.js
View file @
e5814719
...
...
@@ -115,7 +115,7 @@ function createPrompt(){
let
modalContainer
=
document
.
createElement
(
"div"
);
modalContainer
.
setAttribute
(
"class"
,
"modal-container"
);
modalContainer
.
setAttribute
(
"id"
,
"modal-container"
);
let
modal
=
document
.
createElement
(
"div"
);
modal
.
setAttribute
(
"class"
,
"modal"
);
modal
.
setAttribute
(
"id"
,
"modal"
);
...
...
WebGde/WebContent/WebGde-Widgets/Submit/submit.js
View file @
e5814719
...
...
@@ -3,6 +3,7 @@ import { saveForm } from "../DataInputWidget/generateFields.js";
import
{
checkValidValues
,
validateInput
}
from
"../DataInputWidget/validateInput.js"
;
import
{
uploadFile
}
from
"../FileUpload/fileUpload.js"
;
import
{
global_end_time
,
saveMetrics
,
stopMetricCapture
,
setGlobalEndTime
,
interval
}
from
"../captureMetrics/captureMetrics.js"
;
import
{
IS_RETRIEVE_FROM_BPO
}
from
"../config.js"
;
import
{
createInfoModal
}
from
"../genericPopup/genericPopup.js"
;
import
{
Settings
}
from
"./XMLWriter/Global.js"
;
import
{
urlGetFile
}
from
"./XMLWriter/WebServices.js"
;
...
...
@@ -93,22 +94,41 @@ export const submitForm = async (e) => {
}
else
{
let
response
=
await
WriteForm
(
e
,
[],
doctype
,
section
);
await
batchUpload
(
Form
);
if
(
response
!==
false
)
{
let
folderName
=
sessionStorage
.
getItem
(
"recentlySavedFileNameOnly"
);
let
folderPath
=
TEMPORARY_FOLDER
+
"/"
+
folderName
let
filePath
=
{
"filePath"
:
folderPath
+
"/"
+
sessionStorage
.
getItem
(
"recentlySavedFileName"
)
};
console
.
log
(
filePath
);
let
getFile
=
await
fetch
(
urlGetFile
,
{
method
:
"POST"
,
headers
:
{
'Content-Type'
:
'application/json'
},
body
:
JSON
.
stringify
(
filePath
)
});
// await uploadTOGFS(await getFile.text(), sessionStorage.getItem("recentlySavedFileName"));
if
(
IS_RETRIEVE_FROM_BPO
===
"N"
){
let
response
=
await
WriteForm
(
e
,
[],
doctype
,
section
);
await
batchUpload
(
Form
);
if
(
response
!==
false
)
{
let
folderName
=
sessionStorage
.
getItem
(
"recentlySavedFileNameOnly"
);
let
folderPath
=
TEMPORARY_FOLDER
+
"/"
+
folderName
let
filePath
=
{
"filePath"
:
folderPath
+
"/"
+
sessionStorage
.
getItem
(
"recentlySavedFileName"
)
};
console
.
log
(
filePath
);
let
getFile
=
await
fetch
(
urlGetFile
,
{
method
:
"POST"
,
headers
:
{
'Content-Type'
:
'application/json'
},
body
:
JSON
.
stringify
(
filePath
)
});
console
.
log
(
await
getFile
.
text
());
// await uploadTOGFS(await getFile.text(), sessionStorage.getItem("recentlySavedFileName"));
}
else
if
(
IS_RETRIEVE_FROM_BPO
===
"Y"
){
let
response
=
await
WriteForm
(
e
,
[],
doctype
,
section
);
await
batchUpload
(
Form
);
if
(
response
!==
false
)
{
let
folderName
=
sessionStorage
.
getItem
(
"recentlySavedFileNameOnly"
);
let
folderPath
=
TEMPORARY_FOLDER
+
"/"
+
folderName
let
filePath
=
{
"filePath"
:
sessionStorage
.
getItem
(
"element_file_loc"
)
};
console
.
log
(
filePath
);
let
getFile
=
await
fetch
(
urlGetFile
,
{
method
:
"POST"
,
headers
:
{
'Content-Type'
:
'application/json'
},
body
:
JSON
.
stringify
(
filePath
)
});
}
}
}
else
{
createInfoModal
(
null
,
'OK'
,
'Error while uploading'
);
...
...
@@ -147,8 +167,14 @@ export async function batchUpload(Form){
let
Nodes
=
Form
.
elements
;
let
file
;
let
fileName
;
let
folderName
=
sessionStorage
.
getItem
(
"recentlySavedFileNameOnly"
);
let
directory
=
TEMPORARY_FOLDER
+
"/"
+
folderName
let
folderName
;
let
directory
;
if
(
IS_RETRIEVE_FROM_BPO
===
"N"
){
folderName
=
sessionStorage
.
getItem
(
"recentlySavedFileNameOnly"
);
directory
=
TEMPORARY_FOLDER
+
"/"
+
folderName
}
else
{
directory
=
sessionStorage
.
getItem
(
"element_file_loc"
)
}
for
(
var
i
=
0
;
i
<
Nodes
.
length
;
i
++
){
if
(
Nodes
[
i
].
name
===
'hidden_file_content'
){
var
fileId
=
Nodes
[
i
].
id
;
// Get the ID of the current node
...
...
@@ -164,6 +190,7 @@ export async function batchUpload(Form){
}
}
}
}
async
function
uploadTOGFS
(
stream
,
filename
){
...
...
WebGde/WebContent/WebGde-Widgets/config.js
View file @
e5814719
...
...
@@ -10,7 +10,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
export
const
DOMAIN
=
"http://
18.233.158.67
:8080"
export
const
DOMAIN
=
"http://
54.208.45.179
:8080"
export
const
CONTEXTROOT
=
"gfs-explorer-ws"
export
const
GDE_URL
=
DOMAIN
+
"/MobileGde/svc/gfs-rest"
export
const
FOLDER_URL
=
DOMAIN
+
"/"
+
CONTEXTROOT
+
"/svc/gfs-rest/get-folder?parentPath=/Users/"
...
...
@@ -20,7 +20,7 @@ export const IS_RETRIEVE_FROM_GFS = "N"
export
const
INVALID_KEYS
=
"F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,PrintScreen,ScrollLock,Pause,PageUp,PageDown,Insert,Delete,Control"
//BPO CONFIG
export
const
IS_RETRIEVE_FROM_BPO
=
"
N
"
export
const
IS_RETRIEVE_FROM_BPO
=
"
Y
"
// export const BPO_URL = "http://35.171.20.94:8080/bpo-sqa/"
// export const CURRENT_NODE = "Web GDE"
export
const
BPO_URL
=
DOMAIN
+
"/bpo/"
;
...
...
WebGde/WebContent/WebGde-Widgets/documentControlWidget/documentControlWidget.js
View file @
e5814719
import
{
createRejectWindow
}
from
'../BPO/rejectElement.js'
;
import
{
createReturnWindow
}
from
'../BPO/returnElement.js'
;
import
{
submitForm
}
from
'../Submit/submit.js'
;
import
{
ROOT_FOLDER
}
from
'../config.js'
;
import
{
IS_RETRIEVE_FROM_BPO
,
ROOT_FOLDER
}
from
'../config.js'
;
import
{
createInfoModal
}
from
'../genericPopup/genericPopup.js'
;
import
{
BPO_OBJECT
,
DISPLAY_FIELD_OBJECT
,
DOCUMENT_CONTROL_OBJECT
,
IMAGE_VIEWER_OBJECT
,
INDEXED_DB_STORAGE
}
from
'../globalVariable.js'
;
...
...
@@ -8,6 +10,8 @@ export class DocumentControlWidget {
global
=
{
container
:
null
,
submitBtn
:
null
,
returnBtn
:
null
,
rejectBtn
:
null
}
constructor
()
{
...
...
@@ -19,7 +23,6 @@ export class DocumentControlWidget {
this
.
global
.
container
.
id
=
"TiffButtonRight"
;
this
.
global
.
container
.
classList
.
add
(
"ctrl-buttons"
)
this
.
global
.
submitBtn
=
document
.
createElement
(
"div"
);
this
.
global
.
submitBtn
.
title
=
"Submit"
;
this
.
global
.
submitBtn
.
classList
.
add
(
"buttonRightClass"
);
...
...
@@ -30,9 +33,40 @@ export class DocumentControlWidget {
submitIcon
.
alt
=
"Submit"
;
submitIcon
.
height
=
"32"
;
submitIcon
.
width
=
"32"
;
this
.
global
.
submitBtn
.
append
(
submitIcon
);
this
.
global
.
returnBtn
=
document
.
createElement
(
"div"
);
this
.
global
.
returnBtn
.
title
=
"Return"
;
this
.
global
.
returnBtn
.
classList
.
add
(
"buttonRightClass"
);
const
returnIcon
=
document
.
createElement
(
"img"
);
returnIcon
.
classList
.
add
(
"tiffViewerIcons"
);
returnIcon
.
src
=
"."
+
ROOT_FOLDER
+
"/documentControlWidget/assets/return_icon.png"
;
returnIcon
.
alt
=
"Return"
;
returnIcon
.
height
=
"32"
;
returnIcon
.
width
=
"32"
;
this
.
global
.
rejectBtn
=
document
.
createElement
(
"div"
);
this
.
global
.
rejectBtn
.
title
=
"Reject"
;
this
.
global
.
rejectBtn
.
classList
.
add
(
"buttonRightClass"
);
const
rejectIcon
=
document
.
createElement
(
"img"
);
rejectIcon
.
classList
.
add
(
"tiffViewerIcons"
);
rejectIcon
.
src
=
"."
+
ROOT_FOLDER
+
"/documentControlWidget/assets/reject_icon.png"
;
rejectIcon
.
alt
=
"Reject"
;
rejectIcon
.
height
=
"32"
;
rejectIcon
.
width
=
"32"
;
this
.
global
.
container
.
appendChild
(
this
.
global
.
submitBtn
);
this
.
global
.
submitBtn
.
append
(
submitIcon
);
this
.
global
.
returnBtn
.
append
(
returnIcon
);
this
.
global
.
rejectBtn
.
append
(
rejectIcon
);
if
(
IS_RETRIEVE_FROM_BPO
===
"Y"
){
this
.
global
.
container
.
appendChild
(
this
.
global
.
submitBtn
);
this
.
global
.
container
.
appendChild
(
this
.
global
.
returnBtn
);
this
.
global
.
container
.
appendChild
(
this
.
global
.
rejectBtn
);
}
else
{
this
.
global
.
container
.
appendChild
(
this
.
global
.
submitBtn
);
}
this
.
addEvenListeners
();
}
...
...
@@ -48,6 +82,14 @@ export class DocumentControlWidget {
}
}
this
.
global
.
returnBtn
.
onclick
=
(
e
)
=>
{
createReturnWindow
();
}
this
.
global
.
rejectBtn
.
onclick
=
(
e
)
=>
{
createRejectWindow
();
}
}
getWidget
()
{
...
...
@@ -58,4 +100,12 @@ export class DocumentControlWidget {
return
this
.
global
.
submitBtn
;
}
getReturnBtn
()
{
return
this
.
global
.
returnBtn
;
}
getRejectBtn
()
{
return
this
.
global
.
rejectBtn
;
}
}
WebGde/WebContent/script.js
View file @
e5814719
...
...
@@ -135,8 +135,17 @@ export function removeLoadingScreen() {
}
<<<<<<<
WebGde
/
WebContent
/
script
.
js
export
async
function
resetGDE
(){
// TO-DO
}
function
init
(){
console
.
log
(
"Application Started"
);
=======
function
init
()
{
console
.
log
(
"Application Started"
);
>>>>>>>
WebGde
/
WebContent
/
script
.
js
}
function
testFunction
()
{
...
...
WebGde/WebContent/style.css
View file @
e5814719
...
...
@@ -477,41 +477,45 @@ span#filename {
backdrop-filter
:
blur
(
4px
);
}
.normalButton
{
border
:
solid
1px
black
;
width
:
fit-content
;
font-size
:
14px
;
padding
:
4.5px
;
height
:
fit-content
;
display
:
inline-block
;
vertical-align
:
middle
;
transition
:
color
.6s
ease-in-out
,
box-shadow
.6s
ease-in-out
;
}
.floatingButtonPanel
{
width
:
fit-content
;
display
:
flex
;
text-align
:
right
;
margin-top
:
9px
;
display
:
inline-block
;
vertical-align
:
middle
;
float
:
right
;
width
:
150px
;
width
:
100%
;
padding
:
0px
;
}
.emphasizeButton
{
border
:
solid
1px
black
;
border-radius
:
2px
;
display
:
inline-block
;
flex
:
1
;
vertical-align
:
middle
;
margin-right
:
10px
;
/* Adjust the spacing between buttons as needed */
padding
:
10px
20px
;
/* Adjust the padding as needed */
border
:
none
;
cursor
:
pointer
;
width
:
40%
;
background-color
:
#00a8c0
;
color
:
white
;
font-family
:
OpenSans
,
sans-serif
;
background-color
:
#0057a4
;
font-size
:
14px
;
vertical-align
:
middle
;
padding
:
5px
16px
;
margin-right
:
6px
;
cursor
:
pointer
;
transition
:
color
.6s
ease-in-out
,
box-shadow
.6s
ease-in-out
;
}
.normalButton
{
display
:
inline-block
;
margin-left
:
10px
;
color
:
white
;
flex
:
1
;
vertical-align
:
middle
;
margin-right
:
10px
;
/* Adjust the spacing between buttons as needed */
padding
:
10px
20px
;
/* Adjust the padding as needed */
border
:
none
;
cursor
:
pointer
;
background-color
:
white
;
color
:
blaock
;
font-family
:
OpenSans
,
sans-serif
;
font-size
:
14px
;
cursor
:
pointer
;
border
:
1px
solid
#000
;
transition
:
color
.6s
ease-in-out
,
box-shadow
.6s
ease-in-out
;
}
...
...
@@ -949,6 +953,28 @@ span#filename {
margin
:
2px
;
}
.reject-modal
{
overflow
:
auto
;
background-color
:
#fff
;
position
:
absolute
;
padding
:
15px
;
top
:
15%
;
left
:
10%
;
right
:
10%
;
width
:
80%
;
height
:
fit-content
;
max-height
:
70%
;
border-radius
:
5px
;
/* border: 2px solid #000; */
animation-name
:
modalTransition
;
animation-duration
:
.4s
;
box-shadow
:
13px
13px
21px
4px
rgba
(
32
,
29
,
29
,
0.63
);
-webkit-box-shadow
:
13px
13px
21px
4px
rgba
(
32
,
29
,
29
,
0.63
);
-moz-box-shadow
:
13px
13px
21px
4px
rgba
(
32
,
29
,
29
,
0.63
);
}
.button
{
border
:
1px
solid
#000
;
color
:
#fff
;
...
...
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