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
aa1b75c1
Commit
aa1b75c1
authored
Dec 06, 2023
by
Owen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logout
parent
0e01bc0f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
83 additions
and
6 deletions
+83
-6
returnElement.js
WebGde/WebContent/WebGde-Widgets/BPO/returnElement.js
+1
-1
DataInputWidget.css
...ontent/WebGde-Widgets/DataInputWidget/DataInputWidget.css
+1
-1
ElementListWidget.css
...nt/WebGde-Widgets/ElementListWidget/ElementListWidget.css
+14
-0
ElementListWidget.js
...ent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
+38
-0
Logout.js
WebGde/WebContent/WebGde-Widgets/Logout/Logout.js
+10
-0
genericPopup.css
...e/WebContent/WebGde-Widgets/genericPopup/genericPopup.css
+6
-0
genericPopup.js
...de/WebContent/WebGde-Widgets/genericPopup/genericPopup.js
+11
-2
dev_schema.json
...e/WebContent/WebGde-Widgets/sample_schema/dev_schema.json
+2
-2
No files found.
WebGde/WebContent/WebGde-Widgets/BPO/returnElement.js
View file @
aa1b75c1
...
...
@@ -103,7 +103,7 @@ export function createReturnWindow() {
}
}
createConfirmationModal
(
returnButtonFunction
,
"Return to Item List Menu?"
);
createConfirmationModal
(
returnButtonFunction
,
"Return to Item List Menu?"
,
"Any unsubmitted inputs and items will be lost."
);
}
function
createButtonElem
(
className
,
buttonName
,
icon
)
{
...
...
WebGde/WebContent/WebGde-Widgets/DataInputWidget/DataInputWidget.css
View file @
aa1b75c1
...
...
@@ -264,7 +264,7 @@ input:focus, textarea:focus {
border-radius
:
8px
;
}
input
[
type
=
text
],
input
[
type
=
date
],
input
[
type
=
time
]
{
input
[
type
=
text
],
input
[
type
=
date
],
input
[
type
=
time
]
,
textarea
{
width
:
100%
;
/* height: 25px; */
padding
:
11px
16px
;
...
...
WebGde/WebContent/WebGde-Widgets/ElementListWidget/ElementListWidget.css
View file @
aa1b75c1
...
...
@@ -276,4 +276,17 @@ body {
margin-right
:
40px
;
white-space
:
normal
;
overflow-wrap
:
break-word
;
}
.logout-box
{
font-size
:
16px
;
font-weight
:
bold
;
background-color
:
white
;
padding-top
:
10px
;
padding-bottom
:
10px
;
padding-left
:
50px
;
padding-right
:
50px
;
border-style
:
solid
;
border-width
:
thin
;
border-color
:
#E5E8EC
;
}
\ No newline at end of file
WebGde/WebContent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
View file @
aa1b75c1
import
{
createWebGdeInterface
,
removeLoadingScreen
}
from
'../../script.js'
;
import
{
createReturnWindow
}
from
'../BPO/returnElement.js'
;
import
{
populateFields
}
from
'../DataInputWidget/generateFields.js'
;
import
{
logoutKeycloak
}
from
'../Logout/Logout.js'
;
import
{
ADD_NEW_OPTION
,
CURRENT_NODE
,
BPO_URL
,
DISPLAYED_DETAILS
}
from
'../config.js'
;
import
{
DocumentControlWidget
}
from
"../documentControlWidget/documentControlWidget.js"
;
import
{
INDEXED_DB_STORAGE
,
HIGHLIGHT_OBJECT
,
IMAGE_VIEWER_OBJECT
,
INDEXED_DB_NAME
,
INDEXED_DB_TBL_NAME
,
setIndexedDBStorage
,
setHighlightObject
,
setImageViewerObject
,
setBPOObject
,
BPO_OBJECT
,
DISPLAY_FIELD_OBJECT
,
setDisplayFieldObject
,
activateGDE
,
setDocumentControlObject
,
DOCUMENT_CONTROL_OBJECT
,
IS_GDE_ACTIVATED
}
from
"../globalVariable.js"
;
...
...
@@ -104,6 +105,43 @@ export class ElementListWidget {
const
userProfileIcon
=
document
.
createElement
(
"span"
);
userProfileIcon
.
classList
.
add
(
"user-profile-icon"
);
userProfileIcon
.
addEventListener
(
'click'
,
(
event
)
=>
{
// Check if the logout box is already present
const
existingLogoutBox
=
document
.
querySelector
(
".logout-box"
);
if
(
existingLogoutBox
)
{
// If the box exists, remove it (toggle off)
existingLogoutBox
.
remove
();
}
else
{
// If the box doesn't exist, create and append it (toggle on)
const
logoutBox
=
document
.
createElement
(
"div"
);
logoutBox
.
classList
.
add
(
"logout-box"
);
logoutBox
.
textContent
=
"Logout"
;
// Append the logout box to the body or a specific container
document
.
body
.
appendChild
(
logoutBox
);
// Position the box on the lower left of the icon with 50px to the left
const
iconRect
=
userProfileIcon
.
getBoundingClientRect
();
logoutBox
.
style
.
position
=
"absolute"
;
logoutBox
.
style
.
top
=
iconRect
.
bottom
+
"px"
;
// Position below the icon
logoutBox
.
style
.
left
=
iconRect
.
left
-
140
+
"px"
;
// 50px to the left of the left side of the icon
logoutBox
.
addEventListener
(
'click'
,
logoutKeycloak
);
// Add an event listener to close the box when clicking outside
document
.
addEventListener
(
"click"
,
function
(
event
)
{
if
(
!
logoutBox
.
contains
(
event
.
target
)
&&
event
.
target
!==
userProfileIcon
)
{
logoutBox
.
remove
();
}
});
// Stop the click event from propagating, to prevent immediate closure
event
.
stopPropagation
();
}
});
// Append user profile icon to topDiv
topDiv
.
appendChild
(
userProfileIcon
);
...
...
WebGde/WebContent/WebGde-Widgets/Logout/Logout.js
0 → 100644
View file @
aa1b75c1
import
{
createConfirmationModal
}
from
"../genericPopup/genericPopup.js"
;
export
function
logoutKeycloak
(){
createConfirmationModal
(
logoutAndroid
,
"Are you sure you want to Logout?"
,
"Any unsaved progress will be lost."
);
}
function
logoutAndroid
(){
window
.
LoginInterface
.
logoutKeycloak
();
}
\ No newline at end of file
WebGde/WebContent/WebGde-Widgets/genericPopup/genericPopup.css
View file @
aa1b75c1
...
...
@@ -51,6 +51,12 @@
margin-bottom
:
25px
;
}
.warning-message
{
font-style
:
italic
;
font-size
:
16px
;
margin-bottom
:
25px
;
}
.modal-button-container
{
display
:
flex
;
justify-content
:
space-evenly
;
...
...
WebGde/WebContent/WebGde-Widgets/genericPopup/genericPopup.js
View file @
aa1b75c1
...
...
@@ -135,7 +135,7 @@ export function createErrorModal(okButtonAction, buttonTxt, popupTitleText){
});
}
export
function
createConfirmationModal
(
okButtonFunction
,
popupTitleText
)
{
export
function
createConfirmationModal
(
okButtonFunction
,
popupTitleText
,
warningMessage
)
{
var
yesButton
=
document
.
createElement
(
"button"
);
yesButton
.
id
=
"yesButtonModal"
;
yesButton
.
textContent
=
"Yes"
;
...
...
@@ -169,8 +169,17 @@ export function createConfirmationModal(okButtonFunction, popupTitleText) {
var
popupTitle
=
document
.
createElement
(
"p"
);
popupTitle
.
classList
.
add
(
"popup-text"
);
popupTitle
.
textContent
=
popupTitleText
;
popupContent
.
appendChild
(
popupTitle
);
if
(
warningMessage
){
var
warningText
=
document
.
createElement
(
"p"
);
warningText
.
classList
.
add
(
"warning-message"
);
warningText
.
textContent
=
""
+
warningMessage
+
""
;
popupContent
.
appendChild
(
warningText
);
}
popupContent
.
appendChild
(
buttonGroup
);
popupContainer
.
appendChild
(
popupContent
);
...
...
WebGde/WebContent/WebGde-Widgets/sample_schema/dev_schema.json
View file @
aa1b75c1
...
...
@@ -5,7 +5,7 @@
"fieldLabel"
:
"First Name"
,
"aka"
:
"field7"
,
"validation"
:
{
"fieldLength"
:
3
0
,
"fieldLength"
:
5
0
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*_={}[]:;/
\"
|
\\
<>"
,
"mandatory"
:
true
...
...
@@ -15,7 +15,7 @@
"fieldLabel"
:
"Middle Name"
,
"aka"
:
"field72"
,
"validation"
:
{
"fieldLength"
:
3
0
,
"fieldLength"
:
5
0
,
"collection"
:
"alphanumeric"
,
"invalidchar"
:
"`~!@#&$%^*_={}[]:;/
\"
|
\\
<>"
,
"mandatory"
:
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